Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to load plugins when used with ftplugin #47

Open
cleahcim opened this issue Jan 18, 2017 · 2 comments
Open

Fails to load plugins when used with ftplugin #47

cleahcim opened this issue Jan 18, 2017 · 2 comments
Labels

Comments

@cleahcim
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants