Skip to content

Instantly share code, notes, and snippets.

@bsa7
Last active August 29, 2015 14:19
Show Gist options
  • Save bsa7/283fbd8c6e33bee7b324 to your computer and use it in GitHub Desktop.
Save bsa7/283fbd8c6e33bee7b324 to your computer and use it in GitHub Desktop.
sublime multiline editing

Mouse

Windows/Linux

Building blocks:

  • Positive/negative:
    • Add to selection: Ctrl
    • Subtract from selection: Alt (only works with block selection in v3; presumably bug)
  • Selection type:
    • Linear selection: Left Click
    • Block selection: Middle Click or Shift + Right Click

Combine as you see fit. For example:

  • Add to selection: Ctrl + Left Click (and optionally drag)
  • Subtract from selection: Alt + Left Click (and drag--this combination doesn't work in Sublime Text 3, but supposedly it works in 2)
  • 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/Linux

  • 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
  • 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): I'm too lazy to open my MacBook to figure it out, and it's not documented, but it most certainly exists.
  • Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: ⇧⌘L

Note

On Yosemite, ⌃⇧⇡ and ⌃⇧⇣ are system keyboard shortcuts by default. If you want them to work in Sublime Text, you will need to change them:

  1. Open System Preferences.
  2. Click the Keyboard category.
  3. Select Mission Control in the left listbox.
  4. Change the keyboard shortcuts for Mission Control and Application windows (or disable them). I use ⌃⌥⇡ and ⌃⌥⇣.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment