I like switching my focus back and forth between the NERDTREE pane and a file and the command Ctrl-ww accomplishes this. I’d like to map this to <Leader>w but variations of map <Leader>w <C-ww><CR> in my .vimrc are not working for me. Any thoughts on how to accomplish this mapping?
I like switching my focus back and forth between the NERDTREE pane and a
Share
It’s not
<C-ww>, it’s<C-w>wor<C-w><C-w>.That’s either Ctrl+w then w or Ctrl+w then Ctrl+w.
So your mapping should be
nnoremap <Leader>w <C-w>wornnoremap <Leader>w <C-w><C-w>.Note that you can use
<C-w>pto move to the previous window and effectively toggle between NERDTree and your active window.See
:help windowfor more infos on windows in Vim.