Commands: mention :vglobal

This commit is contained in:
Marco Hinz 2017-01-06 00:45:23 +01:00
parent fc91963d94
commit 3590a3495f
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -82,7 +82,7 @@ My [vimrc][vimrc].
## [Commands](#commands-1) ## [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. - [:normal and :execute](#normal-and-execute) - The scripting dream team.
- [:redir](#redir) - Redirect messages. - [: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 :<command name>` to learn more Useful commands that are good to know. Use `:h :<command name>` to learn more
about them, e.g. `:h :global`. about them, e.g. `:h :global`.
## :global ## :global and :vglobal
Execute a command on all matching lines. E.g. `:global /regexp/ print` will use Execute a command on all matching lines. E.g. `:global /regexp/ print` will use
`:print` on all lines that contain "regexp". `: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 :,/^$/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 ## :normal and :execute
These commands are commonly used in Vim scripts. These commands are commonly used in Vim scripts.