Reputation: 23
So, below is a copypasta of my VIM file. Its 7000+ lines long so I'm trying to find the commands to clean it up. Basically, I need newlines to only start with P: or F:, but to do so, I have to move any lines that were mistakenly newlined back to the correct line: Below, the line starting with "Nobody can ... " needs to be moved back...
P: Well at this stage here, I can.t really say for anything really, cause I don.t know anything. $
F: Okay. And that.s my job Rob, my job is to come in here and explain $
some stuff to you and then once you.ve a better understanding you can choose whether or not you want to explain that stuff. Alright, because that.s gonna be your choice I.m not gonna force you to say anything. I.m not gonna make you do anything you don.t want to do. $
Nobody can ever make you do that, nobody can make Robert $
Upvotes: 0
Views: 62
Reputation: 36262
Use :v
to find all lines that don't begin with either P
or F
, and join them with the previous one:
:v/^\(P\|F\)/ normal kJ
Upvotes: 2