Mac Text Navigation Keyboard Shortcuts

On of my developers recently switched to a Mac, and was wondering how to move the insertion point to the beginning and end of a line on the Mac (OSX doesn’t support home/end keys in the same way as Windows). I thought with so many developers switching to Apple hardware, it would be useful to post a quick run-down on the awesome text shortcuts in OSX. This is hardly an exhaustive list, but these are the ones I use regularly (brackets describe behaviour for multiple presses):


  • opt-left: beginning of current word (beginning of previous word)

  • opt-right: end of current word (end of next word)

  • opt-up: beginning of paragraph (beginning of previous paragraph)

  • opt-down: end of paragraph (end of next paragraph)

  • opt-delete: delete to beginning of word (delete previous word)

  • opt-forward del: delete to end of word (delete next word)

  • cmd-left: move to beginning of line

  • cmd-right: move to end of line

  • cmd-up: beginning of document

  • cmd-down: end of document

  • shift with any of the above: select text. For example, cmd-opt-right selects to end of the word.

  • you can also chain this, so cmd-shift-right, then shift-left would select to the end of the line, then deselect the last character (ex. leaving the semi-colon).

These last two are not really shortcuts, but the lack of support for them drives me nuts in Windows:

  • down arrow on last line of text (including 1 line text fields): end of line

  • up arrow on first line of text (including 1 line text fields): beginning of line

It’s worth noting that text shortcuts are much more consistent in OS X than on Windows. Virtually every app supports the same shortcuts, including things like cmd-a for select all. I hate it in XP when I want to select all the text in a dialog so I hit ctrl-a and nothing happens. You only ever encounter this in bad ports or the odd java app on Mac.

You might also want to check out Textpander, which is a great little utility that will automagically replace text shortcuts in any textfield with expanded text (or even images, etc) as you type. For example, I have it set to replace “uv\” with “public var “. Unfortunately it was purchased by another company who is overcharging for it imho ($29.99). If you hunt around a bit though, you can find a copy of the original free version.

Here’s a list of other OSX shortcuts that could be useful.

Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

