changeset 36543:6871d5f2fc77 draft

runtime(doc): clarify the use of filters and external commands Commit: https://github.com/vim/vim/commit/f18987caa5095e9ff154f924d952047c67c9fb64 Author: Christian Brabandt <cb@256bit.org> Date: Tue Nov 12 21:38:22 2024 +0100 runtime(doc): clarify the use of filters and external commands related: https://github.com/vim/vim/issues/16044 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Nov 2024 21:45:02 +0100
parents 2ce51a2833df
children a27d4c0319ac
files runtime/doc/change.txt runtime/doc/usr_10.txt runtime/doc/various.txt
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt*    For Vim version 9.1.  Last change: 2024 Oct 07
+*change.txt*    For Vim version 9.1.  Last change: 2024 Nov 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -586,6 +586,8 @@ comment (starting with '"') after the `:
 			program {filter} (for {Visual} see |Visual-mode|).
 
 :{range}![!]{filter} [!][arg]				*:range!*
+			For executing external commands see |:!|
+
 			Filter {range} lines through the external program
 			{filter}.  Vim replaces the optional bangs with the
 			latest given command and appends the optional [arg].
--- a/runtime/doc/usr_10.txt
+++ b/runtime/doc/usr_10.txt
@@ -1,4 +1,4 @@
-*usr_10.txt*	For Vim version 9.1.  Last change: 2019 Nov 22
+*usr_10.txt*	For Vim version 9.1.  Last change: 2024 Nov 12
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -736,6 +736,11 @@ The "!!" command filters the current lin
 command prints the current time and date.  "!!date<Enter>" replaces the current
 line with the output of "date".  This is useful to add a timestamp to a file.
 
+Note: There is a difference between "!cmd" (e.g. using it without any file
+range) and "{range}!cmd".  While the former will simply execute the external
+command and Vim will show the output, the latter will filter {range}lines
+through the filter and replace that range by the result of the filter command.
+See |:!| and |:range!| for details.
 
 WHEN IT DOESN'T WORK
 
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt*   For Vim version 9.1.  Last change: 2024 Oct 05
+*various.txt*   For Vim version 9.1.  Last change: 2024 Nov 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -254,7 +254,8 @@ 8g8			Find an illegal UTF-8 byte sequenc
 
 							*:!cmd* *:!*
 :!{cmd}			Execute {cmd} with the shell.  See also the 'shell'
-			and 'shelltype' option.
+			and 'shelltype' option.  For the filter command, see
+			|:range!|.
 							*E34*
 			Any '!' in {cmd} is replaced with the previous
 			external command (see also 'cpoptions').  But not when