vpatternd

例:

> cat example.txt
  TODO: complete this
  NOT this
  NOT that
  TODO: Complete that

使用 vim 打开 example.txt 并在 Ex 模式下键入:v/TODO/d。这将删除所有不包含 TODO 模式的行。

StackOverflow 文档 StackOverflow 文档