monkoose / nvlime

A Common Lisp development environment for Neovim
MIT License
71 stars 4 forks source link

Cannot configure nvlime using vim.g.nvlime_config #16

Closed Sepulchre49 closed 2 months ago

Sepulchre49 commented 2 months ago

I am attempting to set up nvlime to use nvim-cmp as its autocomplete source. Following the documentation, I first tried putting the following in ~/.config/nvim/after/plugin/nvlime.lua:

vim.g.nvlime_config.cmp.enabled = true

However, when I try to load Neovim, I get the following error: Vim(source):E5113: Error while calling lua chunk: ~/.config/nvim/after/plugin/nvlime.lua:1: attempt to index field 'nvlime_config' (a nil value)

I also tried the following steps: 1) Open Neovim 2) Start nvlime server with \<leader>rr 3) Execute (print 'hello) to ensure that nvlime is working 4) Execute :lua vim.g.nvlime_config.cmp.enabled = true

This causes the same error about trying to index nvlime_config (a nil value).

My expectation is that I should be able to configure nvlime after its loaded with the vim.g.nvlime_config Lua table; however, it does not appear to exist even after loading Nvlime in neovim.

Platform:

Ubuntu 22.04.4 LTS on WSL

Neovim version:

NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

SBCL version: Originaly tested with

SBCL 2.1.11

Then upgraded to:

SBCL 2.4.7

Edit: Since posting initial Issue, I have since recompiled Neovim to the latest version. This has not fixed the issue

NVIM v0.10.1
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
monkoose commented 2 months ago

Hello, documentation should be improved for sure. You should firstly declare vim.g.nvlime_config or use it as dictionary.

vim.g.nvlime_config = {}
vim.g.nvlime_config.some_option = ...
vim.g.nvlime_config.another_option = ...

-- or
vim.g.nvlime_config = {
  some_option = ...,
  another_option = ...,
}

And you can't alter plugin behavior with it at runtime.