How can I use command keys on macbook as control keys for emacs?

I am running emacs 24.5.1 (installed from brew) on macbook pro (osx 10.10.4). I would like to have control and meta keys on both sides of the keyboard, so I am trying to reassign 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 would like to set the command key as the control key. This turns out to be more difficult. I tried adding this to ~ / .emacs:

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

      

It didn't work. Also it was not ...

(setq mac-command-modifier 'control)

      

When I tried to use the command switch for Cf, the command seemed to be intercepted by the terminal, which brought up the search box. Perhaps I need to configure the terminal to ignore the command key press?

+3


source to share


1 answer


Found solution: Emacs in Leopard keybindings on Mac OS X

System Preferences> Keyboard> Modifier Keys ...



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

The downside to this solution is that the keys remain swapped for all applications, not just the terminal application or emacs.

0


source







All Articles