I would like to locally develop a neovim
plugin (or contribute to an existing one). For testing and debugging purposes, I would like to use such plugin with my neovim
installation.
Currently, I installed neovim
and the plugins using home-manager
.
I would like to avoid using plugin managers (packer
, lazy
, whatever) because they add yet another layer, and, in the end, they don’t add much compared to HM…
As per How do I install Plugins in NeoVim Correctly - Stack Overflow, I thought that adding the code under ~/.local/share/nvim/site/pack/*/start/
was the way to go:
git clone https://github.com/pwntester/codeql.nvim
ln -s codeql.nvim/ ~/.local/share/nvim/site/pack/myPackages/start/
And I use the following in my init.lua
:
require("codeql.nvim")
But I get the following error when starting nvim
:
Error detected while processing /home/pamplemousse/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/pamplemousse/.config/nvim/init.lua:3: module 'codeql.nvim' not found:
no field package.preload['codeql.nvim']
no file '/nix/store/2p94fz12hid7yl59v1zs6c2brg44y5lw-luajit-2.1.1713773202-env/share/lua/5.1/codeql/nvim.lua'
no file '/nix/store/2p94fz12hid7yl59v1zs6c2brg44y5lw-luajit-2.1.1713773202-env/share/lua/5.1/codeql/nvim/init.lua'
no file '/nix/store/2p94fz12hid7yl59v1zs6c2brg44y5lw-luajit-2.1.1713773202-env/lib/lua/5.1/codeql/nvim.so'
no file '/nix/store/2p94fz12hid7yl59v1zs6c2brg44y5lw-luajit-2.1.1713773202-env/lib/lua/5.1/codeql.so'
stack traceback:
[C]: in function 'require'
/home/pamplemousse/.config/nvim/init.lua:3: in main chunk
It seems that the HM installed neovim
doesn’t look into the XDG base directories.
I couldn’t find an HM option to configure neovim
to do it…
Surely some of you are achieving something similar in your configuration… Welp!
Similar issues:
- Neovim changes in nixpkgs (aka stopped loading plugins from your HOME)
- Neovim with LUA + Packer - #3 by teto
- How do I add a vim-scripts plugin to vim? - #2 by jlesquembre (I guess I could use something similar to this setup, but I would prefer to have a shorter feedback loop - i.e. not to have re-run HM every time I wanna test a change I make to the plugin)