▲ | WhyNotHugo 5 days ago | ||||||||||||||||
The neovim model of using setup() makes lazy loading a bit trickier than traditional Vim. Lazy loading is much easier with Vim’s model of configuring by setting variables. You just set variables in init.vim, and the plugin can auto-load when one of its functions is executed. With lua this requires more orchestration; if many autocmd refer to the same plugin, they all need to explicitly remember to call setup(). | |||||||||||||||||
▲ | mrcjkb 5 days ago | parent | next [-] | ||||||||||||||||
Neovim provides the same mechanisms as Vim for Lua plugins. The problem (and part of my motivation for writing the nvim-best-practices document) is that not enough plugins use them. Edit: The Neovim setup antipattern is the Lua equivalent of writing Vimscript functions in autoload and asking users to call them in their configs instead of doing so automatically. | |||||||||||||||||
| |||||||||||||||||
▲ | kzrdude 5 days ago | parent | prev | next [-] | ||||||||||||||||
The settings variable convention is not good, uses random variable prefixes. A new convention is needed, then the ball can start rolling on that. Until then the lazy nvim and/or setup paradigm is useful. | |||||||||||||||||
| |||||||||||||||||
▲ | saint_yossarian 5 days ago | parent | prev [-] | ||||||||||||||||
AFAIK using setup() is actually a cargo-cult practice and discouraged by the Neovim maintainers. | |||||||||||||||||
|