3
votes

I'm running emacs 24.5.1 (installed from brew) on a macbook pro (osx 10.10.4). I'd like to be able have control and meta keys on both sides of the keyboard, so I'm trying to remap to option and command keys.

The meta key problem is easy to solve. Terminal > Preferences > Keyboard Then check the "Use Option as Meta key" checkbox.

Now I'd like to set the command key to be the control key. This is proving more difficult. I've tried adding this to ~/.emacs:

(setq ns-right-command-modifier 'control)
(setq ns-left-command-modifier 'control)

This didn't to work. Neither did this ...

(setq mac-command-modifier 'control)

When I tried using the command key for C-f the command seemed to be intercepted by the terminal which brought up a search box. Perhaps I need to configure the terminal to ignore a press of the command key?

1
Check out Karabiner. It is able to remap keys only for specific applications. It has built in settings for this for Terminal.app.Randy Morris

1 Answers

0
votes

Found a solution: Emacs on Mac OS X Leopard key bindings

System Preferences > Keyboard > Modifier Keys ...

System Preferences > Keyboard > Modifier Keys ... Then just swap the control and command keys.

The downside of this solution is that the keys remain swapped for all apps, not just for the terminal app or emacs.