Compare commits

...

2 Commits

Author SHA1 Message Date
Marc Jakobi
7487a5d0a8 chore: buildVimPlugin -> buildNeovimPlugin 2024-05-25 00:25:53 +02:00
Marc Jakobi
c9d87d1e3a fix: prepend nvim directory to the runtimepath
to ensure that neovim sources user ftplugins before builtin ones.
2024-05-12 23:30:26 +02:00
2 changed files with 9 additions and 5 deletions

View File

@ -105,7 +105,7 @@ with lib;
# The final init.lua content that we pass to the Neovim wrapper.
# It wraps the user init.lua, prepends the lua lib directory to the RTP
# and appends the nvim and after directory to the RTP
# and prepends the nvim and after directory to the RTP
# It also adds logic for bootstrapping dev plugins (for plugin developers)
initLua =
''
@ -134,10 +134,14 @@ with lib;
'')
devPlugins
)
# Append nvim and after directories to the runtimepath
# Prepend nvim and after directories to the runtimepath
# NOTE: This is done after init.lua,
# because of a bug in Neovim that can cause filetype plugins
# to be sourced prematurely, see https://github.com/neovim/neovim/issues/19008
# We prepend to ensure that user ftplugins are sourced before builtin ftplugins.
+ ''
vim.opt.rtp:append('${nvimRtp}/nvim')
vim.opt.rtp:append('${nvimRtp}/after')
vim.opt.rtp:prepend('${nvimRtp}/nvim')
vim.opt.rtp:prepend('${nvimRtp}/after')
'';
# Add arguments to the Neovim wrapper script

View File

@ -5,7 +5,7 @@ with final.pkgs.lib; let
# Use this to create a plugin from a flake input
mkNvimPlugin = src: pname:
pkgs.vimUtils.buildVimPlugin {
pkgs.vimUtils.buildNeovimPlugin {
inherit pname src;
version = src.lastModifiedDate;
};