System Config: macOS Sierra, Emacs v26.1 installed from emacsformacosx.com

issue: On a fresh install, the C-x key is mapped to M-x by default.

Is this the default behaviour?

If so, how can I change the keymapping to emulate the default mappings in Ubuntu?

  • 1
    Try it with no user-configuration, aka Emacs -Q. This is probably not an Emacs problem. Check your system preferences, keyboards, modifier keys and also keyboard shortcuts and see if something is wired differently. And, of course, if you installed something like Karabiner, then check that too. – lawlist Aug 20 '18 at 16:39
  • Good point, I forgot to mention, Karabiner is installed. – NahsiN Aug 20 '18 at 16:48
  • C-x and M-x are key sequences (i.e. there's no "C-x key"), so I'm presuming your issue is with modifier keys. It sounds as if the modifier key that you expect to be your control key is actually mapped to meta which, as lawlist says, is almost certainly happening externally to Emacs. It's hard to tell for sure, because you don't say whether any other key sequences are affected. – phils Aug 21 '18 at 3:20

If your problem is that the modifier keys are not mapped as you expected, you can directly set the variables mac-option-modifier, mac-command-modifier and mac-control-modifier (and their right- counterparts) to either 'meta or 'control in your ~/.emacs.d/init.el file.

E.g. (setq mac-command-modifier 'meta) will make the Command key act as a Meta key.

I personally like this setup:

(setq mac-control-modifier 'control)
(setq mac-command-modifier 'meta)
(setq mac-right-option-modifier 'control)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.