Vim 9 · Searching and replacing
Delete all lines matching a pattern
Delete every line that contains the pattern.
:g/pattern/d
Caution: Check the pattern with a search first. Undo with u if it removes too much.
Vim 9 · Searching and replacing
Delete every line that contains the pattern.
:g/pattern/d
Caution: Check the pattern with a search first. Undo with u if it removes too much.
Was this page helpful?