2011-12-30 64 views

回答

19

嘗試增加

let NERDTreeMapOpenInTab='\r' 

let NERDTreeMapOpenInTab='<ENTER>' 

.vimrc

HTH

+11

這也會導致在目錄上輸入以在新選項卡中打開。 – alice 2011-12-31 09:17:48

+2

沒錯。但沒有其他辦法。 – 2012-01-01 08:06:33

+1

如何遍歷vim中的文件標籤? – navyad 2014-04-29 09:16:12

5

您可能需要添加https://github.com/Nopik/vim-nerdtree-direnter插件以及 - 修復該目錄中打開的問題,因此目錄的節點上輸入只會擴大/崩潰,無法打開新的標籤頁。

+2

嘗試過,但沒有工作:https://github.com/Nopik/vim-nerdtree-direnter/issues/1 – sixtyfootersdude 2015-12-02 17:15:07

2

我用下面的地圖做標籤遍歷:

nnoremap <C-l> gt 
nnoremap <C-h> gT 
+5

這是如何回答這個問題的? – oarfish 2017-10-29 20:53:07

2

將此添加到插件。它需要被添加到文件中,例如:~/.vim/nerdtree_plugin/mymapping.vim。確切的位置將取決於您用於vim的插件管理器。例如對於插入它是~/.vim/plugged/nerdtree/nerdtree_plugin/mymapping.vim

此代碼添加一個輸入鍵的映射,以打開新標籤中的文件,而只是展開/摺疊目錄。對於新選項卡,它還鏡像NERDTree,因此它可以在選項卡之間共享。

call NERDTreeAddKeyMap({ 
    \ 'key': '<CR>', 
    \ 'scope': "Node", 
    \ 'callback': 'OpenInNewTab', 
    \ 'quickhelpText': 'open node' }) 


" FUNCTION: s:openInNewTab(target) {{{1 
function! OpenInNewTab(node) 
    if a:node.path.isDirectory 
    call a:node.activate() 
    else 
    call a:node.activate({'where': 't'}) 
    call g:NERDTreeCreator.CreateMirror() 
    wincmd l 
    endif 
endfunction 
+0

如果我需要更新插件,這會被覆蓋嗎?我認爲如果我刪除然後重新安裝它。 – AldoTheApache 2017-09-15 14:43:13

相關問題