![Emacs alt key on mac](https://loka.nahovitsyn.com/43.jpg)
![emacs alt key on mac emacs alt key on mac](https://files.realpython.com/media/emacsv2-pyeval-split.ac6c0b9e67ce.png)
Neither of these key sequences is bound by default in Emacs, so you're not biffing any other useful shortcuts by doing this. If I miss Ctrl-x and hit Ctrl-c accidentally, it still works. I add the second line so that Ctrl-c Ctrl-m will also invoke it, which makes the key sequence even more forgiving. (global-set-key "\C-c\C-m" 'execute-extended-command) (global-set-key "\C-x\C-m" 'execute-extended-command) To enable the Ctrl-x Ctrl-m sequence add the following lines to your. So with this key sequence, invoking M-x involves pressing and holding Ctrl, typing x, then typing m. Note that when you invoke a 2-key sequence with the same modifier key, you can just hold down the modifier key, then press the 2 keys. Rather than mess with the headache of learning to configure every system you work on to know about the Alt key, it's easier to use a key sequence that always works. In particular, when you're logged in to a remote host via telnet or ssh, Alt-x may or may not work, depending on the system type and the terminal configuration.
![emacs alt key on mac emacs alt key on mac](https://user-images.githubusercontent.com/10170372/46351793-3d0b2e80-c626-11e8-8257-23afdb4863d8.png)
There's another very important reason to get in the habit of using a Ctrl sequence: the Alt key is unreliable and nonstandard across platforms. Anything you're going to do thousands of times should be streamlined, so you want to be able to start a M-x sequence with the Ctrl key (once you've completed Item 1!) While I partially agree with his first tip, swapping Caps for Ctrl, at the moment I am not entirely sure of M-x turning into C-x C-m.Īlt-x is one of the most frequently typed Emacs key combos, and it involves scrunching your left hand up. I was reading Effective Emacs by Steve Yegge, where his second tip suggests to get in the habit of invoking M-x without the Alt Key.
![Emacs alt key on mac](https://loka.nahovitsyn.com/43.jpg)