How do you use a macro to remove consecutive duplicate lines?
Answer
qayy:+1\nif getline('.')==@0|d|else|+1|endif\nq
Explanation
Record a macro that yanks the current line and compares it with the next. If identical, delete the duplicate. Advanced use of Vim expressions.