有一個文本如何在Vim中刪除所有匹配模式和行的行?
Title of the text
This line contains a word that is matched by the pattern and it should be deleted.
Next line is supposed to be deleted as well.
Loren ipsum dolorem...
This line contains a word that is matched by the pattern and it should be deleted.
And this one should be deleted
The end of the article
如何刪除每對匹配的第一行線,例如中'這一行包含一個單詞...'和之後的一行。結果將是:
Title of the text
Loren ipsum dolorem...
The end of the article
另一個變體,如果你想刪除它之前的匹配行和行,然後使用這個:':g/pattern/-1n,.d' – Dmytro 2017-01-20 02:37:23