savq / paq-nvim

🌚 Neovim package manager
MIT License
653 stars 39 forks source link

Lazy plugin loading #26

Closed jc00ke closed 3 years ago

jc00ke commented 3 years ago

For heavy plugins like tpope/vim-rails it would be lovely to have a lazy option like plug. Any interest in this feature? Thanks!

savq commented 3 years ago

No, it's unlikely I'll add this, I'm sorry.

It's worth noting that vim-plug's own lazy loading does very little. In particular, vim-rails defines most of it's logic in the autoload directory (in a single file… but whatever), so it shouldn't increase start-up time much.

Since Vim8 (and neovim) there's also a built-in way to lazy load the entire plugin (:h packadd). You can use that with an autocommand if you want. Unfortunately, neovim doesn't have a way to define autocommands in Lua (see neovim/neovim#12378).


Alternative solution: Declare vim-rails as an optional plugin, and define an autocommand for it

paq {'tpope/vim-rails', opt=true}
vim.cmd [[autocmd Filetype ruby packadd! vim-rails]]
jc00ke commented 3 years ago

Makes sense, and thanks for the pointers! :pray: