ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Column Select

by ehuss ST2/ST3

Alternate behavior for Sublime keyboard column selection.

Details

  • 2015.01.27.00.25.40
  • github.​com
  • github.​com
  • 5 months ago
  • 1 hour ago
  • 3 years ago

Installs

  • Total 3K
  • Win 2K
  • OS X 681
  • Linux 558
Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21
Windows 0 1 2 6 3 5 3 3 2 5 3 3 3 0 0 0 2 2 3 2 1 0 1 0 1 0 0 1 2 1 3 5 1 1 3 2 1 5 1 1 1 0 2 1 0 1
OS X 0 2 1 2 2 0 0 1 0 2 3 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 2 0 0 0 2 1 2 0 0 0 0 2 1 0 0 0 1 0 0 1
Linux 0 1 1 0 0 0 0 0 0 1 1 1 1 1 0 2 0 0 0 2 0 0 0 0 0 1 0 1 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0 0 1 1

Readme

Source
raw.​githubusercontent.​com

Sublime Column Select

This plugin provides an alternate behavior for Sublime keyboard column selection. I often found it challenging to select columns with lines that were shorter than the rest.

Downloading

The best way to download and install Sublime Column Select is to use the Package Control plugin. If you do not already have it installed, it's really the best way to manage your packages.

For users new to the package manager: * Go to https://packagecontrol.io/installation and install Package Control. * Restart Sublime Text.

Install Sublime Column Select: * Bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows). * Select “Package Control: Install Package” and wait while Package Control fetches the latest package list. * Select Column Select when the list appears.

Package Control will handle automatically updating your packages.

Alternatively, you can fetch from github:

git clone git://github.com/ehuss/Sublime-Column-Select.git

and place it in your packages directory.

Configuring

No need to configure anything. By default it uses the default keystroke for column selection, plus a few extras. These keystrokes will select the same column in the next or previous line, page, or until the beginning/end of the document.

Windows:

  • Ctrl-Alt-Up / Ctrl-Alt-Down: Up/down one line.
  • Ctrl-Alt-PageUp / Ctrl-Alt-PageDown: Up/down one page.
  • Ctrl-Alt-Home: Up until the beginning of the document.
  • Ctrl-Alt-End: Down until the end of the document.

  • Ctrl-Alt-Right-click: Select current column in all lines from the cursor to the row where you clicked.

Linux:

  • Alt-Shift-Up / Ctrl-Alt-Down: Up/down one line.
  • Alt-Shift-PageUp / Ctrl-Alt-PageDown: Up/down one page.
  • Alt-Shift-Home: Up until the beginning of the document.
  • Alt-Shift-End: Down until the end of the document.

  • Ctrl-Alt-Right-click: Select current column in all lines from the cursor to the row where you clicked.

OS X:

  • Ctrl-Shift-Up / Ctrl-Alt-Down: Up/down one line.
  • Ctrl-Shift-PageUp / Ctrl-Alt-PageDown: Up/down one page.
  • Ctrl-Shift-Home: Up until the beginning of the document.
  • Ctrl-Shift-End: Down until the end of the document.

  • Ctrl-Shift-Right-click: Select current column in all lines from the cursor to the row where you clicked.

If you want to use a different keystroke, go to “Preferences” then “Key Bindings - User”, and add an entry like this:

{ "keys": ["ctrl+alt+up"], "command": "column_select", "args": {"by": "lines", "forward": false}},
{ "keys": ["ctrl+alt+down"], "command": "column_select", "args": {"by": "lines", "forward": true}},
{ "keys": ["ctrl+alt+pageup"], "command": "column_select", "args": {"by": "pages", "forward": false}},
{ "keys": ["ctrl+alt+pagedown"], "command": "column_select", "args": {"by": "pages", "forward": true}},
{ "keys": ["ctrl+alt+home"], "command": "column_select", "args": {"by": "all", "forward": false}},
{ "keys": ["ctrl+alt+end"], "command": "column_select", "args": {"by": "all", "forward": true}},

Do not include the trailing comma if it is the last entry.

Using

You should be able to place the character on any position on the line, and then use the keystrokes to add additional carets (cursors) to the next/previous lines. It will skip over lines that are too short.

It will behave differently if the cursor is at the end of the line. In this case, it will select the end of every line.

Contact

If you find a bug, or have suggestions, head over to the github page: https://github.com/ehuss/Sublime-Column-Select