I have a rather long chat transcript that I copied out of a window, and when I pasted it into vim, it put two line breaks after every username, and then what the user typing said.  I'd like to:Search for the > characterGo to the top of the file.Start recording the macroMove to the next match.Press the delete key twice to move to move the text up to the same line as the user's nameFinish recording the macro.Run the previously recorded macro for every match in the file.How would one go about this in VIM?
How to move to the next matching string and then hit delete twice in a macro?
macro
As steve pointed out, :%s/>\n\n/> / is useful here (although the g flag he used is superfluous.)I want to mention another command that is applicable here: the join command, which is J.So for a macro you could use:ggqq/>$EnterJJq999@qExplanation:gg                  # Move to start of file  qq                # Start recording macro into register q    />$^M           # Search for the > character at the end of a line         JJ         # Join the next two lines onto the current line           q        # Stop recording macro            999@q   # Play macro back 999 times.                    # (It will stop when > is no longer found at the end of any line.)