Vim Delete Alternate Lines
A co-worker was trying to delete alternate lines of a file in vim. He searched online and found this:
:g/^/+d
It apparently says, “Globally, on every line, delete the next line”.
If you’re looking for something that is more verbose, here’s the equivalent:
:let i=1 | while i <= line('$') | if (i % 2) | exe i . "delete" | endif | let i += 1 | endwhile