Skip to content

Instantly share code, notes, and snippets.

@markmarch
Last active December 18, 2015 13:49
Show Gist options
  • Save markmarch/5792862 to your computer and use it in GitHub Desktop.
Save markmarch/5792862 to your computer and use it in GitHub Desktop.

Sublime Text 2 – Useful Shortcuts (OS X)

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)
Cmd+⇧+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)
Cmd+M jump to closing bracket for current code, repeat to jump to opening bracket
Cmd+⇧+M select all contents of the current brackets (curly brackets, square brackets, parentheses)
Cmd+KK delete from cursor to end of line
Cmd+K+⌫ 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+⇧+/ block comment current selection
Cmd+Y redo, or repeat last keyboard shortcut command
Cmd+⇧+V paste and indent correctly
Cmd+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 @
Cmd+; goto word in current file. Same as Cmd+P, then type #
Cmd+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+H replace
Cmd+⇧+F find in files

Tabs

Cmd+⇧+t open last closed tab (just like in your browser)
Cmd+PgDn cycle down through open tabs, cycle up with Cmd+PgUp
Cmd+⇆ 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)
Cmd+[1,2,3,4] jump to “group” (pane)
Cmd+⇧+[1,2,3,4] move file to specified group

Bookmarks

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

Text manipulation

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