Emacs Keybindings for Mac OS X

As many Mac OS X/Emacs users know, OS X has many of the Emacs key bindings defined for the entire system. Thus, bindings like 【Ctrl+f】, 【Ctrl+b】, 【Ctrl+a】, 【Ctrl+e】, 【Ctrl+k】, 【Ctrl+y】, 【Ctrl+p】, 【Ctrl+n】, and a few others work across the whole system.

Less well known is that the Cocoa Text System is customizable and you can add other Emacs bindings to make a comfortable and familiar environment whether you’re in Emacs, Mail, Safari, or whatever. Even better is that Jacob Rus has already compiled the necessary bindings for you so all you need do is download the file and install it in the proper place on your system.

The full explanation is available here but the TL;DR is:

  1. Download the bindings file.
  2. Rename the file to DefaultKeyBinding.dict.
  3. Stash the file into the ~/Library/KeyBindings folder.

There’s lot of information at the site, though, so it’s well worth a look. It has bindings with 【Esc】 rather than 【⌥ Opt】 as the 【Meta】 key, BBEdit key bindings for any heretics reading this, and many other tidbits as well. But if you just want Emacs key bindings where 【⌥ Opt】 is the 【Meta】 key, then just follow the 3 steps above.

This entry was posted in General and tagged . Bookmark the permalink.