1- *builtin.txt* For Vim version 9.2. Last change: 2026 Mar 17
1+ *builtin.txt* For Vim version 9.2. Last change: 2026 Mar 25
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -699,7 +699,8 @@ synconcealed({lnum}, {col}) List info about concealing
699699synstack({lnum} , {col} ) List stack of syntax IDs at {lnum} and
700700 {col}
701701system({expr} [, {input} ]) String output of shell command/filter {expr}
702- systemlist({expr} [, {input} ]) List output of shell command/filter {expr}
702+ systemlist({expr} [, {input} ])
703+ List output of shell command/filter {expr}
703704tabpagebuflist([{arg} ]) List list of buffer numbers in tab page
704705tabpagenr([{arg} ]) Number number of current or last tab page
705706tabpagewinnr({tabarg} [, {arg} ])
@@ -6432,6 +6433,8 @@ js_decode({string}) *js_decode()*
64326433 - Strings can be in single quotes.
64336434 - Empty items in an array (between two commas) are allowed and
64346435 result in v:none items.
6436+ - Capitalization is ignored in keywords: true, false, null,
6437+ NaN, Infinity and -Infinity.
64356438
64366439 Can also be used as a | method | : >
64376440 ReadObject()->js_decode()
@@ -6470,23 +6473,20 @@ json_decode({string}) *json_decode()* *E491*
64706473 same as {"1":2} .
64716474 - More floating point numbers are recognized, e.g. "1." for
64726475 "1.0", or "001.2" for "1.2". Special floating point values
6473- "Infinity", "-Infinity" and "NaN" (capitalization ignored)
6474- are accepted.
6476+ "Infinity", "-Infinity" and "NaN" are accepted.
64756477 - Leading zeroes in integer numbers are ignored, e.g. "012"
64766478 for "12" or "-012" for "-12".
6477- - Capitalization is ignored in literal names null, true or
6478- false, e.g. "NULL" for "null", "True" for "true".
64796479 - Control characters U+0000 through U+001F which are not
64806480 escaped in strings are accepted, e.g. " " (tab
64816481 character in string) for "\t".
64826482 - An empty JSON expression or made of only spaces is accepted
64836483 and results in v:none.
64846484 - Backslash in an invalid 2-character sequence escape is
64856485 ignored, e.g. "\a" is decoded as "a".
6486- - A correct surrogate pair in JSON strings should normally be
6487- a 12 character sequence such as "\uD834\uDD1E", but
6488- json_decode() silently accepts truncated surrogate pairs
6489- such as "\uD834" or "\uD834\u"
6486+ - A surrogate pair in JSON strings is a 12 character sequence
6487+ such as "\uD834\uDD1E". A lone surrogate or an invalid
6488+ surrogate pair (e.g. "\uD800" or "\uD800\uD800") results
6489+ in an error.
64906490 *E938*
64916491 A duplicate key in an object, valid in rfc7159, is not
64926492 accepted by json_decode() as the result must be a valid Vim
@@ -11695,6 +11695,30 @@ system({expr} [, {input}]) *system()* *E677*
1169511695 Get the output of the shell command {expr} as a | String | . See
1169611696 | systemlist() | to get the output as a | List | .
1169711697
11698+ {expr} can be a | String | or a | List | .
11699+ When {expr} is a | String | , the command is executed through the
11700+ shell (see below for how the command is constructed).
11701+
11702+ *E1575*
11703+ When {expr} is a | List | , the first item is the executable and
11704+ the remaining items are passed as arguments directly. The
11705+ command is executed without using a shell, similar to
11706+ | job_start() | . Since no shell is involved, shell features
11707+ such as redirection, piping, globbing, environment variable
11708+ expansion and backtick expansion will not work. Characters
11709+ like ">" are passed as literal arguments to the command, not
11710+ interpreted as redirection. Use this form when arguments may
11711+ contain special characters that should not be interpreted by
11712+ the shell. Example: >
11713+ :let out = system(['grep', '-r', 'pattern', '.'])
11714+ < With the String form ">" would be shell redirection, but
11715+ with a List it is passed as a literal argument: >
11716+ :let out = system(['echo', 'hello', '>', 'world'])
11717+ < This outputs "hello > world", not redirect to a file.
11718+
11719+ To use the shell explicitly with a List: >
11720+ :let out = system(['/bin/sh', '-c', 'echo $HOME'])
11721+ <
1169811722 When {input} is given and is a | String | this string is written
1169911723 to a file and passed as stdin to the command. The string is
1170011724 written as-is, you need to take care of using the correct line
@@ -11720,11 +11744,11 @@ system({expr} [, {input}]) *system()* *E677*
1172011744 being echoed on the screen. >
1172111745 :silent let f = system('ls *.vim')
1172211746<
11723- Note: Use | shellescape() | or | ::S | with | expand() | or
11724- | fnamemodify() | to escape special characters in a command
11725- argument. Newlines in {expr} may cause the command to fail.
11726- The characters in 'shellquote' and 'shellxquote' may also
11727- cause trouble.
11747+ Note: When {expr} is a String, use | shellescape() | or | ::S |
11748+ with | expand() | or | fnamemodify() | to escape special
11749+ characters in a command argument. Newlines in {expr} may
11750+ cause the command to fail. The characters in 'shellquote'
11751+ and 'shellxquote' may also cause trouble.
1172811752 This is not to be used for interactive commands.
1172911753
1173011754 The result is a String. Example: >
@@ -11737,7 +11761,8 @@ system({expr} [, {input}]) *system()* *E677*
1173711761 To avoid the string being truncated at a NUL, all NUL
1173811762 characters are replaced with SOH (0x01).
1173911763
11740- The command executed is constructed using several options:
11764+ When {expr} is a String, the command executed is constructed
11765+ using several options:
1174111766 'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote'
1174211767 ({tmp} is an automatically generated file name).
1174311768 For Unix, braces are put around {expr} to allow for
@@ -11764,6 +11789,9 @@ system({expr} [, {input}]) *system()* *E677*
1176411789systemlist({expr} [, {input} ]) *systemlist()*
1176511790 Same as | system() | , but returns a | List | with lines (parts of
1176611791 output separated by NL) with NULs transformed into NLs.
11792+ Like | system() | , {expr} can be a | String | (executed through
11793+ the shell) or a | List | (executed directly without a shell).
11794+ See | system() | for details.
1176711795 Output is the same as | readfile() | will output with {binary}
1176811796 argument set to "b", except that there is no extra empty item
1176911797 when the result ends in a NL.
0 commit comments