Skip to content

Instantly share code, notes, and snippets.

@jonathanwong
Last active November 2, 2020 03:05
Show Gist options
  • Save jonathanwong/0ca7584ce828d9b6746271e6722b63ff to your computer and use it in GitHub Desktop.
Save jonathanwong/0ca7584ce828d9b6746271e6722b63ff to your computer and use it in GitHub Desktop.

Xcode Hotkeys

File Menu

  • ⌘ ⇧ N - New Project
  • ⌘ ⌃ N - New Workspace
  • ⌘ ⌥ ⇧ N - New Playground

Toolbar

  • ⌘ R - Run
  • ⌘ . - Stop
  • ⌃ 0 - Choose scheme
  • ⌘ ⌃ [ - Previous scheme
  • ⌘ ⌃ ] - Next scheme
  • ⌥ click - Edit scheme (play button or scheme/run destination)
  • ⌘ ⌥ R or ⌘ < - Edit scheme alternatives
  • ⌃ ⇧ 0 - Choose run destination
  • ⌘ ⌃ ⌥ [ - Previous run destination
  • ⌘ ⌃ ⌥ ] - Next run destination
  • ⌘ ⇧ L - Library
  • ⌘ ↩ - Standard editor
  • ⌘ ⌥ ↩ - Assistant editor
  • ⌘ ⌥ ↩ ⇧ - Version editor
  • ⌘ 0 - Hide/Show navigators
  • ⌘ ⌥ 0 - Hide/Show inspectors
  • ⌘ ⇧ Y - Hide/Show debug Area
  • ⌘ ⌥ T - Hide/Show toolbar

Source Editor

  • ⌥ drag - Column editing
  • ⌃ ⇧ click - Multi-cursor select
  • ⌘ ↩ , - Open in assistant editor
  • ⌘ J - Jump focus
  • ⌘ ⌥ / - Add documentation comments
  • ⌘ ⌃ ␣ - Emoji palette
  • ⌘ \ - Set/Unset breakpoint

Find

  • ⌘ E - Use selection for Find
  • ⌘ F - Find
  • ⌘ G - Go to next in Find
  • ⌘ ⇧ F - Find in workspace

Refactoring

  • ⌘ ⌃ E - Edit all in scope
  • ⌘ ⇧ A - Code structure menu

Tabs

  • ⌘ T - Open a new tab
  • ⌘ ⌥ ⇧ T - Rename tab
  • ⌘ { - Move left a tab
  • ⌘ } - Move right a tab

Navigation

  • ⌘ ⇧ O - Open quickly
  • ⌘ ⌃ ← - Go back
  • ⌘ ⌃ → - Go forward
  • ⌘ ⌃ J - Jump to definition
  • ⌘ ⌃ ⌥ J - Jump to definition in assistant editor
  • ⌘ ⌃ ⌥ ⇧ J - Jump to definition in navigation chooser
  • ⌘ L - Jump to line

Code folding

  • ⌘ ⌥ ← - Fold code
  • ⌘ ⌥ → - Open folded code

Emacs

  • ⌃ F - Move cursor forward
  • ⌃ B - Move cursor back
  • ⌃ P - Move cursor up
  • ⌃ N - Move cursor down
  • ⌃ E - Move cursor to end of line
  • ⌃ A - Move cursor to beginning of line
  • ⌃ K - Delete from cursor to end of line
  • ⌃ H - Backspace
  • ⌃ D - Delete

Help

  • ⌘ ⌃ ? - Show quick help
  • ⌘ ? - Help
  • ⌥ click - Show quick help (on symbol)

Formatting

  • ⌘ ] - Indent right
  • ⌘ [ - Indent left
  • ⌃ I - Fix indent
  • ⌘ + - Increase font size
  • ⌘ - - Decrease font size

Utility Area

  • ⌘ ⌥ 1-2 - Inspectors (when editing code)
  • ⌘ ⌥ 1-6 - Inspectors (when editing storyboard/xib)

Debug Area

  • ⌘ ⇧ C - Jump to console
  • ⌘ K - Clear console
  • ⌘ ⇧ D - Reveal in debug navigator

Window Management

  • ⌘ ` - Cycle through windows of the same program
  • ⌘ W - Close window
  • ⌘ ⇧ T - New window

Libary

  • ⌥ mouse drag - Leave library open when dragging

Navigators

  • ⌥ click - Show/Hide all folders/files (when clicking on chevron)
  • ⌘ 1-9 - Access navigators
  • ⌘ ⇧ J - Reveal in project navigator
  • ⌘ ⌥ J - Jump to filter in navigator

Opening Files

  • ⌥ ↩ - Open file in assistant editor
  • ⌥ ⇧ ↩ - Open file in navigation chooser
  • ⌘ ← or ⌘ → - Move to next window in navigation chooser

Jump Bar

  • ⌃ 1 - First menu (recent files, callers, etc)
  • ⌃ 4 - Show top level items
  • ⌃ 5 - Show group files
  • ⌃ 6 - Show document items

Source Control

  • ⌃ \ - Next change
  • ⌃ | - Previous change
  • ⌘ ⌥ C - Commit
  • ⌘ ⌥ X - Pull

Playground

  • ⇧ ↩ - Run from top to current line
  • ⌘ ⇧ ↩ - Run playground
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment