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.
When you make a visual selection Vim automatically makes the bookmarks '<
and '>
at the start and end of the block respectively, so you can do what you want in a couple of ways.
In normal mode: As an ex command: NB the bookmarks remain after you exit visual mode, so you do not have to stay in visual mode to use these. edit: Oops, I misread the question and thought you only wanted the last line put at the start, but you want the entire block reversed. The simplest solution if you are on a unix system: This pipes the lines through the unix 'reverse cat' program.'>dd'
:'>d | '<-1 put
:'<,'>!tac