2013-10-24 78 views
0

所以,下面是我的VIM文件的copypasta。它的7000多行长,所以我试图找到命令来清理它。基本上,我需要换行符才能以P:或F:开头,但要这样做,我必须将错误地更新到正确行的任何行移动:在下面,以“Nobody can ...”开头的行需要移回......如何删除特定换行符

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 $ 
+0

确实%S:^ [PF] \ :: \ r&:work? – tristan

回答

2

使用:v发现不符合任何PF开头的行,并与前一个投身其中:

:v/^\(P\|F\)/ normal kJ 
+0

好了,我不明白它是如何工作的,但我爱你为它工作的事实:P什么会这样的命令被称为这样我就可以得到关于这个问题的一些学习材料? VIM命令? – Jeff

+0

学习'vim'从头开始。从你的shell运行'vimtutor'。 – Birei