문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top