The method for deleting even rows is as follows:
: G/^/+1 D
The above is used: The Gbobal command, the gbobal command format is as follows:
: [Range]global/{pattern}/{command}
The global command is actually performed in two steps: First scan all rows in the specified range of [range], mark the line that matches {pattern}, and then execute the {command} command with the marked row, if the marked row is deleted in a command operation that matches a row before, Move or merge, its markup automatically disappears, and the {command} command is not executed on that line. The {command} can be an ex command, or multiple ex commands separated by |, so that we can perform a number of different operations on rows that are marked or that are addressed from the tag line.
The above command deletes even rows, matches all rows first, and then deletes each other (where +1 is positioned on the next line of the current row). Why is it interlaced? Because the second row is deleted when you execute the +1 d command on the first row, and the second row is marked but no longer exists, the command to delete the third row is not executed.
The command to delete several rows is as follows:
: g/^/d|m
The function of M is to remove the mark of even lines and prevent even rows from being deleted.
You can also delete several rows of even rows, or use the normal command, respectively (the first command is a few lines):
:%norm jkdd
:%norm JDD