May 15, 2007 – 3:17pm OS X Shortcuts, Terminal, Emacs

There are a lot of key commands that exist in OS X that are based on the standard Emacs keys (which admittedly I know nothing about). In bash, tcsh, and other unix environments you will find a lot of these work, and sometimes they will even work in Cocoa text editing tools as well.

These are supported by Mail, TextEdit, and other a lot of other Cocoa apps:

  • ctrl-a Move to the beginning of the line
  • ctrl-e Move to the end of the line
  • ctrl-f Move forward one character
  • ctrl-b Move back one character
  • ctrl-n Move to next line
  • ctrl-p Move to previous line
  • ctrl-d Delete character to right of cursor
  • ctrl-h Delete character to left of cursor
  • ctrl-k Kill from cursor to end of line (kill remembers what was deleted)
  • ctrl-y Yank back what was killed, at the cursor
  • (these two use their own clipboard, not the cmd-x/c/v one)
  • ctrl-o Insert line after cursor
  • ctrl-t Transpose characters on either side of cursor
  • ctrl-l Center the display on cursor
  • ctrl-v Scroll the display one screen forward

Here’s a pretty complete list of existing Mac key bindings for editing:

<http://www.hcs.harvard.edu/~jrus/Site/system-bindings.html>

Here’s how to add even more bindings to Cocoa (by adding them to

~/Library/KeyBindings/DefaultKeyBinding.dict):

<http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html>

And more on Emacs productivity and the Mac:

<http://bc.tech.coop/blog/060620.html>

Posted in  OS X   |  delicious  Digg

Post a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word