`start` plugins loaded before `.vimrc`
mrcjkb opened this issue · 5 comments
- Neovim v0.9.4
- macOS 14.1.1
- See also: mrcjkb/rustaceanvim#77 (reply in thread)
It appears that start
plugins are loaded/sourced before the .vimrc
, even though the readme says otherwise:
Plugins installed under
pack/*/start/
are automatically added to the'runtimepath'
after.vimrc
is sourced.
To reproduce:
- Install a
start
plugin that has aftplugin/vim.vim
file, containing:
if g:foo_bar
echom "foo_bar is set"
endif
-
Set
g:foo_bar = true
in.vimrc
-
Open a vim file:
vim test.vim
Expected: Vim prints foo_bar is set
Actual: Nothing.
If I manually add a plugin to the default packpath
(without minpac), I cannot reproduce the issue. So I don't think it's a Neovim bug.
I've also been able to reproduce this behaviour with the Neovim derivation in nixpkgs, and will investigate further on that end.
It wraps Neovim with --cmd "set packpath^="
and ---cmd "set rtp^="
- I believe it may be related to that.
Does minpac do something similar?
Does minpac do something similar?
minpac/autoload/minpac/impl.vim
Lines 358 to 361 in 79f60e0
If a plugin has
rplugin
directory, minpac add it to rtp to support :UpdateRemotePlugins
command.Does minpac do something similar?
minpac/autoload/minpac/impl.vim
Lines 358 to 361 in 79f60e0
If a plugin has
rplugin
directory, minpac add it to rtp to support:UpdateRemotePlugins
command.
🤔 that's not the case for the affected plugin.
Sorry for late.
Could you show the result of :scriptnames
? Is the plugin loaded before your vimrc?
Could you also show your vimrc? minimal reproducible example should be better.
No problem 😃
I don't actually use minpac.
This was reported to me by a user of one of the plugins I maintain, who uses minpac (@adaszko).
I was able to reproduce the same behaviour using the the Nix neovim package, which also uses packpath to manage plugins. But I wasn't able to reproduce it with plain (neo)vim without a plugin manager, and by cloning plugins into a start
directory manually.
That's why I opened the issue here.
I am very tight on free time right now, and @adaszko was able to work around the issue by moving it to opt
and using packadd!
.
So it will probably be some time before I get around to setting up an example with minpac.
I've played around with this and come to the conclusion that (at least for my nix setup), this is caused by a call to syntax on
or syntax enable
in init.vim
See this repo which reproduces it.
I could not reproduce it with vim. Only neovim. So I think this issue can be closed.