Vim-plug: How to load plugins only for specific filetypes?

Created on 16 Jun 2014  路  5Comments  路  Source: junegunn/vim-plug

It is possible? For example:

Plug 'scrooloose/nerdtree', { 'on': 'ft=clojure,lisp' }
enhancement

Most helpful comment

However, I must admit that this is a very interesting topic, so I implemented the feature anyway even though the benefit is still questionable :)

Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Multiple file types
Plug 'scrooloose/nerdtree', { 'for': ['clojure', 'lisp'] }

Thanks.

All 5 comments

No, the on parameter currently only works with commands or <Plug> mappings. Wouldn't be too hard to implement, but most filetype specific plugins (ftplugin) are loaded only when the file of the type is opened so I'm not sure if it's going to be super useful.

However, I must admit that this is a very interesting topic, so I implemented the feature anyway even though the benefit is still questionable :)

Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Multiple file types
Plug 'scrooloose/nerdtree', { 'for': ['clojure', 'lisp'] }

Thanks.

FYI, I managed to reduce the startup time from 102ms to 77ms with this. :ok_hand:

Thank you, I think vim-plug is the best and useful vim plugins manager now :)

Thanks, but even though I'm the author of vim-plug and I like it, I won't argue that it's the best one out there. NeoBundle obviously has more features and probably better tested and more stable thanks to its wider user base. But anyway, I appreciate your compliment :)

Was this page helpful?
0 / 5 - 0 ratings