Editing
Sublime Text is brim-full of editing features. This topic just scratches the surface of what's possible.
# Multiple Selections
Multiple selections let you make sweeping changes to your text efficiently. Any praise about multiple selections is an understatement. This is why:
Select some text and press Ctrl D to add more instances. If you want to skip the current instance, press Ctrl K, Ctrl D.
If you go too far, press Ctrl U to deselect the current instance.
# Transforming Multiple Selections into Lines
Ctrl L expands the selections to the end of the line. Ctrl ⇧ L splits the selections into lines.You can copy multiple selected lines to a separate buffer, edit them there, select the content again as multiple lines and then paste them back into place in the first buffer.
# Column Selection
You can select a rectangular area of a file. Column selection makes use of multiple selections.
It's possible to add blocks of text to or remove them from the selection.
# Using the Mouse
Windows & Linux
Description | Shortcut |
---|---|
Select Block | ⇧ + Right Mouse Button |
Add to Selection | Ctrl ⇧ + Right Mouse Button |
Remove from Selection | Alt ⇧ + Right Mouse Button |
OS X
Description | Shortcut |
---|---|
Select Block | ⌥ + Left Mouse Button |
Add to Selection | ⌥ ⌘ + Left Mouse Button |
Remove from Selection | ⌥ ⇧ ⌘ + Left Mouse Button |
# Using the Keyboard
System | Shortcut |
---|---|
Windows | Ctrl Alt ↑ and Ctrl Alt ↓ |
Linux | Alt ⇧ ↑ and Alt ⇧ ↓ |
OS X | Ctrl ⇧ ↑ and Ctrl ⇧ ↓ |
# Other Ways of Selecting Text
The list is long; all available options can be found under Selection. To name a few:
- Select subwords (Alt ⇧ ← and Alt ⇧ →)
- Expand selection to brackets (Ctrl ⇧ M)
- Expand selection to indentation (Ctrl ⇧ J)
- Expand selection to scope (Ctrl ⇧ ␣)
# Transposing Things
Need to swap two letters or, better yet, two words? Experiment with Ctrl T.
# And much, much more...
The Edit, Selection, Find and Goto menus are good places to look for handy editing tools. You might end up using just a few of them, but the rest will still be there for when you need them.