Sublime Forum

Rectangle column selection using the keyboard

#1

Assume tab equal 8 spaces.
Let me have this text

one.two-1.2
thtree--3
four----4
five----5

(I denote spaces as dot . and tabs as dashes ----
so it actually this text

one two\t1 2\n
thtree\t3\n
four\t4\n
five\t5\n

)
And I want to get next text (using the keyboard)

1.2-----one.two-	
3-------thtree--
4-------four----
five----5

I put cursor at left up corner, press ctrl+alt+Down ctrl+alt+Down, press shift+right 5 times, and I have selected next text:

one.t
thtre
four----	

How to select rectangle block of text (using the keyboard)?

one.two-	
thtree--
four----

I try to select one.two- and after that press ctrl+alt+Down, shift+ctrl+alt+Down, but it do anything but what I need.

I can do this in sublime text using shift+mouse-right-button.
I can do this in notepad++ using only keyboard.
But how to do this in sublime text using keyboard - ?

0 Likes

#2

Animation

0 Likes

#3

Ok. Your use Shift+Home.
What if I have such text:

five----one two-1 2
four----thtree--3
one two-four----4
thtree--five----5

How to select second column?

offtop: how do you create such animation?

0 Likes

#4

ST does not take visual widths of tabs vs. spaces/chars into account, when selecting text with multible cursors being present. Each of them selects text independently.

To create a Notepad++ like column select behavior a plugin would be needed, which looks for tabs and adjusts selections or cursor positions of all lines according to tabs’ visual widths.

An alternative would be to convert all tabs into spaces, but I guess that’s not what you want.

offtop: how do you create such animation?

On Windows: ScreenToGif & QiPress

0 Likes

#5

But it is possible with mouse, and documentation says it “can be used to select a rectangular area” “Using the Mouse” and “Using the Keyboard”.

Is it mistake in documentation?

0 Likes

#6

Mouse navigation uses a special/dedicated drag_select command, which takes columns. I am however not aware of such option for move or move_to commands, which are used for keyboard navigation.

Those only support (chars | pages | lines | characters | words | word_ends | subwords | subword_ends | stops) at the moment.

Maybe worth an enhancement request.

0 Likes