Skip to content

Instantly share code, notes, and snippets.

@mwarkentin
Created February 22, 2012 15:59
Show Gist options
  • Save mwarkentin/1885686 to your computer and use it in GitHub Desktop.
Save mwarkentin/1885686 to your computer and use it in GitHub Desktop.
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

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

Editing

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

Navigation/Goto Anywhere

⌘+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
⌘+R goto symbol (functions and classes) in the file. Same as ⌘+P, then type @
⌘+; goto word in current file. Same as ⌘+P, then type #
⌘+G goto line in current file. Same as ⌘+P, then type :

General

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

Find/Replace

⌘+F find
⌘+H replace
⌘+⇧+F find in files

Tabs

⌘+⇧+t open last closed tab (just like in your browser)
⌘+PgDn cycle down through open tabs, cycle up with ⌘+PgUp
⌘+⇆ cycle through last tabs (repeat to go back further in history)

Split window

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

Bookmarks

⌘+F2 toggle bookmark
F2 next bookmark
⇧+F2 previous bookmark
⌘+⇧+F2 clear bookmarks

Text manipulation

⌘+KU upper case
⌘+KL lower case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment