There is a solution, but it requires some encoding.
You need to update the netrw and NERDTree plugins using the on / off interface.
I create this meaning for you with two files that need to be changed. The files themselves are also attached.
- netrwPlugin.vim is located in the vim installation directory.
- NERD_tree should be in the ~ / .vim / plugin directory (if you are not using pathogen ).
With this change you can use
call DisableNERDTree()
to disable NERD and force vim to use netrw (it is controlled by the source file) and
call HijackNERTW()
To restore NERDTree again.
Of course, you also call functions before and after the corresponding VCS command, either using your own wrapper functions or by changing the VCS itself.
Hope this helps.
Edit 2011-03-17:
Calling these functions manually works well. I.e:
- you call
call DisableNERDTree() - then you are editing the folder
- then you use the vcs command
- and finally
call HijackNERTW()
I updated the patch so that these functions can be used in an automatic way. DisableNERDTree() now changes the directory to the one that opens. For instance:.
fun! NewVCSadd() call DisableNERDTree() :e . "start netrw :VCSAdd<CR> call HijackNERTW() :e . "start NERDTree endfunction
source share