What Xcode keyboard shortcuts do you use regularly?
XcodeKeyboard ShortcutsXcode Problem Overview
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.
Xcode Solutions
Solution 1 - Xcode
I find the shortcuts to open & close various areas of the screen must useful.
Solution 2 - Xcode
Cmd + Shift + o opens the "Open quickly" dialog, where you can quickly find and open files that contain the text you enter.
Solution 3 - Xcode
Updated for newer versions:
Control + Command + ↑
Switches between corresponding .h / .m files or as Apple's own documentation, it means Jump to Counterpart
Solution 4 - Xcode
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.
Solution 5 - Xcode
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.
Solution 6 - Xcode
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.
Solution 7 - Xcode
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.
Solution 8 - Xcode
Ctrl + Command + ↑ - Switch between header and implementation files.
Solution 9 - Xcode
Command + J (Move focus to any section of the editor)
Solution 10 - Xcode
Control + Command + j
Highlight a keyword (method name) and jump to its definition. Also works for variables, #defines, etc.
Solution 11 - Xcode
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.
Solution 12 - Xcode
Command + Shift + Y for the console.
Solution 13 - Xcode
I find a cheat sheet next to the computer is the best way to pick up useful shortcuts. Cocoa Samurai has a good one.
Solution 14 - Xcode
Key Bindings to XCode Actions
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.
Solution 15 - Xcode
Just the basic emacs navigation. Feels so right.
Solution 16 - Xcode
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: