MacVim, remapping Alt-key as Ctrl-key

2019-08-09 04:20发布

问题:

I am a MacVim user, and I would like to know if it's possible to make the Alt-Option key behave as a Ctrl key.

Thanks for your time.

回答1:

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>

Problem solved!



标签: macvim vim