Vim:如何交换按键绑定? (将“|”绑定到“7”键上)
使用德语 Mac 键盘布局,输入 |
很痛苦,因为它绑定到
并且我很难触及 Alt 键。
因此,我想进行以下重新映射(交换 |
和 7
的绑定):
imap 7 <Bar>
imap <A-7> 7
第一个有效,第二个无效。我已经尝试了与 inor
的所有组合(没有重新映射),但没有成功。
也许我不明白重新映射的概念。或者我还缺少其他东西。
Having the German Mac Keyboard Layout, it is a pain to type |
as it is bound to <A-7>
and it is hard for me to reach the Alt key.
Thus, I'd like to do the following remapping (exchanging the binding for |
and 7
):
imap 7 <Bar>
imap <A-7> 7
The first one works, the second one does not. I have already tried all combinations with inor
(no remap) but wasn't successful.
Maybe I don't get the concept of remapping. Or I am missing something else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据我的经验,一些涉及修饰符的重新映射在 MacVim 中根本不起作用。我使用的两种解决方法是:
尝试不同的修饰键,例如 或
使用 Keyboard Maestro(适用于 Mac OS X 的优秀键映射器)来执行重新设置-mapping
In my experience, some re-mappings that involve modifiers simply don't work in MacVim. The two workarounds I use are:
Try a different modifier key, e.g. or
Use Keyboard Maestro (an excellent key mapper for Mac OS X) to do the re-mapping
我认为您正在寻找的答案是:
我使用类似的绑定来交换分号和冒号的使用(除了我的不用于插入模式):
根据 Rory O'Kane 在评论中的建议进行更新(谢谢!)。
I think the answer you're looking for is:
I use similar bindings to swap my semicolon and colon usage (except mine are not for insert mode):
Updated as per Rory O'Kane's suggestion in comments (thanks!).