You can quickly reverse all lines in a file using the following ex command.
:g/^/m0
This is particularly useful for files that are in chronological order such as logs or email mbox files. Thanks to Skyler for submitting the tip.
Subscribe to:
Post Comments (Atom)
2 comments:
Or you could filter the file through "tac" (the opposite of "cat") by :%!tac.
This assumes you have the GNU coreutils on your path. Windows users will need Cygwin or something comparable.
Great tip. Now if only I could remember it, rather than visiting this site once a month.
Post a Comment