From 3590a3495fae24c1c28206cb0b4e5605e86db4c5 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Fri, 6 Jan 2017 00:45:23 +0100 Subject: [PATCH] Commands: mention :vglobal --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 393b7fb..56c4aad 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ My [vimrc][vimrc]. ## [Commands](#commands-1) -- [:global](#global) - Execute a command on all matching lines. +- [:global and :vglobal](#global-and-vglobal) - Execute a command on all matching lines. - [:normal and :execute](#normal-and-execute) - The scripting dream team. - [:redir](#redir) - Redirect messages. @@ -2090,7 +2090,7 @@ autocmd ColorScheme lucius highlight StatusLine ctermbg=darkgray cterm=NONE guib Useful commands that are good to know. Use `:h :` to learn more about them, e.g. `:h :global`. -## :global +## :global and :vglobal Execute a command on all matching lines. E.g. `:global /regexp/ print` will use `:print` on all lines that contain "regexp". @@ -2108,6 +2108,9 @@ next blank line (matched by the regular expression `^$`) that contain "foo": :,/^$/g/foo/d ``` +For executing commands on all lines that do _not_ match a given pattern, use +`:global!` or its alias `:vglobal` (think _inVerse_) instead. + ## :normal and :execute These commands are commonly used in Vim scripts.