开发者

mapping control followed by two characters in vim

开发者 https://www.devze.com 2023-04-10 21:04 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消