Подтвердить что ты не робот

NerdTree - отображение файла в дереве

Есть ли ярлык, который показывает текущий файл на панели каталогов NerdTree.

Подобно TextMate 'Отображать файл в Drawer' - Ctrl + Command + R

4b9b3361

Ответ 1

в: h NERDTree:

:NERDTreeFind                                                  :NERDTreeFind
    Find the current file in the tree. If no tree exists for the current tab,
    or the file is not under the current root, then initialize a new tree where
    the root is the directory of the current file.

Я не думаю, что он привязан к чему-либо по умолчанию, поэтому вам нужно сделать сам ключ.

nmap ,n :NERDTreeFind<CR>

- это то, что появляется в моем .vimrc, вместе с

nmap ,m :NERDTreeToggle<CR>

Ответ 2

Проверьте это, он автоматизирует операцию синхронизации, когда вы меняете буфер, nerdtree автоматически обновляется (я скопировал из здесь с крошечным модификаций)

" Check if NERDTree is open or active
function! IsNERDTreeOpen()        
  return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction

" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
" file, and we're not in vimdiff
function! SyncTree()
  if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
    NERDTreeFind
    wincmd p
  endif
endfunction

" Highlight currently open buffer in NERDTree
autocmd BufEnter * call SyncTree()