nyngwang / NeoZoom.lua

A simple usecase of floating window to help you focus.
MIT License
184 stars 15 forks source link

first usage error #67

Closed Sarna555 closed 1 year ago

Sarna555 commented 1 year ago

I've installed the plugin using packer and run :NeoZoomToggle image

nyngwang commented 1 year ago

@Sarna555 Can you paste your setup for me?

Sarna555 commented 1 year ago

@nyngwang Anything specific? I've recently started using lunar vim

$ lvim --version
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az183-550

and I've just only added

lvim.plugins = {
    {"nyngwang/NeoZoom.lua"},
}
nyngwang commented 1 year ago

@Sarna555 I didn't use lunar vim before, but I guess the culprit is that you didn't call the setup function yourself as per the README section: (Some of the data need to be initialized via setup)

require('neo-zoom').setup { ... }
nyngwang commented 1 year ago

By 0daba34 you should now see the new error message, closing. Feel free to reopen it if you're sure that you did call the setup but still seeing a different error.

nyngwang commented 1 year ago

@Sarna555 Just searched it for you: You should add more key-value pairs for each {table} inside lvim.plugins, see below. In general, there is a convention in Neovim plugins that you should call setup() for each plugin before using it:

lvim.plugins = {
  {
    "lervag/vimtex",
    ft = "tex", -- without ft, it's not working too
    config = function()
      vim.cmd("call vimtex#init()")
    end,
  },
}

Together with my README example you should know how to do it. (still, feel free to ask for helps if you still have trouble on it)

Ref. from LunarVim/LunarVim#3723-comment

Sarna555 commented 1 year ago

@nyngwang ok, thank you! I've been just stuck in the mud assuming that "setup" with default arguments is called always implicitly.