sábado, 31 de agosto de 2013


Sublime Text 2 Keyboard Shortcuts Cheat Sheet (Win, OS X and Linux)

List of common keyboard shortcuts for Sublime Text 2 editor. Tested in Windows, OS X and Linux.

Bold: different from windows shortcut
Red: custom code
 
Found a mistake? Want to add something? Post in the comments below.
 

System and Files

WindowsOS XLinux
Open FileCtrl + OCommand + OCtrl + O
Save FileCtrl + SCommand + SCtrl + S
Close FileCtrl + WCommand + WCtrl + W
Open recently closed fileCtrl + Shift + TCommand + Shift + TCtrl + Shift + T
Toggle sidebarCtrl + K BCommand + K BCtrl + K B
Switch projectCtrl + Alt + PCommand + Ctrl + PCtrl + Alt + P
Font sizeCtrl + +/-Command + +/-Ctrl + +/-
Command palletteCtrl + Shift + PCommand + Shift + PCtrl + Shift + P
Toggle console (custom code see below)Ctrl + Alt + CCtrl + `Ctrl + Alt + C
FullscreenF11Command + Ctrl + FF11
Distraction free fullscreenShift + F11Command + Ctrl + Shift + FShift + F11
Change tabAlt + NumberCommand + NumberAlt + Number
Navigate Through TabsCtrl + PageUp/DownCommand + Alt + Left/RightCtrl + PageUp/Down
Show autocomplete suggestions (custom code see below)Ctrl + SpaceCtrl + SpaceCtrl + Space

Layout

WindowsOS XLinux
Select column layoutsAlt + Shift + (1-4)Command + Alt + (1-4)Alt + Shift + (1-4)
Select 4 grid layoutAlt + Shift + 5Command + Alt + 5Alt + Shift + 5
Select two or three row layoutsAlt + Shift + (8,9)Command + Alt + Shift + (2,3)Alt + Shift + (8,9)
Move to panelCtrl + NumberCtrl + NumberCtrl + Number
Move file to panelCtrl + Shift + NumberCtrl + Shift + NumberCtrl + Shift + Number

Finding Things

WindowsOS XLinux
FindCtrl + FCommand + FCtrl + F
Find in filesCtrl + Shift + FCommand + Shift + FCtrl + Shift + F
Find and replaceCtrl + HCommand + Alt + FCtrl + H
Incremental searchCtrl + ICommand + ICtrl + I
Navigate through the search panelTabTabTab
Close searchEscapeEscapeEscape
Goto anythingCtrl + PCommand + PCtrl + P
Goto line numberCtrl + GCtrl + GCtrl + G
Goto symbolCtrl + RCommand + RCtrl + R
Go to word Ctrl + P + write #Command + P + write # Ctrl + P + write #
    
Find nextEnter (Or F3)EnterEnter (Or F3)
Find previousShift + Enter (Or F3)Shift + EnterShift + Enter (Or F3)
Find allAlt + F3Ctrl + Command + GAlt + F3

Selections / Moving Around

WindowsOS XLinux
Jump words / charactersCtrl + Left/RightCtrl + Left/RightCtrl + Left/Right
Moving around and selectingCtrl + Shift + Left/RightCtrl + Shift + Left/RightCtrl + Shift + Left/Right
Add next occurence to selectionCtrl + DCommand + DCtrl + D
Add scope to selectionCtrl + Shift + SpaceCommand +Shift + SpaceCtrl + Shift + Space
Add all occurences to selectionAlt + F3Ctrl + Command + G
 
Alt + F3
Select contents inside parenthesisCtrl + Shift + MCtrl + Shift + MCtrl + Shift + M
Expand selection to indentationCtrl + Shift + JCommand + Shift + JCtrl + Shift + J
Expand selection to TagCtrl + Shift + ACommand + Shift + ACtrl + Shift + A
Go to closing / opening parenthesisCtrl + MCtrl + MCtrl + M
Back to single selectionEscapeEscapeEscape
Scroll to selectionCtrl + K, Ctrl + CCommand + K,Command + CCtrl + K, Ctrl + C
    
Draw selection with mouseMiddle Mouse ButtonMiddle Mouse ButtonRight Mouse Button + Shift
Add to mouse selectionCtrlCommandCtrl
Subtract from mouse selectionAltCommand + ShiftAlt

Multiple Cursors

WindowsOS XLinux
Split selection into linesCtrl + Shift + LCommand + Shift + LCtrl + Shift + L
Add new cursorCtrl + Alt + Up/DownCtrl + Shift + Up/DownAlt + Shift + Up/Down
Single cursorEscapeEscapeEscape

Editing

WindowsOS XLinux
Copy line / selectionCtrl + CCommand + CCtrl + C
Cut line / selectionCtrl + XCommand + XCtrl + X
PasteCtrl + VCommand + VCtrl + V
Paste with indentationCtrl + Shift + VCommand + Shift + VCtrl + Shift + V
Delete lineCtrl + Shift + KCtrl + Shift + KCtrl + Shift + K
Delete from cursor to end of lineCtrl + K KCommand + K KCtrl + K K
Delete from cursor to beginning of lineCtrl + K BackspaceCommand + K BackspaceCtrl + K Backspace
Duplicate line / selectionCtrl + Shift + DCommand + Shift + DCtrl + Shift + D
Select lineCtrl + LCommand + LCtrl + L
Move line up/downCtrl + Shift + Up/DownCommand Ctrl + Up/DownCtrl + Shift + Up/Down
Insert line afterCtrl + EnterCommand + EnterCtrl + Enter
Insert line beforeCtrl + Shift + EnterCommand + Shift + ReturnCtrl + Shift + Enter
Join next line end of the current lineCtrl + JCommand + JCtrl + J
Transpose (swap place of characters/words)Ctrl + TCtrl + TCtrl + T
UppercaseCtrl + K, Ctrl + UCommand + K,Command + UCtrl + K, Ctrl + U
LowercaseCtrl + K, Ctrl + LCommand + K,Command + LCtrl + K, Ctrl + L
Indent line(s) (custom code see below)Ctrl + 9Command + ]Ctrl + 9
Unindent line(s) (custom code see below)Ctrl + 8Command + [Ctrl + 8
Delete word forwardCtrl + DelCtrl + DelCtrl + Del
Delete word backwardsCtrl + BackspaceCtrl + BackspaceCtrl + Backspace
Close tagAlt + .Command + Alt + .Alt + .

Commenting

WindowsOS XLinux
Comment line (custom code see below)Ctrl + 7Command + \Ctrl + 7
Block Comment line (custom code see below)Ctrl + Shift + 7Command + Shift + \Ctrl + Shift + 7

Bookmarks

WindowsOS XLinux
Add/remove bookmarkCtrl + F2Command + F2Ctrl + F2
Goto next bookmarkF2F2F2
Goto previous bookmarkShift + F2Shift + F2Shift + F2
Select all bookmarks (custom code see below)Alt + F2Alt + F5Alt + F5
Clear bookmarksCtrl + Shift + F2Command + Shift + F2Ctrl + Shift + F2

Mark (you can set one mark)

WindowsOS XLinux
Set markCtrl + K Space
Command + K Space
(Conflicts with spotlight in OSX, customize the shortcut if needed.)
Ctrl + K Space
Set new locationCtrl + K XCommand + K XCtrl + K X
Select to markCtrl + K ACommand + K ACtrl + K A
Delete to markCtrl + K WCommand + K WCtrl + K W
Delete markCtrl + K GCommand + K GCtrl + K G

Misc

WindowsOS XLinux
Toggle SpellcheckingF6F6F6
Sort linesF9F5F9

Custom shortcuts

Toggle console
{ "keys": ["ctrl+alt+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
Autocomplete suggestions (for linux)
     { "keys": ["ctrl+space"], "command": "auto_complete" },
     { "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
          [
               { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
               { "key": "auto_complete_visible", "operator": "equal", "operand": false },
               { "key": "setting.tab_completion", "operator": "equal", "operand": true }
          ]
     }
Indent line(s)
{ "keys": ["ctrl+8"], "command": "indent" }
Undent line(s)
{ "keys": ["ctrl+9"], "command": "unindent" }
Comment line
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } }
Comment block
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
Select all bookmarks in (in OS X and Linux)
{ "keys": ["alt+f5"], "command": "select_all_bookmarks" }
Example user keymap file for Windows:
[  
    { "keys": ["ctrl+alt+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
    { "keys": ["ctrl+8"], "command": "indent" },
    { "keys": ["ctrl+9"], "command": "unindent" },
    { "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
    { "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
]