Skip to content

Instantly share code, notes, and snippets.

@rlander
Created February 29, 2012 14:17
Show Gist options
  • Save rlander/1941157 to your computer and use it in GitHub Desktop.
Save rlander/1941157 to your computer and use it in GitHub Desktop.
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Cmd+C copy current line (if no selection)
Cmd+X cut current line (if no selection)
Ctrl+⇧+K delete line
Cmd+↩ insert line after
Cmd+⇧+↩ insert line before
Cmd+⇧+↑ move line (or selection) up
Cmd+L select line (repeat to select next lines)
Cmd+D select word (repeat select others occurrences in context for multiple editing)
Ctrl+M jump to closing bracket for current code, repeat to jump to opening bracket
Ctrl+⇧+M select all contents of the current brackets (curly brackets, square brackets, parentheses)
Cmd+KK delete from cursor to end of line
Cmd+K+Del delete from cursor to start of line
Cmd+] indent current line(s)
Cmd+[ un-indent current line(s)
Cmd+⇧+D duplicate line(s)
Cmd+J join line below to the end of the current line
Cmd+ / comment/un-comment current line
Cmd+Y redo, or repeat last keyboard shortcut command
Cmd+⇧+V paste and indent correctly
Ctrl+Space select next auto-complete suggestion
Cmd+U soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command)

Navigation/Goto Anywhere

Cmd+P quick-open files by name in your project (doesn’t seem to need an actual project set up, it just searches in the directories around the currently-opened file
Cmd+R goto symbol (functions and classes) in the file. Same as Cmd+P, then type @
Ctrl+; goto word in current file. Same as Ctrl+P, then type #
Ctrl+G goto line in current file. Same as Cmd+P, then type :

General

Cmd+⇧+P command prompt
Cmd+KB toggle side bar

Find/Replace

Cmd+F find
Cmd+Alt+F replace
Cmd+⇧+F find in files

Tabs

Cmd+⇧+t open last closed tab (just like in your browser)
Cmd+Alt+⇆ cycle through last tabs (repeat to go back further in history)

Split window

Cmd+Alt+2 split into two columns
Cmd+Alt+1 revert to single column
Cmd+Alt+5 grid (4 groups)
Ctrl+[1,2,3,4] jump to “group” (pane)
Ctrl+⇧+[1,2,3,4] move file to specified group

Text manipulation

Cmd+KU upper case
Cmd+KL lower case

Misc

Cmd+ click multiple cursors
Ctrl + Cmd + Up/Down move current line up/down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment