Skip to content

Instantly share code, notes, and snippets.

@emohamed
Last active November 9, 2016 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emohamed/d452fca0d1da36e5eef64e6bf73ea95e to your computer and use it in GitHub Desktop.
Save emohamed/d452fca0d1da36e5eef64e6bf73ea95e to your computer and use it in GitHub Desktop.
Sublime Text 2 - Useful Shortcuts

Sublime Text – Shortcuts

Navigation

Combine those with shift for selecting text simultaneously

Ctrl+→ / Ctrl+← Go to the end / start of the word
End / Home Go to the end / beginning of the line
Ctrl+End / Ctrl+Home Go to the end / beginning of the file
Alt+→ / Alt+← Go to the end / beginning of the sub-word

Selection

Ctrl+Alt+↑ select vertically up
Ctrl+Alt+↓ selection vertically down
Ctrl+L select line (repeat to select next lines)
Ctrl+D select word (repeat select others occurrences in context for multiple editing)
Ctrl+⇧+M select all contents of the current brackets (curly brackets, square brackets, parentheses)
Alt+F3 select all occurrences of the word below the cursor

Editing

Ctrl+del delete to the end of the word
Ctrl+backspace delete to the beginning of the word
Ctrl+C without selection copy current line
Ctrl+X without selection cut current line
Ctrl+⇧+K or ⇧+Del delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
Ctrl+M jump to closing bracket for current code, repeat to jump to opening bracket
Ctrl+KK delete from cursor to end of line
Ctrl+K+⌫ delete from cursor to start of line
Ctrl+] indent current line(s)
Ctrl+[ un-indent current line(s)
Ctrl+⇧+D duplicate line(s)
Ctrl+J join line below to the end of the current line
Ctrl+ / comment/un-comment current line
Ctrl+⇧+/ block comment current selection
Ctrl+Y redo, or repeat last keyboard shortcut command
Ctrl+⇧+V paste and indent correctly
Ctrl+Space select next auto-complete suggestion
Ctrl+U soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command)

Go To Anywhere

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

General

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

Find/Replace

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

Tabs

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

Bookmarks

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

Misc

F6 Toggle spell checking

Text manipulation

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