Skip to content

Commit

Permalink
runtime(doc): clarify {special} argument for shellescape()
Browse files Browse the repository at this point in the history
closes: #14770

Signed-off-by: Enno <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
  • Loading branch information
Konfekt authored and chrisbra committed May 15, 2024
1 parent 8314de8 commit 5faeb60
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions runtime/doc/builtin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 May 07
*builtin.txt* For Vim version 9.1. Last change: 2024 May 15


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -8991,11 +8991,12 @@ shellescape({string} [, {special}]) *shellescape()*
Otherwise it will enclose {string} in single quotes and
replace all "'" with "'\''".

When the {special} argument is present and it's a non-zero
Number or a non-empty String (|non-zero-arg|), then special
items such as "!", "%", "#" and "<cword>" will be preceded by
a backslash. This backslash will be removed again by the |:!|
command.
The {special} argument adds additional escaping of keywords
used in Vim commands. When it is not omitted and a non-zero
number or a non-empty String (|non-zero-arg|), then special
items such as "!", "%", "#" and "<cword>" (as listed in
|expand()|) will be preceded by a backslash.
This backslash will be removed again by the |:!| command.

The "!" character will be escaped (again with a |non-zero-arg|
{special}) when 'shell' contains "csh" in the tail. That is
Expand Down

0 comments on commit 5faeb60

Please sign in to comment.