Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gaohao/4077013 to your computer and use it in GitHub Desktop.
Save gaohao/4077013 to your computer and use it in GitHub Desktop.
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
  • super+shift+p: command prompt
  • ctrl+g: go to line
  • ctrl+`: Python console

Editing


  • super+l: select line (repeat select next lines)
  • super+d: select word (repeat select others occurrences in context for multiple editing)
  • ctrl+shift+m: select content into brackets
  • super+shift+enter: insert line before
  • super+enter: inter line after
  • ctrl+shift+k: delete line
  • super+k-k: delete from cursor to end of line
  • super+k-backspace: delete from cursor to start of line
  • super+shift+d: duplicate line(s)
  • super+j: join lines
  • super+k-u: upper case
  • super+k-l: lower case
  • super+/: comment
  • super+alt+/: block comment
  • super+y: redo or repeat
  • super+shift+z: past and ident
  • ctrl+space: autocomplete (repeat to select next suggestion)
  • ctrl+m: jump to matching brackets

XML/HTML


  • super+shift+a: select content into tag
  • super+alt+.: close tag

Find/Replace


  • super+f: find
  • super+alt+f: replace
  • super+alt+g: find next occurrence of current word
  • super+ctrl+g: select all occurrences of current word for multiple editing
  • super+shift+f: find in files

Splits/Tabs


  • super+alt+1: Single column
  • super+alt+2: Two columns
  • super+alt+5: Grid (4 groups)
  • ctrl+[1,2,3,4]: Focus group
  • ctrl+shift[1,2,3,4]: Move file to group
  • super+[1,2,3...] Select tab

Bookmarks


  • super+f2: Toggle bookmark
  • f2: next bookmark
  • shift+f2: previous bookmark
  • super+shift+f2: clear bookmarks

Marks


  • super+k-space: set mark // super+k-; for me
  • super+k-w: delete from cursor to mark
  • super+k-a: select from cursor to mark
  • super+k-g: clear mark

h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)

h2. General

| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt | | ⌃ ` | python console | | ⌘⇧N | new window (useful for new project) |

h2. Editing

| ⌘L | select line (repeat select next lines) | | ⌘D | select word (repeat select others occurrences in context for multiple editing) | | ⌃⇧M | select content into brackets | | ⌘⇧↩ | insert line before | | ⌘↩ | inter line after | | ⌃⇧K | delete line | | ⌘KK | delete from cursor to end of line | | ⌘K⌫ | delete from cursor to start of line | | ⌘⇧D | duplicate line(s) | | ⌘J | join lines | | ⌘KU | upper case | | ⌘KL | lower case | | ⌘ / | comment | | ⌘⌥ / | block comment | | ⌘Y | redo or repeat | | ⌘⇧V | past and ident | | ⌃ space | autocomplete (repeat to select next suggestion) | | ⌃M | jump to matching brackets | | ⌘U | soft undo (movement undo) | | ⌘⇧U | soft redo (movement redo) |

h2. XML/HTML

| ⌘⇧A | select content into tag | | ⌘⌥ . | close tag |

h2. Find/Replace

| ⌘F | find | | ⌘⌥F | replace | | ⌘⌥G | find next occurrence of current word | | ⌘⌃G | select all occurrences of current word for multiple editing | | ⌘⇧F | find in files |

h2. Splits/Tabs

| ⌘⌥1 | single column | | ⌘⌥2 | two columns | | ⌘⌥5 | grid (4 groups) | | ⌃[1,2,3,4] | focus group | | ⌃⇧[1,2,3,4] | move file to group | | ⌘[1,2,3...] | select tab |

h2. Bookmarks

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

h2. Marks

| ⌘K space | set mark // ⌘K; for me | | ⌘KW | delete from cursor to mark | | ⌘KA | select from cursor to mark | | ⌘KG | clear mark |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment