Skip to content

Commit b69806b

Browse files
committed
Update builtin.{txt,jax}
1 parent 5a17f1b commit b69806b

2 files changed

Lines changed: 88 additions & 29 deletions

File tree

doc/builtin.jax

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim バージョン 9.2. Last change: 2026 Mar 17
1+
*builtin.txt* For Vim バージョン 9.2. Last change: 2026 Mar 25
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -6333,6 +6333,8 @@ js_decode({string}) *js_decode()*
63336333
- 文字列はシングルクォートでくくることができる。
63346334
- 配列内の(2つのコンマで区切られた)空アイテムが許可され結果と
63356335
して v:none のアイテムとなる。
6336+
- キーワード true、false、null、NaN、Infinity、-Infinity では
6337+
大文字と小文字は区別されない。
63366338

63376339
|method| としても使用できる: >
63386340
ReadObject()->js_decode()
@@ -6370,12 +6372,9 @@ json_decode({string}) *json_decode()* *E491*
63706372
{"1":2} と同じである。
63716373
- 多くの浮動小数点数を認識する。例えば "1." は "1.0" となり、
63726374
"001.2" は "1.2" となる。特別な浮動小数点の値、"Infinity",
6373-
"-Infinity" および "NaN" (大文字は無視される) は受け付けられ
6374-
る。
6375+
"-Infinity" および "NaN" は受け付けられる。
63756376
- 整数値の先頭に付く 0 は無視される、例えば "012" は "12" とな
63766377
り、"-012" は "-12" となる。
6377-
- null、true および false の大文字は無視される、例えば "NULL"
6378-
は "null" となり、"True" は "true" となる。
63796378
- 文字列中でエスケープされない U+0000 から U+001F の制御文字は
63806379
受け付けられる、例えば " " (文字列中のタブ文字) は "\t"
63816380
となる。
@@ -6387,6 +6386,10 @@ json_decode({string}) *json_decode()* *E491*
63876386
のような連続した 12 文字でなければならないが、json_decode()
63886387
は、"\uD834" や "\uD834\u" のような途切れたサロゲートペアを
63896388
黙って受け付ける。
6389+
- JSON 文字列におけるサロゲートペアは、"\uD834\uDD1E" のような
6390+
12文字のシーケンスである。単独のサロゲート、または無効なサロ
6391+
ゲートペア (例: "\uD800" または "\uD800\uD800") はエラーにな
6392+
る。
63906393
*E938*
63916394
結果は Vim の有効な型でなければならないため、rfc7159 では有効
63926395
なオブジェクト内の重複キーは、json_decode() では受け付けられな
@@ -11418,6 +11421,29 @@ system({expr} [, {input}]) *system()* *E677*
1141811421
シェルコマンド {expr} の実行結果を文字列 |String| として得る。
1141911422
リスト |List| として受け取るには |systemlist()| を参照。
1142011423

11424+
{expr} は |String|または |List| である。
11425+
{expr} が |String| の場合、コマンドはシェルを介して実行される
11426+
(コマンドの構築方法については下記を参照)。
11427+
11428+
*E1575*
11429+
{expr} が |List| の場合、最初の項目が実行可能ファイルであり、
11430+
残りの項目は引数として直接渡される。コマンドは |job_start()|
11431+
と同様に、シェルを使用せずに実行される。シェルが関与しないた
11432+
め、リダイレクト、パイプ、グロビング、環境変数展開、バック
11433+
クォート展開などのシェル機能は動作しない。">" のような文字は、
11434+
リダイレクトとして解釈されず、コマンドへのリテラル引数として渡
11435+
される。引数にシェルで解釈されるべきではない特殊文字が含まれる
11436+
可能性がある場合は、この形式を使用する。例: >
11437+
:let out = system(['grep', '-r', 'pattern', '.'])
11438+
< 文字列形式の場合、">" はシェルリダイレクトになるが、リストの場
11439+
合はリテラル引数として渡される: >
11440+
:let out = system(['echo', 'hello', '>', 'world'])
11441+
< これは "hello > world" を出力し、ファイルへのリダイレクトは行
11442+
わない。
11443+
11444+
リストを明示的にシェルで使用するには: >
11445+
:let out = system(['/bin/sh', '-c', 'echo $HOME'])
11446+
<
1142111447
{input} に文字列 |String| が指定された場合、その文字列はファイ
1142211448
ルに書き出され、コマンドの標準入力として渡される。この文字列は
1142311449
そのまま (as-is) 書き出されるので、正しい改行文字を使うよう自
@@ -11443,10 +11469,11 @@ system({expr} [, {input}]) *system()* *E677*
1144311469
ある。 >
1144411470
:silent let f = system('ls *.vim')
1144511471
<
11446-
Note: コマンドの引数をエスケープするには、 |shellescape()|、
11447-
|expand()| の |::S|、または |fnamemodify()| を使用する。{expr}
11448-
内に改行文字があるとコマンドは失敗するだろう。'shellquote' や
11449-
'shellxquote' 内にある文字も問題を起こすかもしれない。
11472+
Note: {expr} が文字列の場合、コマンドの引数をエスケープするに
11473+
は、 |shellescape()|、|expand()| の |::S|、または
11474+
|fnamemodify()| を使用する。{expr}内に改行文字があるとコマンド
11475+
は失敗するだろう。'shellquote' や'shellxquote' 内にある文字も
11476+
問題を起こすかもしれない。
1145011477
対話的なコマンドを使用することはできない。
1145111478

1145211479
戻り値は文字列。例: >
@@ -11459,7 +11486,8 @@ system({expr} [, {input}]) *system()* *E677*
1145911486
文字列が NUL 文字で切れるのを防ぐため、すべての NUL 文字は SOH
1146011487
(0x01) に置換される。
1146111488

11462-
実行されるコマンドはいくつかのオプションを適用して構成される:
11489+
{expr} は文字列の場合、実行されるコマンドはいくつかのオプショ
11490+
ンを適用して構成される:
1146311491
'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote'
1146411492
({tmp}は自動的に生成されるファイル名)
1146511493
Unixではコマンドの連結ができるように{expr}の両側に波括弧が置か
@@ -11486,9 +11514,12 @@ system({expr} [, {input}]) *system()* *E677*
1148611514

1148711515
systemlist({expr} [, {input}]) *systemlist()*
1148811516
|system()| と同じだが行のリスト (|List|) を返す。行は NL 文字
11489-
で区切られ、NUL 文字は NL 文字に変換される。出力は
11490-
|readfile()| の {binary} 引数に "b" を指定したのと同様である。
11491-
ただし、結果が NL で終わる場合、余分な空の項目はない。
11517+
で区切られ、NUL 文字は NL 文字に変換される。
11518+
|system()| と同様に、{expr} は |String| (シェルを介して実行さ
11519+
れる) または |List| (シェルを介さずに直接実行される) のいずれ
11520+
かになる。詳細は |system()| を参照。
11521+
出力は |readfile()| の {binary} 引数に "b" を指定したのと同様
11522+
である。ただし、結果が NL で終わる場合、余分な空の項目はない。
1149211523
Note MS-Windows では末尾の CR 文字がつくかもしれないことに注
1149311524
意。
1149411525

en/builtin.txt

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
699699
synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and
700700
{col}
701701
system({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}
703704
tabpagebuflist([{arg}]) List list of buffer numbers in tab page
704705
tabpagenr([{arg}]) Number number of current or last tab page
705706
tabpagewinnr({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*
1176411789
systemlist({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

Comments
 (0)