Lev Lvovsky wrote:
I'm sure there's a fancy word for this, but is there any way to pull
text to the right?
suppose I have the following:
COL1 INT,
COL2 INT,
COL3 INT,
I'd like to get "COL3" aligned to "COL1" and "COL2", but to do that, I
need to put the cursor behind "COL3", hit space several times, and then
align "INT" with the other "INTs". Can I put my cursor to the right of
"COL3", and pull it over to "INT" on the right?
thanks!
-lev
With 'autoindent' on, place the cursor at the end of the second line in Insert
mode, hit <Del> to join the lines, then <Enter> to break them again. The third
line will align itself with the second one regardless of how many spaces are
between the cursor and the first word (try it, you'll see). This won't align
INT though, but there are several possible ways to do that after COL3 has been
aligned. One of the fastest of these methods is to drag the mouse across all
the spaces to be deleted to the left of INT in the third line, then hit <Del>.
An alternative possibility would be to write an ad-hoc 'indentextpr' function,
then reformat the whole file with gggqG -- but I wouldn't do that unless there
were really many such "misindents" to correct.
Best regards,
Tony.