What Xcode keyboard shortcuts do you use regularly?
I am a huge believer in using the keyboard as much as possible (its much faster that way), and I was hoping others could share some of the Xcode shortcuts they use.
What Xcode keyboard shortcuts do you use regularly?
I am a huge believer in using the keyboard as much as possible (its much faster that way), and I was hoping others could share some of the Xcode shortcuts they use.
I find the shortcuts to open & close various areas of the screen must useful.
Cmd + Shift + o opens the "Open quickly" dialog, where you can quickly find and open files that contain the text you enter.
Updated for newer versions:
Control + Command + ↑
Switches between corresponding .h / .m files or as Apple's own documentation, it means Jump to Counterpart
command + shift + j
Reveals the current file in the project navigator. Very useful if you use command + control + J to jump to a definition as Xcode won't automatically reveal the containing file in the navigator.
command /
Comment out the current line, or multiple lines if they're highlighted.
Comes in handy for quick commenting and uncommenting while experimenting with code.
Re-indent. It's in Edit > Format > Re-Indent
and there's no shortcut by default (I use Command + Shift + L). It's a godsend.
command F Search in the File
option command F Search & Replace in the File
shift command F Search in the whole project
shift option command F Search & Replace in the whole project
Notice the pattern for easy memorizing.
Ctrl + Command + ↑ - Switch between header and implementation files.
Command + J (Move focus to any section of the editor)
Control + Command + j
Highlight a keyword (method name) and jump to its definition. Also works for variables, #defines, etc.
Some of my favorite shortcuts are not keyboard shortcuts at all, but multitouch gestures. All Macbooks from early 2008 onward, and I would imagine desktops with a Magic Mouse or Magic Trackpad, support three-finger-swipe up and down to switch between the header and implementation, and three-finger-swipe left and right to navigate within the file history.
Command + Shift + Y for the console.
I find a cheat sheet next to the computer is the best way to pick up useful shortcuts. Cocoa Samurai has a good one.
Create your own keyboard shortcuts using the Text Key Bindings tab of the Key Bindings preference pane. A time-saver all its own. Just lookup your favourite actions and add/edit shortcuts!
Another thread you may find useful is here.
I cannot live without three finger vertical swipe to switch between interface and implementation file. If you miss that in xcode-4/Lion, make sure to follow the following instructions: