I want to dynamically load the local plugins when using Neovim.
For example, there are some directories ~/plugin1
and ~/plugin2
(they're colorscheme plugins).
When using Neovim, I try to add ~/plugin1
and ~/plugin1/colors
to runtimepath, but it's not working:
vim.opt.runtimepath:append('~/plugin1')
vim.opt.runtimepath:append('~/plugin1/colors')
The error message says color xxx
is not found.
Then I check vim.api.nvim_get_runtime_lists()
, and it shows the plugin1 folder is not one of the runtimepath returned.
How could I dynamically add a folder to runtimepath???
set runtimepath^=
orset runtimepath+=
is sufficient. The error message: does it come from thecolorscheme
command? You might want to check whether or not you need to expand~
when usingvim.opt.runtimepath:append
in Lua.colorscheme xxx
not found, but thanks for your suggest that expand~
, I will check it.