Replies: 2 comments 4 replies
-
Bit late to the party, maybe you know by now but just in case. In your |
Beta Was this translation helpful? Give feedback.
-
As for your loading issue, you need to remember that the whole thing of this package manager is that it loads plugins lazily. I suspect that could be the cause. I see that in usage 1 you manually require the plugin, which triggers Lazy's loading mechanism. Depending on what you're looking for, that could be good (example: colorschemes). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a simple comment toggler plugin which defines a keymap with
autocmd FileType lua lua vim.keymap.set('n', ...)
.Usage 1
Usage 2
With Usage 1, it works fine for most of time when I
:e /some/file.lua
from within nvim and the FileType autocmd is effective. But it does not work if I directly specify the file from shell command line, likenvim /some/file.lua
. As a workaround I have to reload the file with:e
. Withnvim /some/file.lua
it seems like the FileType autocmd is not triggered so the keymap is not defined.With Usage 2 it always works. So what's the difference? Any way to make Usage 1 also work?
(Personally I don't like writing a giant
plugins
table (including plugin'sopts
) which will later be passed torequire'lazy'.setup()
. I prefer explicitly calling each plugin'ssetup()
by myself so theplugins
table will be much shorter.)Beta Was this translation helpful? Give feedback.
All reactions