当我在 NERDTree 中显示隐藏文件(I)时。然后 :NERDTreeToggle 退出并 :NERDTreeToggle 再次进入。隐藏文件将消失。有没有办法保持以前的状态?
问问题
393 次
1 回答
1
我自己修好了,谁有同样的问题~你可以用我调整的nerdtree版本。
或以下补丁。我将尝试向 NERD 团队提交拉取请求。希望他们会接受。
index 3a2d71a..debdcb3 100644
--- a/autoload/nerdtree.vim
+++ b/autoload/nerdtree.vim
@@ -1329,6 +1329,7 @@ endfunction
" toggles the display of bookmarks
function! s:toggleShowBookmarks()
let b:NERDTreeShowBookmarks = !b:NERDTreeShowBookmarks
+ let g:NERDTreeShowBookmarks = b:NERDTreeShowBookmarks
if b:NERDTreeShowBookmarks
call nerdtree#renderView()
call nerdtree#putCursorOnBookmarkTable()
@@ -1342,6 +1343,7 @@ endfunction
" toggles the display of hidden files
function! s:toggleShowFiles()
let b:NERDTreeShowFiles = !b:NERDTreeShowFiles
+ let g:NERDTreeShowFiles = b:NERDTreeShowFiles
call nerdtree#renderViewSavingPosition()
call nerdtree#centerView()
endfunction
@@ -1350,6 +1352,7 @@ endfunction
" toggles the display of hidden files
function! s:toggleShowHidden()
let b:NERDTreeShowHidden = !b:NERDTreeShowHidden
+ let g:NERDTreeShowHidden = b:NERDTreeShowHidden
call nerdtree#renderViewSavingPosition()
call nerdtree#centerView()
endfunction
于 2013-08-26T10:26:19.103 回答