Domanda

NERDTree has :NERDTreeFind to find the current file in the tree.

How can I make NERDTree update the current file in tree automatically whenever I switch files?

È stato utile?

Soluzione

This should do it, but be aware that the frequent updates make switching buffers quite slow:

:autocmd BufEnter * if &filetype !=# 'nerdtree' | NERDTreeFind | wincmd p | endif

The conditional avoids triggering a find if the NERDTree sidebar itself is entered.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top