exvim / main

This is the main repository for exVim!
exvim.github.io
MIT License
739 stars 169 forks source link

How to load plugins on demand for each specific project? #118

Open juaristi opened 8 years ago

juaristi commented 8 years ago

The docs specifically say that it's possible to load additional plugins on a per-project basis by editing the .exvim file:

Load Vim-plugin on demand for different projects based on your .exvim settings.

However, I still haven't found how to do that. I've thoroughly scanned the docs, and even looked at the source code of relevant exvim plugins. Hints?

These .exvim files are not regular vim files, so I can't just put Plugin 'foo'.

This should be documented somewhere. Related: #58.

jwu commented 8 years ago

Hi @juaristi

I agree docs is lake of it. Since I have no time to update it, I will explain it here in short:

You can register listener to detect vim-entry changes so that you can use it to load plugin on demand:

call vimentry#on( 'reset', function('exconfig#reset') )
call vimentry#on( 'changed', function('exconfig#apply') )
call vimentry#on( 'project_type_changed', function('exconfig#apply_project_type') )

Basically we will do this for project_type_changed.