← Back Home

Vim: Reverse Lines

  1. til

:g/^/m0

It will reverse all lines on file. If you want to reverse on specific lines, add line number before the command.

:5,10g/^/m4

It will reverse line 5 to 10 and put the result after line 4.

comments powered by Disqus