vi Editor: Commands: Delete Text The letter d is the delete operator in vi. Because it is an operator, it has no effect by itself. It requires a motion command to tell it the scope of the deletion. As a special case, dd deletes the entire current line.

So, what can we do with this delete operator? Basically, d followed by any command that would move the cursor deletes text up to and including where the cursor would have gone for that motion. For example:

Deletions are saved in a queue of 10 buffers, numbered 1 through 10. The most recent deletion is always in 1. You can get back your most recent deletion with p, and other deletions with "np where " is itself, and n is the number of the buffer. Therefore, to reverse the order of 3 lines, you could use this sequence of four commands:
     ddddp"2p