Basic Xcode 3 keyboard shortcuts

While learning Objective-C it is natural to also learn about Xcode, Apple’s free IDE. Coming from a firmly entrenched background of using Visual Studio, and all of the standard keyboard shortcuts it provides, it is rather frustrating to suddenly be clueless how to do the most basic things from the keyboard.

This post is a cheat sheet for some of the most common shortcuts on which I depend. There are far more comprehensive shortcut listings available on the Web, but I prefer a shorter listing of only things I currently care about.  As I find other indispensable nuggets of awesomeness in Xcode 3 I’ll update this listing.

Getting Help
Option-DoubleClick = search for the clicked symbol/name in the documentation
⌘-Option-? = open developer documentation files. Note: the ? key is actually Shift-/

Text Navigation
Ctrl-F = move cursor Forward one character (same as RightArrow key)
Ctrl-B = move cursor Backward one character (same as LeftArrow key)
Ctrl-Option-F = move cursor Forward one word (same as Option-RightArrow key)
Ctrl-Option-B = move cursor Backward one word (same as Option-LeftArrow key)
Ctrl-P = move cursor to Previous line (same as UpArrow key)
Ctrl-N = move cursor to Next line (same as DownArrow key)
Ctrl-A = move cursor to the stArt of the line (same as ⌘-LeftArrow)
Ctrl-E = move cursor to the End of the line (same as ⌘-RightArrow)
Ctrl-L = aLign the document so that the cursor is centered in the editor
⌘-D = Drop a bookmark at the current line
⌘-L = goto a Line number or character
⌘-Option-UpArrow = open the counterpart file (open .h file from .m file, or vice versa)

Text Editing
Ctrl-D = Delete the character to the right of the cursor
Ctrl-K = delete/Kill the line
⌘-] = indent the selected code one level
⌘-[ = unindent the selected code one level
Tab = apply the suggested completion value // like IntelliSense in VS
Ctrl-/ = move to the next completion placeholder
Esc = show the unfiltered completion menu // like Ctrl-Spacebar in VS
Ctrl-. (period) = scroll down the completion list (same as DownArrow key)
Ctrl-Shift-. (period) = scroll up the completion list (same as UpArrow key)

Debugging
⌘-Y = run with debugger attached, to figure out WHY the app has a bug
⌘-O = step Over
⌘-I = step Into
⌘-T = step ouT
⌘-P = Proceed with execution (i.e. continue running the app)

About Josh Smith

Josh Smith is a musician at heart, and a software developer by obsession. He lives in Arizona, plays classical music on the piano, jazz on the guitar, and enjoys brutally long rides on his bicycle. He has a wonderful wife and thinks that, in general, life is good.
This entry was posted in XCode 3. Bookmark the permalink.

7 Responses to Basic Xcode 3 keyboard shortcuts

  1. Neil Weber says:

    Some of the bindings are the same as Emacs.

    • Josh Smith says:

      I had read that somewhere, Neil. It turns out that Macs uses a lot of Unix-based goodies under the hood. Terminal (the command line) uses Bash, for instance.

  2. mos says:

    I found learning the Xcode keys too annoying. Luckily, I discovered that Xcode has a good keyboard remapper, and that OS X has an awesome keyboard remapper built in.

    • Josh Smith says:

      I also that they are difficult to get used to, after having spent so long working with the default keyboard shortcuts in VS. I’m trying to learn them because if I end up working with a team doing Obj-C development some day, I don’t want to be unable to write and run code on any machine but my own.

  3. NC says:

    Whats your dev environment ? I would like to know what you’re using for source control, SVN? If so what client?

    • Josh Smith says:

      My dev environment is pretty minimal at this point. I’m just starting off with Apple programming, so I’m currently on a loaner MacBook Pro from work until my Mac arrives in the mail. No soure control yet, since I only have little “test” projects so far.

  4. Visu says:

    Hey Josh,

    Nice to see you in the Mac world. All the best.

    Visu.

Comments are closed.