Consider the following text file:
--> Foobar
Barfoo
I would like to transform this text to
Foobar
--> Barfoo
There are several ways to do this. One possibility is to use REPLACE
mode to overwrite the first line with three spaces, and then use REPLACE
mode.
However, I'm wondering if there's a native way to select the array text (maybe in visual block mode) and pull it down to an adjacent line.
After learning about visual re-selection (gv
), I figured out how to do this in a way that generalizes to any kind of visual selection (the first step is different depending on what one wants to select and move).
0vf>
y
gv
r[Space]
j
[Shift]R
.[Control]R"
I recorded this as a macro and it works reasonably well.