Using VIM with NERDTree and NERDTreeTab, have following key map in my .vimrc so I can find it just by pressing F5

map <F5> :NERDTree<cr>

The problem is that I want cursor stay focused on file window, so I want something like :NERDTreeFind + wincmd p

How should I do this ?



Try this.

map <F5> :NERDTree<cr><c-w>p
| improve this answer | |
  • <C-w>p jumps to the previous window, no matter where it is or how many there are. – romainl Nov 12 '13 at 7:01
  • @romainl Oops, my mistake. – Inglis Baderson Nov 12 '13 at 7:04
  • I think that works for me, I will only press F5 from a file window – Ask and Learn Nov 12 '13 at 7:12
  • @user39569 Yeah, <C-w>w normally works for me too. But if you already have 2 or more windows before pressing <f5>, it may not work as expected. – Inglis Baderson Nov 12 '13 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.