且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MacVim,将Alt键重新映射为Ctrl键

更新时间:2023-12-02 23:32:22

我在MacVim中找不到解决方法,但是 KeyRemap4Macbook 可以达到目的.它是一个FANTASTIC软件,文档非常出色,在困难的映射情况下,我建议所有人使用. 它允许您在可以从应用程序内部打开的xml文件中为每个应用程序自定义映射.绝对是poka-yoke. 这是我在private.xml中针对我的情况写的:

I couldn't find a way of doing it inside MacVim, but KeyRemap4Macbook did the trick. It is a FANTASTIC piece of software, the documentation is just excellent, I recommend it to everybody in difficult mapping situations. It allows you to customize mappings for each app, in an xml file that you can open from inside the app. It's absolutely poka-yoke. This is what I wrote in private.xml, for my situation:

<appdef>
<appname>MacVim</appname>
<equal>org.vim.MacVim</equal>
</appdef>


<item>
<name>Change Right Option key to Control</name>
<identifier>private.remap_rightOption_to_control</identifier>
    <only>MacVim</only>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::CONTROL_R</autogen>
</item>

问题解决了!