views:

43

answers:

1

GNU Emacs on Mac OS X, by default, uses the control key as CTRL, and the command key as META. This drives me crazy, because my MacBook Pro contains only a single control key on the left, while I'm used to having a control key on both sides of the keyboard.

With my GNU Emacs installation, I was able to modify the variables mac-control-modifier, mac-command-modifier, and mac-option-modifier so that command acts as CTRL and option acts as META.

How can I accomplish the same thing in IntelliJ IDEA? It's easy to select "Emacs" as the keymap, but I don't see any way make a similar remapping of CTRL and META. I know I could remap these keys globally in the OS, but I don't want to do that. I also know I could go in to each and every action and individually modify them, but that seems like a poor solution.

+3  A: 

It's may be not the easiest solution but you can open the resources.jar (/Applications/IntelliJIdea.app/lib/resources.jar on MacOS) file, locate the Keymap_Emacs.xml (in idea directory) copy and modify it.

And then you can create a new keymap in IntelliJ for updating it with the new content (~/Library/Preferences/IntelliJIdea90/keymaps on MacOS).

That way you can change all your keymap without changing each action individually.

Colin Hebert
Thanks Colin, that worked fine (and was quite easy). The only thing I'd add to your answer is that placing a straight copy of the (packaged) `Keymap_Emacs.xml` won't work; Idea 9.0 throws a keymap error when booting up. Instead what I ended up doing is opening the Keymap section in Idea's settings, selecting the Emacs keymap, clicking *Copy*, then making one modification, than applying the change. I then opened up the generated keymap xml in `~/Library/Preferences/IntelliJIdea90/keymaps` and performed my search and replace of **control** with **meta** and saved it. Everything works perfectly.
rcampbell