VIM创建映射
我想通过按 pp 创建在正常模式下为 trgiiger 的映射,并且我希望它执行按键序列 ctr w l。我该怎么做呢。我现在有这样的东西,但它不起作用。
nmap nn <C-w-h><CR>
提前致谢
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 like this but it doesn't work.
nmap nn <C-w-h><CR>
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是有效的按键序列。如果您想按 Ctrl+W,然后释放并按 h,则需要以下内容:如果您想按 Ctrl+W 并然后按 h 而不释放 Ctrl (实际上是 Ctrl+WCtrl+H),你需要这个:
我通常在这种情况下创建两张地图,因为有时我的手指会滞后,我会稍晚或稍早释放 Ctrl。两者都有,那就不用担心了。
无需在此处的映射中添加
。<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:If you want to press Ctrl+W and then press h without releasing Ctrl (effectively Ctrl+WCtrl+H), you need this:
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.