I like switching my focus back and forth between the NERDTREE pane and a file and the command Ctrl-ww
accomplishes this. I'd lik开发者_开发知识库e 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?
It's not <C-ww>
, it's <C-w>w
or <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>w
or nnoremap <Leader>w <C-w><C-w>
.
Note that you can use <C-w>p
to move to the previous window and effectively toggle between NERDTree and your active window.
See :help window
for more infos on windows in Vim.
精彩评论