I want to take a visual selection and flip it so that the first line of the selection is on the bottom. From:
The
wheels
go
round.
For those more comfortable with Visual Mode:
1. Identify the line number above the selection you want flipped using :set nu
.
2. Use Shift-V
to highlight selection you want flipped (visual mode).
3. :g/^/m
.
Note that in visual mode it will automatically show up as
:'<,'>g/^/m
when you type in the command from 3.
This command works by moving the selection one line at a time into the line number that you give it. When the second item gets pushed into the line number given, it pushes the first down to line number + 1. Then the third pushes the first and second down and so on until the entire list has been pushed into the single line number resulting in a reverse ordered list.