justinmk / vim-sneak

The missing motion for Vim :athletic_shoe:
http://www.vim.org/scripts/script.php?script_id=4809
MIT License
3.24k stars 88 forks source link

Defer plugin loading until first use #261

Closed voyeg3r closed 4 years ago

voyeg3r commented 4 years ago

I use vim-plug to manage my plugins, I would like to be able to defer vim-sneak loading until its first use, so it will not cause any delay on my vim start. Just to give you an example:

Plug 'mattn/emmet-vim' , { 'for': ['html', 'htmldjango', 'javascript.jsx', 'css'] }

In the above case, emmet-vim will only be loaded for the file formats indicated in the list but it is also possible to associate plugin loading with an event.

Here an article about plugin managers and how some of them implement some kind of resource to defer plugin loading.

justinmk commented 4 years ago

? plugin/sneak.vim is the only thing that eagerly loads; the rest in autoload/* is loaded on-demand. The pluginmanager-based deferred loading is a hack offered by pluginmanagers to work around plugins that don't use autoload/.