[mini.deps] Custom rtp
for plugin, eg. sonph/onehalf
with vim/
subdirectory
#1723
-
Contributing guidelines
Module(s)mini.deps QuestionHi, I want to install this color plugin sonph/onehalf now(function()
add({ source = 'sonph/onehalf' })
vim.opt.rtp:append(path_package .. '/pack/deps/opt/onehalf/vim')
end) If using Bundle 'sonph/onehalf', {'rtp': 'vim/'} or using Plug 'sonph/onehalf', { 'rtp': 'vim' } I believe now(function()
add({ source = 'sonph/onehalf', rtp = 'vim' })
end) or using hook: now(function()
add({ source = 'sonph/onehalf',
hooks = {
post = function(plugin)
vim.opt.rtp:append(plugin.path .. "/vim")
end
}
})
end) I have tried using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think manually adding important directories to runtimepath is a reasonable solution here. It doesn't look that common nowadays to have Neovim plugins contain important stuff in not standardized directories (i.e. adding plugin's directory to runtimepath is usually enough). It can be simplified a bit by storing In theory it can be simplified even further by having
Well, they would work, but only after plugin has been actually installed or updated. Not during regular addition (which is most of the time), so this is indeed not an intended way to solve this. Manually adding to runtimepath seems to be okay. Synchronous execution of All in all, I think manual runtimepath tweaking is enough here. I'd consider making
Thanks for using them 🙏 |
Beta Was this translation helpful? Give feedback.
I think manually adding important directories to runtimepath is a reasonable solution here. It doesn't look that common nowadays to have Neovim plugins contain important stuff in not standardized directories (i.e. adding plugin's directory to runtimepath is usually enough).
It can be simplified a bit by storing
local plugin_opt = path_package .. '/pack/deps/opt'
and then usingvim.opt.rtp:append(plugin_opt .. '/onehalf/vim')
.In theory it can be simplified even further by having
MiniDeps.add
return a table with information about adding. If it containspath
then it would bevim.opt.rtp:append(add_details.path .. '/vim')
, but that doesn't look much better (especially considering much more c…