C'è una scorciatoia che rivela il file corrente nel pannello della directory NerdTree.NerdTree - Reveal file in tree
Come TextMate 'Reveal file in cassetto' - Ctrl + Comando + R
C'è una scorciatoia che rivela il file corrente nel pannello della directory NerdTree.NerdTree - Reveal file in tree
Come TextMate 'Reveal file in cassetto' - Ctrl + Comando + R
in: 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.
Io non credo che sia legato a qualche cosa di default, in modo da avere a fai un keybind te stesso.
nmap ,n :NERDTreeFind<CR>
è ciò che appare nel mio Vimrc, insieme con
nmap ,m :NERDTreeToggle<CR>
check this out, automatizza l'operazione di sincronizzazione, ogni volta che si cambia buffer, il nerdtree verrà automaticamente aggiornata (ho copiato da here con piccole modifiche)
" 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()
Grazie, ho cercato questo per così tanto tempo! :) – Gnagno
Il keymapping funziona, ma come invocare NERDTreeFind all'interno di vim? – toszter
@toszter just': NERDTreeFind' – Thomas
C'è un modo per impostarlo per farlo ogni volta che NERDTree viene creato all'interno di quella scheda? –