Reputation:
I am using vim-plug and I want to load a certain plugin only for some specific files. How can I do that?
Suppose I have plugin A. How can I load plugin A only for python and cpp? Similarly, can I prevent vim from loading some plugin B for html and php files?
Upvotes: 1
Views: 1288
Reputation: 544
From the README file of vim-plug:
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
This did not help me much, so I looked elsewhere.
Apparently there is a filetype plugin
option used to define behaviour specific to filetypes. So, to add settings for .py
files, add filetype plugin on
in .vimrc
and create ~/.vim/ftplugin/py.vim
to add settings there.
Upvotes: 1