33
11
Suppose I've got multiple cursors along several lines, like this:
foo|
barr|
foobar|
baz|
How can I automatically push the whitespace at the end of each line out to a flat edge, like this?:
foo |
barr |
foobar |
baz |
(In these examples, |
is supposed to be my cursor.)
When you just Tab or Space from the initial arrangement, you get this:
foo |
barr |
foobar |
baz |
That's useful, but not what I'm looking for. I'm looking for some kind of keyboard shortcut that will let me indent from a ragged multi-cursor insert out to a straight column.
how do I do this in Atom text editor? – Saravanabalagi Ramachandran – 2019-03-15T17:05:19.167
Does simply inserting a tab or two work? – Darth Android – 2012-09-14T19:42:47.670
No, but I might be failing to understand. I've edited to clarify my question. – GladstoneKeep – 2012-09-14T20:53:03.183
Your edit describes what Space does, and to some extent Tab will to if your lines vary by a large amount, but if they're all pretty close then after two tabs your cursors should all be on a tabstop. You might have to do a bit of adjusting to get them all on the same tabstop, but it'll be less than trying to adjust with spaces. – Darth Android – 2012-09-14T21:21:17.217
It's weird. Pressing
Tab
at the end of each line indents the ragged multi-cursor insert out to a straight column, but it's not possible to achieve the same effect using regex. I searched for trailing spaces:\s*$
and replaced them with the tab character:\t
- but\t
does not achieve the same effect as pressingTab
manually. – amiregelz – 2012-09-14T22:38:07.3201
FYI, I posted this as a feature request on Sublime Text 2 request board.
– GladstoneKeep – 2012-09-17T14:15:38.720