As is widely known, OS X has a collection of keyboard shortcuts involving the arrow keys for editing most text fields including web forms, input boxes, plain text documents, and so on. For example, ⌘← moves the cursor to the beginning of the current line.
Although they are hidden in plain sight, it seems less widely known that OS X also natively supports certain Emacs keyboard shortcuts in those same text areas. For example, to move to the beginning or end of the current line you can press ⌃A or ⌃E. To delete everything on the current line after the cursor use ⌃K. To transpose the characters on the left and right of the cursor, press ⌃T. To recenter the viewport on the current line, press ⌃L. Shortcuts like these can be faster than using ones involving the arrow keys, which requires moving ones fingers away from the home row of the keyboard.
The table below compares the Emacs keybindings with the OS X ones (the Emacs-like ones and more standard ones). For OS X shortcuts we use the usual symbols for the Command ⌘, Shift ⇧, Option ⌥, Control ⌃, Caps Lock ⇪, Delete ⌫, and Function Fn keys and write all letter keys in uppercase. Emacs keybindings are expressed in the usual notation for Control C, Meta (Alt) M, Shift S prefixes and the Delete DEL key and we write the letter keys in lowercase.
|Moving the cursor: move the cursor by character, word, line, etc.|
|Selecting text: extend the selection1 by character, word, paragraph, and line|
|Deleting text: remove characters, words, and lines|
|Search: find text and move between search results|
|Scrolling: move and recenter the viewport|
|Miscellaneous: other insertion, editing, and kill ring2 commands|
- Text System Defaults and Key Bindings from the Cocoa Event Handling Guide in the Mac Developer Library.
- Additional Emacs keyboard shortcuts via a
DefaultKeyBinding.dictfile on GitHub that can be placed in
transient-mark-modein Emacs, press C-SPC first. ↩
The kill ring is an Emacs concept, much like the OS X pasteboard (clipboard), but with a history that can be cycled. The OS X kill and yank commands here make use of a kill ring which is separate from the pasteboard and which can contain only a single element (i.e., no history). ↩