开发者

VIM creating mapping

开发者 https://www.devze.com 2023-03-02 16:29 出处:网络
I want to create mapping that would be trgiiger in normal mode by pressing pp and I want it to execute key sequence ctr w l. How do I do that. I have now sth l开发者_如何学Pythonike this but it doesn\

I want to create mapping that would be trgiiger in normal mode by pressing pp and I want it to execute key sequence ctr w l. How do I do that. I have now sth l开发者_如何学Pythonike this but it doesn't work.

nmap nn <C-w-h><CR>

Thanks in advance


<C-w-h> is not a valid key sequence. If you want to press Ctrl+W and then release and press h, you need the following:

:nmap nn <C-W>h

If you want to press Ctrl+W and then press h without releasing Ctrl (effectively Ctrl+WCtrl+H), you need this:

:nmap nn <C-W><C-H>

I usually create both maps in this situation, because sometimes my fingers lag and I release Ctrl a little later or a little earlier. With both, that's not a worry.

There's no need to add a <CR> to the mapping here.

0

精彩评论

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