Make it possible to set the command to cd

Signed-off-by: Jo De Boeck <deboeck.jo@gmail.com>
This commit is contained in:
Jo De Boeck 2018-01-26 23:04:31 +02:00
parent b6e3c0db30
commit f5b04ba032
No known key found for this signature in database
GPG Key ID: E809C912CC8B6F67
3 changed files with 16 additions and 1 deletions

View File

@ -630,6 +630,9 @@ NERD tree. These options should be set in your vimrc.
at the beginning of the hidden file names
into account when sorting nodes.
|'NERDTreeChDirCWD'| Tells the NERD tree which command to use to
change dir.
|'NERDTreeChDirMode'| Tells the NERD tree if/when it should change
vim's current working directory.
@ -776,6 +779,17 @@ above nodes would then be sorted like this: >
z100.txt
z110.txt
<
------------------------------------------------------------------------------
*'NERDTreeChDirCMD'*
Values: cd, lcd or tcd.
Default: cd.
Use this option to change the way NERDTree changes directory.
Use cd to change vim's global directoy.
Use lcd to change the directory for the curent window.
Use tcd (neovim only) to change the directory for the current tab.
------------------------------------------------------------------------------
*'NERDTreeChDirMode'*

View File

@ -74,7 +74,7 @@ function! s:Path.changeToDir()
endif
try
execute "cd " . dir
execute g:NERDTreeChDirCMD . dir
call nerdtree#echo("CWD is now: " . getcwd())
catch
throw "NERDTree.PathChangeError: cannot change CWD to " . dir

View File

@ -49,6 +49,7 @@ call s:initVariable("g:NERDTreeCaseSensitiveSort", 0)
call s:initVariable("g:NERDTreeNaturalSort", 0)
call s:initVariable("g:NERDTreeSortHiddenFirst", 1)
call s:initVariable("g:NERDTreeChDirMode", 0)
call s:initVariable("g:NERDTreeChDirCMD", "cd")
call s:initVariable("g:NERDTreeCreatePrefix", "silent")
call s:initVariable("g:NERDTreeMinimalUI", 0)
if !exists("g:NERDTreeIgnore")