66

Is there a way I can use the middle click or maybe (Ctrl+Alt+Up) to a particular column across all lines in a long file? Currently, I am middle-clicking and then dragging this to the end of the screen and waiting for it to select all lines.

Specifically, for long files, how would I select one particular column across the entire file?

denfromufa
  • 5,610
  • 13
  • 81
  • 138
Legend
  • 113,822
  • 119
  • 272
  • 400
  • Not sure about sublimetext, but several editors lets you do this by doing a click on the beginning of the column and pressing alt+shift to mark your column. – NoChance Apr 09 '12 at 21:45
  • @EmmadKareem: Thank you. I just tried it but unfortunately, it does not seem to work in Sublime. – Legend Apr 09 '12 at 21:50
  • Take a look at this: http://www.sublimetext.com/docs/2/column_selection.html – NoChance Apr 09 '12 at 21:59
  • @EmmadKareem: Unless I am missing something, that page only explains how to use Ctrl but what I want is to select all lines in a file. Adding a block using Ctrl will still require me to hold onto the mouse selection. – Legend Apr 09 '12 at 22:16
  • Thanks for your feedback, sorry I could not help. – NoChance Apr 09 '12 at 22:33
  • @EmmadKareem: Oh.. Thank you for your time :) Hopefully someone can give me a hint. – Legend Apr 09 '12 at 23:13

3 Answers3

167

This should do it:

  1. Ctrl+A - select all.
  2. Ctrl+Shift+L - split selection into lines.
  3. Then move all cursors with left/right, select with Shift+left/right. Move all cursors to start of line with Home.
Ry-
  • 218,210
  • 55
  • 464
  • 476
fraxel
  • 34,470
  • 11
  • 98
  • 102
  • 6
    This should do it: Cmd+A - select all. Cmd+Shift+L - split selection into lines. Then move all cursors with left/right, select with Shift+left/right. Move all cursurs to start of line with Home. – Justin Noel Jun 27 '12 at 21:56
  • @Justin: Thank you. I guess this is for a Mac system. – Legend Jun 27 '12 at 22:31
  • On Mac, if you don't have a "Home" button available you can hit `Ctrl-A` to move all the cursors to the beginning of the line. – owensmartin Feb 01 '19 at 22:43
4

In Mac OS X, replace Ctrl with CMD key. So it'll be,

CMD+A - select all. CMD+Shift+L - split selection into lines. Then move all cursors with left/right, select with Shift+left/right. Move all cursors to start of line with Home.

user3806770
  • 385
  • 1
  • 6
  • 14
4

OS X

You can click the following and drag to create a selection of one or more columns of characters:

  • Left mouse button + option
  • Middle mouse button

To add to an existing selection, hold command while doing the above.

To subtract from an existing selection, hold command + shift while doing the above

Windows

You can click the following and drag to create a selection of one or more columns of characters:

  • Right Mouse Button + shift
  • Middle Mouse Button

To add to an existing selection, hold Ctrl while doing the above.

To subtract from an existing selection, hold Alt while doing the above.

Robin James Kerrison
  • 1,727
  • 1
  • 15
  • 26
hkiame
  • 167
  • 3
  • 7