Using Regex in Vim to clean up Twitter thread pastes

Easier probably to use one of the ‘unroll’ apps that you can at-mention and then copy-paste from that, especially since twitter’s pathetic website only really shows/lets you copy a dozen or so tweets at a time, even when in a thread not on the timeline.

But if doing it manually, something like:

:%s/Alexander\ McCoy\n@AlexanderMcCoy4\n.\n4h/\r/g

does it for a specific person, time, etc. I’ll update this post as i improve this with actual regular expressions. The only thing that’s using a special regular expression character is the period single-character wildcard, which matches the middot between the twitter handle and the time.

\d instead of a number before the hour should help a little, and probably safe enough to not match on parts of tweets with the time and @ included, especially if i use the actual middot character.

Untested bad revision:

:%s/[A-Za-z ]+\n@[A-Za-z_]+\n·\n\dh/\r/g