Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Column/Vertical selection with Keyboard in SublimeText 3

I'm on a Mac. I have 7 columns in Sublime Text 3, each 300 lines each. If possible, I would like to select only the 4th column using a single keyboard shortcut.

Unsuitable options

  • ctrl + shift + up/down
  • alt + mouse + drag
  • ctrl + alt + up/down. (This actually doesn't do anything, nor does it appear in my console session and nor is it a single keyboard shortcut).
  • I'd also prefer not to use VI/VIM mode just for this as it's not regular part of my workflow

What I've tried:

  • A macro: but it isn't specific enough.
  • using command and 'page down' with ctrl and 'shift`: no luck
  • SublimeText 3 Column-Select plugin: did not seem to work for me

My ideal solution would be that my cursor could be placed anywhere in a column and I would hit a shortcut (e.g. ctrl-alt-shift-a) and it would select the whole column.

Here is an example:

John Sally Benson Mariah Patrick Samantha Martin

Simon Kate Carey Delores Joshua Samuel Eliza

I want to select the column with Maria and Delores with one keystroke. I perform this action often so for various reasons (cut/paste, change case, append, add quotes, run macro etc) and thus would want something quick and repeatable.

How would I do this?

like image 525
user2544542 Avatar asked Aug 01 '14 17:08

user2544542


People also ask

How do I select vertically in Sublime Text?

You can use the shortcut Ctrl+Shift+K to split a selected block of text into two selections. Note − The difference in key combinations from the previous key combination is that columns are visible.

How do I select a column in Sublime Text?

Using the MouseDragging with the middle button / mouse wheel will do a column selection. You can use Ctrl and Alt with this too. Shift+Right mouse button is an alternative way to initial a column select. Dragging in the gutter (where the line numbers are), will select entire lines at once.

How do you select a vertical column?

How can I select a column block of text (vertical selection)? To select in a box (select vertically), use the mouse to select while pressing the ALT key, or press SHIFT + CTRL + F8 to toggle Vertical Selection Mode (dragging the mouse will automatically select vertically).

Does Sublime have a column mode?

Column selection doesn't operate via a separate mode, instead it makes use of multiple selections. You can use additive selections to select multiple blocks of text, or subtractive selections to remove a block.


1 Answers

You should see Sublime Column Selection:

Using the Mouse

Different mouse buttons are used on each platform:

OS X

  • Left Mouse Button +
  • OR: Middle Mouse Button

  • Add to selection:

  • Subtract from selection: +

Windows

  • Right Mouse Button + Shift
  • OR: Middle Mouse Button

  • Add to selection: Ctrl

  • Subtract from selection: Alt

Linux

  • Right Mouse Button + Shift

  • Add to selection: Ctrl

  • Subtract from selection: Alt

Using the Keyboard

OS X

  • Ctrl + Shift +
  • Ctrl + Shift +

Windows

  • Ctrl + Alt +
  • Ctrl + Alt +

Linux

  • Ctrl + Alt +
  • Ctrl + Alt +
like image 72
Mithril Avatar answered Sep 23 '22 19:09

Mithril