30 Comments

  1. great post, also point out holding shift higlites which i use all the time….. i.e.

    shift + alt + left … highlites the word to the left

    shift + alt + right .. highlites the word to the right

    (my two favourite shortcuts of all time… mainly because they work on text in every app)

    and up and down highlites the paragraph from cursor position etc..

  2. Hey, cool, your tips came in at the right time!

  3. Mike – already in the list: “shift with any of the above”. Reorganized a bit to make it stand out. Definitely one of my favourites too – super useful for jumping through method params and editing them. 🙂

  4. wow thats freaky, just yesterday i was thinking to myself if there was a way to jump to the next word instead of to the end of the line.

    since you mentioned Textpander, i jsut wanted to bring up that textmate has support for that kind of stuff too (they call it Tab Trigger). I type ‘getset’-tab and get getter/setter methods with the private var in place, and tab stops quickly fill out the necessary parts of the methods. its pretty awesome.

  5. I’m right there with you, wishing I had as much keyboard-shortcut access on Windows as I do on Mac….. Some noteworthy OS X apps for which these shortcuts do not work:

    Dreamweaver: Cmd-* and Opt-* behave the same (skip whole chunks at a time); must switch to HOME and END (Cmd-Home and Cmd-End to jump to beginning/end of the entire document).

    Illustrator & Photoshop: Opt-right and Opt-left do not jump from word to word but adjust the kerning instead. Switch to Cmd-* and Home/End as with Dreamweaver.

    Flash (input text for compiled SWFs): Cmd-* and Opt-* do not work, only Home and End are available (perhaps I am nitpicking here).

  6. When you discover these shortcuts, you definitely gain time, especially while coding or debugging. 🙂

  7. Sweet. I knew stumbled on a couple of them my self. It’s good to know all of them them now.!

  8. Weird – I’m the other way round… Haven’t “switched” and whenever I need to use someone’s Mac for something I find myself getting really frustrated that “Home” and “End” and other text navigation shortcuts I’m used to don’t work like I’m expecting… Hopefully this will help to ease the pain!

  9. Very useful – I was especially missing the goto start/end of line ones, coming from Windows.

  10. This is hilarious (and useful).

    I just bought a MacBook and love every feature. But the home/end difference (and Control + Arrow Key) have been driving me nuts! Oh well. A small inconvenience to overcome…

    Thanks for the guide!

  11. hello,

    command + up to get to the beginning of the document doesn’t work for me in Word for Mac. Does anybody know how to go to the beginning/end of a document in Word on a Mac.

    thanks,

    brett

  12. Hi, Brett

    I was wondering the same thing myself: how to get to the beginning and end of a document in Word for Mac…

    My search brought me to this page. Then, when I was about to give up, I found it.

    Try Function-Command-Home and Function-Command-End.

    Woiks for me!

    jwc

  13. How do I go to the end or the beginning of a document in Word for Mac on a Mac Book laptop? (There are no end or home keys.)

  14. In MacBook, try

    Fn + Cmd + right arrow (end) or left arrow (home)

  15. Super! It works. Thanks.

  16. kibbled_bits July 5, 2008 at 3:45pm

    As a longtime DOS and later Windows user I was dumbfounded at first as well. But I do have to say now adjusting to these hot-keys, they are more intuitive and make more sense for text editing..

    Thanks for the guide.

  17. On iPages 08, for HOME button, you can try Cntrl + command + left arrow key, whereas for the END button, you have Cntrl + command + right arrow key.

    If you are using TextEdit or other basic word processor, then you can use Control + Right button for END and Control + Left button for HOME.

  18. Does anyone know if you can change these shortcuts so that the command key acts in place of the option key? I really hate having to switch off.

  19. Thanks, jhopkin, for the End and Home commands for the MacBook laptop. The instructions that say to hit “End” or “Home” when they don’t exist were dumbfounding me. 🙂

  20. Thanks for the useful article.

    I just switched to Mac from years of Windows. All of the shortcuts you mention are available on Windows and pretty consistently applied, IMO. The home/end keys move the cursor to the begin/end of a line, like PgUp/PgDown do for pages, and the shift key combo does selection with them. Home/End on Macs go to the beginning/end of the document — how often does one do that in comparison to begin/end of line? Not a great design choice.

    I just got a beautiful new 17″ MacBook Pro, but the thing I really miss is the simplicity of text selection on Windows. On the Mac, I’ve got to press 3 keys instead of 2, and sadly things like GMail don’t support command-shift-right/left selection.

  21. Great info. I used Home/End all the time in Windows and still wish it was available in Mac.

    In Windows, the Home takes you to the top (latest e-mail) of Outlook; and End all the way to the bottom. In Mac, I can’t get to the top or bottom of Entourage that easily. At least, I have not found the key combo yet.

    The other thing really irks me in Mac world is when I am using ‘shift’ to select multiple things in Finder. I start with Shift + DOWN several times then whoops that’s too many, so I press UP to deselect the last item, but instead it expands the selection UPward from where I started, so now I have 2 items I don’t want. This is very annoying, especially when selecting several hundred items and you can’t see the bottom of your list until you have passed it, and need to deselect the last few. This does not happen for selecting text say in Word, or a webpage.

  22. Thanks so much for information — I was hoping there was a way and what a great implementation!

  23. Life saver! Thanks so much!

  24. i can’t get to the end of a document. none of the suggested

    key commands work. i can get to the beginning with fn command up arrow, but the opposite does not get me to the end. any ideas

  25. Disillusioned Mac User September 2, 2010 at 11:46pm

    More consistent!!!!???? You have to be kidding! Every second app uses a different combination or supported shortcut keys, or supports some and not others, even within the same app you will at times go to enter a comment in a dialog and find that Home/End is no longer available.

    This applies across the board, not just cursor movements, and also between Apple’s own applications. Here’s a good talk about Mac inconsistencies in general (including in their so called great design): http://daringfireball.net/2003/02/inconsistencies

    If it was consistently applied across the operating system, ok then it might be better perhaps, but as it is using Mac OS X (Snow Leopard) feels like I’m at “Amateur Hour” 🙁

    – One disillusioned Mac user

  26. I’m having withdraw symptoms after leaving my dead PC laptop at the repair store this morning and using my Macbook Pro all day today. I miss my: 10 key pad, dedicated hw keys (Home, End, Pg Up, Pg Dn, etc).

    The Mac appears to require simply more keystrokes to the get the same job done. Ugh.

  27. Thanks

  28. cmd v – paste

  29. August 2012
    Thank you very much to jhopkin’s April 2008 suggestion!!!!!! I have spent the last two plus hours trying to finally figure out how to go to the beginning or end of a document and have tried out many many suggestions. This is the only one to work for my Macbook Pro OSX 2009. I am so relieved to finally find the answer. What a waste of time that all was and so frustrating. Anyhow this is the command repeated for anyone still trying to find it out.
    Fn + Command + Right Arrow (end of document)
    Fn + Command + Left Arrow (top of document)

  30. Having just switched from microsoft to mac Word, I’m still having trouble figuring out how to forward delete an entire word to the right of the cursor. Some of the tips don’t work on my 2012 MacBook Pro with the newest OS. One tip was “option forward delete” but what does that mean? What does “forward” correspond to? Function-delete does delete the next character, but it would be great to delete the entire word forwards of the cursor. Thanks in advance for help, as I spend hours on Word and this single omission is driving me crazy.

Comments are closed.