Mac 101: Keyboard text selection
For someone who loves keyboard launchers like Quicksilver, I have to confess an embarrassing deficiency in my keyboard competency: I've never really learned to select text with the keyboard. So I thought the topic would make for a nice beginning of the year Mac 101. The keyboard text selection commands on the Mac are basically standard. To select text you hold down the SHIFT key and then use the arrow keys or HOME, END, PAGEUP, and PAGEDOWN. The left/right arrow keys (plus SHIFT) will increase the selection one character in that direction, if you hold down the OPTION (⌥) key the left/right arrows will select an entire word in that direction, and if you hold down the ⌘ key the left/right arrows will select to the beginning or end of the line. The up/down arrow keys (plus SHIFT) will select a full line up or down; with the OPTION key held down the up/down arrows will select a paragraph. The HOME key (plus SHIFT) will select all the text to the beginning of the document and the END key (plus SHIFT) will select all the text to the end of the document. Finally, the PAGEUP and PAGEDOWN keys (plus SHIFT) will select a full "page" up or down.
Basically the upshot is this: hold down the SHIFT key while in a text field and it will shift to text selection. Also, if you use the keyboard shortcuts without the SHIFT key they will move the cursor without selecting text. If you play around with and internalize these commands I think you'll find that keyboard text selection is often faster than moving your hand to the mouse. These commands can be really handy if you're selecting text in very small boxes where you can't see much (e.g. long names in open and save dialog sheets). One proviso: these shortcuts should work in all Cocoa applications, but they may not all work in non-Cocoa ones.

Reader Comments (Page 1 of 1)
ak said 12:14PM on 1-03-2008
For emacs users: you can do the same with Control-Shift-F and Control-Shift-B.
Reply
James Massey said 12:26PM on 1-03-2008
Oh, would that it were that easy! Try that in pages, or Mail. There Home and End go to the start and end of the document. In some apps, Command-Shift right is to move one word, others it moves an entire line. Some apps recoginze good old Ctrl-e/Ctrl-a to start and end of line. Others don't.
This is the worst bit of inconsistency in the MacOS X experience (about the only thing that really annoys me)
Reply
Phil said 12:33PM on 1-03-2008
It also would be very handy if the Home, End, Page Up, and Page Down keys were labelled with text, rather than some esoteric icons on my C2D iMac wireless keyboard.
Reply
Ron said 1:19PM on 1-03-2008
I agree with Mr. Massey. i'm a programmer and i use keyboard shortcuts like these ALL the time... but I found that on the Mac, they're not consistent from app to app (even without using MS Office).
This has been very frustrating for me and it's actually one of my biggest gripes with OS X in comparison to Windows. =T
Reply
windex said 3:01PM on 1-03-2008
I'm samsies on this being a downgrade from the window's text selection. Likely one of my top issues with converting to OS X (#1 being the loss of mspaint!).
I was unaware of the word/paragraph selection with the option key, that could become useful if I remember to use it. Thanks for the hot tip.
Aaron Davies said 1:24PM on 1-03-2008
My favorite is the two completely different models of selection extension. Do the following: select two lines with the mouse. Hit shift-down twice on the keyboard, then shift-up. In some apps, you will now have three lines selected (2+2-1); in others, five (2+2+1). IIRC, the "Classic" model, presumably going straight back to MacWrite (and certainly back to Word 4.0, my first experience with text editing), is the former; I tend to think of the latter as the "BBEdit" model, as that's where I think I first encountered the damn thing.
Reply
PA said 3:14PM on 1-03-2008
Aaron, I thought the behaviour, where pressing up having pressed down does not undo the previous action but does something else instead, was considered a bug.
It seems that Leopard finally gets this righ (2+2-1 that is) but Finder still continues to make no sense. When you are in a list or a column view and press the down arrow, say, twice, you have three items selected. When you then press up arrow you don't end up having only the top two items selected but actually select the one above.
Hence, if you accidentally select one item too much, you have no way of undoing your mistake (except from grabbing a mouse and clicking the extra item when holding a command key).
BTW, it always drives me nuts how pressing the down arrow does not take you to the end of the row in Windows text boxed but does nothing instead.
Aaron Davies said 11:07PM on 1-03-2008
PA, I certainly consider it a bug. :) BTW, either BareBones wised up or I'm misremembering, as BBEdit doesn't appear to use that model now.
Gruber has a typically in-depth post on the subject here: http://daringfireball.net/2006/08/highly_selective.
PA said 6:24AM on 1-04-2008
Thanks, it was a great read. I wonder how I have missed it.
So it seems that I was wrong when remembering that text selection used to work similarly to lists before Leopard. Text has always been OK but lists are the problem.
Jordan said 5:11PM on 1-03-2008
It may be also note worthy that:
apple + shift + delete: Deletes the text from the cursor to the beginning of that line.
option + shift + delete: Deletes the entire word to the left of the cursor.
Reply
Andrew said 11:57AM on 1-10-2008
How do you delete text to the right of the cursor? (like what the "delete" button does on a windows keyboard)
Reply
John.B said 2:59AM on 3-17-2008
I'm sure Andrew got his answer two months ago, but for anyone else who happens across this 101 article...
How do you delete text to the right of the cursor? (like what the "delete" button does on a windows keyboard)
If you have a wireless aluminum keyboard or a MacBook, you can delete one character to the right by holding down the "fn" key while you hit the "delete" key.
If you have the wired aluminum keyboard, there is a dedicated "delete [x>" key (just to the left of the "end" key above the arrow keys) that does the same thing.