vim-dist / webvim

WebVim is a vim based distribution targeting JavaScript and Web development
http://webvim.org
GNU General Public License v3.0
330 stars 34 forks source link

Fails to load plugins when used with ftplugin #47

Open cleahcim opened 7 years ago

cleahcim commented 7 years ago

I tried to copy the .vimrc to ftplugin/javascript.vim and it fails to load the plugins with vim-plug. It fails when trying to call NERTreeFind from OpenNerdTree in the plugins/config.vim file. When I check the PluginStatus everything checks out as 'ok'. However, when I call NERDTreeToggle the command isn't found right after vim starts. If I call the command ': call plug#end()' NERDTree commands are there.

It would be nice for me to have this set up only for javascript and I usually use ftplugin for these language specific things.

krampstudio commented 7 years ago

Hi, I'm sure to get exactly what you are trying to achieve but vim-plug hacks somehow the file types loading. If you'd like to enable a plugin for a particular filetype, you can add the for parameter to the plugin definition in plugins/def.vim, for example :

Plug 'editorconfig/editorconfig-vim', { 'commit' : 'a459b8cfef00100da40fd69c8ae92c4d1e63e1d2', 'for' : 'javascript' }
cleahcim commented 7 years ago

ftplugin allows you to load configs based on the filetype that was detected for the file. In this case I was trying to load webvim just on javascript files. I did see that Plug allowed you to specify the filetype on which the plugin was to be loaded. I was trying to avoid all that by simply bootstrapping webvim on javascript files only. I'll dig around and see if I can't get it working and talk with some vim-plug folks to see I can't get it worked out.