Here is a handful of lesser-known Mac OS X keyboard shortcuts that I’ve found to be very useful for working with text. They work in all standard text-fields, which means they work in most programs. Sadly, they don’t work in Microsoft products, and a few other apps that use non-standard text fields.
option = you will see the mouse cursor into a + , and you can now select columns of text! Unfortunately it only seems to work in editable text-fields, which is a great shame.
ctrl + d = forward delete, even if you don’t have it on your MacBook’s keyboard.
ctrl + a = Go to the beginning of the line the insertion-point is on.
ctrl + e = Go to the beginning end of the line line the insertion-point is on.
ctrl + k = “kill the current line”, deletes everything from the right of the insertion point to the next newline. This is very useful in Terminal, because you can delete the tail of a long command
command + delete = “Delete To Beginning Of Line”. Just like ctrl+k, but backwards, not forwards. (It even puts the killed text on the yank-pasteboard — don’t worry if that makes no sense, it’s an emacs-ism I don’t find useful.)
And yes, that’s ctrl, not command, because these are shortcuts inherited from the old UNIX text-editor emacs. There are more emacs “key bindings” that are available, but I have never found them useful. This long list of Mac OS X keyboard shortcuts includes them.
command + ctrl + d = look up the word under the mouse in the dictionary. I can’t believe that other operating systems haven’t done this for decades, it’s that useful.
It is unfortunate when programs use text-fields that do not support commands the operating system should give to every application. It’s always a mistake. Fundamentally, not supporting ctrl+a (go to beginning) is no different then not supporting command+c (copy).
If you find these commands useful, please teach them, and let developers know it’s a problem when you can’t use them. That will improve computing for everyone.
I could be wrong, but i think these commands only work in Cocoa widgets.
Comment by Jason Petersen — March 28, 2008 @ 1:25 pm
Oh yeah, and I noticed you missed ctrl-t, which I find a bit weird but useful; it’s “transpose” and switches the two characters around the cursor.
So if you typed yuor, put the cursor between u and o and hit ctrl-t to fix.
Comment by Jason Petersen — March 28, 2008 @ 1:26 pm
ctrl-a/e and some emacs bindings do work in Carbon text-fields, but I’m not sure what the hard and fast rule is. ctrl-k does not seem to be supported as often. I wish these shortcuts would be officially documented by Apple, because they are useful.
Personally I’ve never found ctrl-t to be useful, and that’s why it’s not in the list. Usually I correct words through the spell checker, and in cases like “teh” I’m not sure that carefully positioning the insertion-point between e and h, then hitting ctrl + t is that much faster then double-clicking on the whole word “teh” (faster then fine positioning) and typing t + h + e (probably slower then recalling and invoking the transpose command). Truth is, ctrl-t is probably slightly faster ergonomically, especially for people who spell better then me — but I’ve never found it useful so it’s not on this list.
Comment by Vincent Gable — April 7, 2008 @ 11:30 pm
[…] See also, my personal list of useful Mac OS X text-editing shortcuts. […]
Pingback by Vincent Gable » Xcode Shortcuts — October 19, 2008 @ 12:29 am