mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -202,8 +202,28 @@ function! NERDTreeFocus()
|
||||
endfunction
|
||||
|
||||
function! NERDTreeCWD()
|
||||
|
||||
if empty(getcwd())
|
||||
call nerdtree#echoWarning('current directory does not exist')
|
||||
return
|
||||
endif
|
||||
|
||||
try
|
||||
let l:cwdPath = g:NERDTreePath.New(getcwd())
|
||||
catch /^NERDTree.InvalidArgumentsError/
|
||||
call nerdtree#echoWarning('current directory does not exist')
|
||||
return
|
||||
endtry
|
||||
|
||||
call NERDTreeFocus()
|
||||
call nerdtree#ui_glue#chRootCwd()
|
||||
|
||||
if b:NERDTree.root.path.equals(l:cwdPath)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:newRoot = g:NERDTreeFileNode.New(l:cwdPath, b:NERDTree)
|
||||
call b:NERDTree.changeRoot(l:newRoot)
|
||||
normal! ^
|
||||
endfunction
|
||||
|
||||
function! NERDTreeAddPathFilter(callback)
|
||||
|
Reference in New Issue
Block a user