Assorted Handy vim Commands, Part 1
To reverse the order of lines, eg 1-5
: 1,5 g/^/m0
For example,
one
two
three
four
five
becomes
five
four
three
two
one
To remove blank lines
: %g/^$/d
Delete all lines that don’t contain “string”
: %v/string/d






Nice! I love vim, I wish you would explain how the lines switching one works but ah well.
Part 2 coming?