1
當我在NERDTree中顯示隱藏文件(I)。然後:NERDTreeToggle退出並:NERDTreeToggle再次。隱藏的文件將消失。有沒有辦法保持以前的狀態?如何讓VIM的NERDTree保持以前的狀態?
當我在NERDTree中顯示隱藏文件(I)。然後:NERDTreeToggle退出並:NERDTreeToggle再次。隱藏的文件將消失。有沒有辦法保持以前的狀態?如何讓VIM的NERDTree保持以前的狀態?
我只是自己修復它, 對於他們有同樣的問題〜你可以使用我的adjusted 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
您在問之前是否閱讀過':help nerdtree'? – romainl
'讓NERDTreeShowHidden = 1' – Kent
@romainl,當然我讀〜我找不到任何解決方案,所以我問。 –