Skip to content

Instantly share code, notes, and snippets.

@eloytoro
Created June 3, 2018 16:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eloytoro/5cdfa72d62b92312edb30dcd25150ac6 to your computer and use it in GitHub Desktop.
Save eloytoro/5cdfa72d62b92312edb30dcd25150ac6 to your computer and use it in GitHub Desktop.
function! NERDTreeFindUpdate()
if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 && expand("%:p") =~ getcwd() && !exists("b:fugitive_type")
:NERDTreeFind
exec "normal! \<c-w>p"
endif
endfunction
augroup nerd
autocmd!
autocmd BufReadPost * call NERDTreeFindUpdate()
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment