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.
{ "keys": ["ctrl+alt+s"], "command": "reveal_in_side_bar" }, |
{ |
It’s usually just easier to skip the mouse altogether—or it would be if Sublime didn’t mess up multiselect when word wrapping. Here’s the official documentation on using the keyboard and mouse for multiple selection. Since it’s a bit spread out, I’ll summarize it:
Where shortcuts are different in Sublime Text 3, I’ve made a note. For v3, I always test using the latest dev build; if you’re using the beta build, your experience may be different.
If you lose your selection when switching tabs or windows (particularly on Linux), try using Ctrl + U to restore it.
Mouse
Windows/Linux
Building blocks:
- Positive/negative:
- Add to selection: Ctrl
- Subtract from selection: Alt In early builds of v3, this didn’t work for linear selection.
- Selection type:
- Linear selection: Left Click
- Block selection: Middle Click or Shift + Right Click On Linux, middle click pastes instead by default.
Combine as you see fit. For example:
- Add to selection: Ctrl + Left Click (and optionally drag)
- Subtract from selection: Alt + Left Click This didn’t work in early builds of v3.
- Add block selection: Ctrl + Shift + Right Click (and drag)
- Subtract block selection: Alt + Shift + Right Click (and drag)
Mac OS X
Building blocks:
- Positive/negative:
- Add to selection: ⌘
- Subtract from selection: ⇧⌘ (only works with block selection in v3; presumably bug)
- Selection type:
- Linear selection: Left Click
- Block selection: Middle Click or ⌥ + Left Click
Combine as you see fit. For example:
- Add to selection: ⌘ + Left Click (and optionally drag)
- Subtract from selection: ⇧⌘ + Left Click (and drag—this combination doesn’t work in Sublime Text 3, but supposedly it works in 2)
- Add block selection: ⌥⌘ + Left Click (and drag)
- Subtract block selection: ⌥⇧⌘ + Left Click (and drag)
Keyboard
Windows
- Return to single selection mode: Esc
- Extend selection upward/downward at all carets: Ctrl + Alt + Up/Down
- Extend selection leftward/rightward at all carets: Shift + Left/Right
- Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right
- Undo the last selection motion: Ctrl + U
- Add next occurrence of selected text to selection: Ctrl + D
- Add all occurrences of the selected text to the selection: Alt + F3
- Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)
- Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L
Linux
- Return to single selection mode: Esc
- Extend selection upward/downward at all carets: Alt + Up/Down Note that you may be able to hold Ctrl as well to get the same shortcuts as Windows, but Linux tends to use Ctrl + Alt combinations for global shortcuts.
- Extend selection leftward/rightward at all carets: Shift + Left/Right
- Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right
- Undo the last selection motion: Ctrl + U
- Add next occurrence of selected text to selection: Ctrl + D
- Add all occurrences of the selected text to the selection: Alt + F3
- Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)
- Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L
Mac OS X
- Return to single selection mode: ⎋ (that’s the Mac symbol for Escape)
- Extend selection upward/downward at all carets: ⌃⇧⇡, ⌃⇧⇣ (See note)
- Extend selection leftward/rightward at all carets: ⇧⇠/⇧⇢
- Move all carets up/down/left/right and clear selection: ⇠, ⇡, ⇣, ⇢
- Undo the last selection motion: ⌘U
- Add next occurrence of selected text to selection: ⌘D
- Add all occurrences of the selected text to the selection: ⌃⌘G
- Rotate between occurrences of selected text (single selection): ⌥⌘G (reverse: ⌥⇧⌘G)
- Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: ⇧⌘L
Notes for Mac users
On Yosemite and El Capitan, ⌃⇧⇡ and ⌃⇧⇣ are system keyboard shortcuts by default. If you want them to work in Sublime Text, you will need to change them:
- Open
System Preferences
. - Select the
Shortcuts
tab. - Select
Mission Control
in the left listbox. - Change the keyboard shortcuts for
Mission Control
andApplication windows
(or disable them). I use ⌃⌥⇡ and ⌃⌥⇣. They defaults are ⌃⇡ and ⌃⇣; adding ⌃ to those shortcuts triggers the same actions, but slows the animations.
In case you’re not familiar with Mac’s keyboard symbols:
- ⎋ is the escape key
- ⌃ is the control key
- ⌥ is the option/alt key
- ⇧ is the shift key
- ⌘ is the command key
- ⇡ et al are the arrow keys, as depicted
*Convert selection to lowercase (or uppercase) in Sublime Text?
Windows/Linux
Keypress | Command |
---|---|
Ctrl + K, Ctrl + U | Transform to Uppercase |
Ctrl + K, Ctrl + L | Transform to Lowercase |
and for Mac:
Keypress | Command |
---|---|
cmd + KU | Transform to Uppercase |
cmd + KL | Transform to Lowercase |
Also note that Ctrl + Shift + p in Windows (⌘ + Shift + p in a Mac) brings up the Command Palette where you can search for these and other commands.
* Typescript plugin Shortcuts
Feature | Shortcut |
---|---|
Rename | ^T ^M |
Find references | ^T ^R |
Next reference | ^T ^N |
Prev reference | ^T ^P |
Format document | ^T ^F |
Format selection | ^T ^F |
Format line | ^; |
Format braces | ^ Shift ] |
Navigate to symbol | ^ Alt R |
Go to definition | ^T^D or F12 |
Trigger completion | ^Space |
Trigger signature help | Alt+, |
See previous signature in the tooltip | Alt + up |
See next signature in the tooltip | Alt + down |
Paste and format | ^V or ⌘V |
Quick info | ^T ^Q |
Build | (Win)^B or F7 , (OSX) ⌘B or F7 |
Error list | (via Command Palette) |