Linux 如何删除特定换行符

Linux 如何删除特定换行符,linux,vim,Linux,Vim,下面是我的VIM文件的副本。它有7000多行长,所以我试图找到清理它的命令。基本上,我需要换行符只以P:或F:开头,但要这样做,我必须将所有错误换行的行移回正确的行:下面,以“无人能…”开头的行需要移回 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

下面是我的VIM文件的副本。它有7000多行长,所以我试图找到清理它的命令。基本上,我需要换行符只以P:或F:开头,但要这样做,我必须将所有错误换行的行移回正确的行:下面,以“无人能…”开头的行需要移回

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 $

使用
:v
查找所有不以
p
F
开头的行,并将它们与前一行合并:

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

%s:^[PF]\:\r&:有效吗?我不明白它是如何工作的,但我爱你,因为它是这样工作的:P这样的命令叫什么,这样我就可以得到一些关于这个主题的学习材料?VIM命令?从一开始学习
VIM
。从shell中运行
vimtutor