From 571f9269550d8c1e7375f450a192003046f02107 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 14 Feb 2018 23:23:37 -0500 Subject: [PATCH] Add pattern matching commands to vim.md --- help/vim.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/help/vim.md b/help/vim.md index ee146b72..6ee0b49e 100644 --- a/help/vim.md +++ b/help/vim.md @@ -247,6 +247,9 @@ Macros are used for complex commands that can't be repeated with `.`. They help - To repeat a macro on only a specific set of lines, use: `:,norm! @` - From line 5 to the end of the file: `:5,$norm! @` - Repeat a macro on all lines matching a pattern: `:g/pattern/norm! @` +- Delete all lines that contain a pattern: `:g/pattern/d` + - To catch multiple patterns, separate them with `\|`. Example: `:g/pattern_one\|pattern_two/d` + - To delete all lines that do NOT contain a pattern, use: `:v/pattern/d` ## Marking Things