Search code examples
keyboard-shortcutssublimetext3

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?


Solution

  • Alright, here's the best solution I've found that meets all the requirements:

    1. Download the Sublime-Text-Advanced-CSV Sublime plugin and install.
    2. Specify a delimiter for your column (default is ","), via the "CSV: Set Delimiter" command.
    3. Hit "ctrl + , s" (or select from Command Palette) and your column will be selected.

    No need for mouse interaction whatsoever.