Skip to content

Commit f18987c

Browse files
committed
runtime(doc): clarify the use of filters and external commands
related: #16044 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent e798446 commit f18987c

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

runtime/doc/change.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim version 9.1. Last change: 2024 Oct 07
1+
*change.txt* For Vim version 9.1. Last change: 2024 Nov 12
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -586,6 +586,8 @@ comment (starting with '"') after the `:!` command.
586586
program {filter} (for {Visual} see |Visual-mode|).
587587

588588
:{range}![!]{filter} [!][arg] *:range!*
589+
For executing external commands see |:!|
590+
589591
Filter {range} lines through the external program
590592
{filter}. Vim replaces the optional bangs with the
591593
latest given command and appends the optional [arg].

runtime/doc/usr_10.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_10.txt* For Vim version 9.1. Last change: 2019 Nov 22
1+
*usr_10.txt* For Vim version 9.1. Last change: 2024 Nov 12
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -736,6 +736,11 @@ The "!!" command filters the current line through a filter. In Unix the "date"
736736
command prints the current time and date. "!!date<Enter>" replaces the current
737737
line with the output of "date". This is useful to add a timestamp to a file.
738738

739+
Note: There is a difference between "!cmd" (e.g. using it without any file
740+
range) and "{range}!cmd". While the former will simply execute the external
741+
command and Vim will show the output, the latter will filter {range}lines
742+
through the filter and replace that range by the result of the filter command.
743+
See |:!| and |:range!| for details.
739744

740745
WHEN IT DOESN'T WORK
741746

runtime/doc/various.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*various.txt* For Vim version 9.1. Last change: 2024 Oct 05
1+
*various.txt* For Vim version 9.1. Last change: 2024 Nov 12
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -254,7 +254,8 @@ g8 Print the hex values of the bytes used in the
254254

255255
*:!cmd* *:!*
256256
:!{cmd} Execute {cmd} with the shell. See also the 'shell'
257-
and 'shelltype' option.
257+
and 'shelltype' option. For the filter command, see
258+
|:range!|.
258259
*E34*
259260
Any '!' in {cmd} is replaced with the previous
260261
external command (see also 'cpoptions'). But not when

0 commit comments

Comments
 (0)