From a37b813c80050e5cc62b153ec3919e072039c9d0 Mon Sep 17 00:00:00 2001 From: h-east Date: Sat, 18 Oct 2025 12:39:10 +0900 Subject: [PATCH 1/5] Update builtin.{txt,jax} --- doc/builtin.jax | 645 ++++++++++++++-------------- en/builtin.txt | 1074 ++++++++++++++++++++++++----------------------- 2 files changed, 889 insertions(+), 830 deletions(-) diff --git a/doc/builtin.jax b/doc/builtin.jax index 143d480e8..812c27e9e 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Oct 01 +*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Oct 14 VIMリファレンスマニュアル by Bram Moolenaar @@ -188,7 +188,8 @@ executable({expr}) 数値 実行可能な{expr}が存在するなら1 execute({command}) 文字列 {command}を実行し、出力を得る exepath({expr}) 文字列 コマンド {expr} のフルパス exists({expr}) 数値 変数{expr}が存在したら|TRUE| -exists_compiled({expr}) 数値 変数{var}がコンパイル時に存在したら|TRUE| +exists_compiled({expr}) 数値 変数 {var} がコンパイル時に存在したら + |TRUE| exp({expr}) 浮動小数点数 {expr}の指数 expand({expr} [, {nosuf} [, {list}]]) 任意 {expr}内の特別なキーワードを展開 @@ -712,8 +713,8 @@ submatch({nr} [, {list}]) 文字列/リスト ":s" やsubstitute()における特定のマッチ substitute({expr}, {pat}, {sub}, {flags}) 文字列 {expr}の{pat}を{sub}に置換え -swapfilelist() リスト 'directory' 内で見つかったスワップファイ - ルのリスト +swapfilelist() リスト 'directory' 内で見つかったスワップファ + イルのリスト swapinfo({fname}) 辞書 スワップファイル {fname} に関する情報 swapname({buf}) 文字列 バッファ{buf}のスワップファイル名 synID({lnum}, {col}, {trans}) 数値 {line}と{col}のsyntax IDを取得 @@ -871,7 +872,7 @@ xor({expr}, {expr}) 数値 ビット排他的論理和 イルへ移動している。 戻り値の型は |Vim9-script| の型を指定する。|vim9-types| を参照。 -abs({expr}) *abs()* +abs({expr}) *abs()* {expr} の絶対値を返す。{expr} の値が浮動小数点数である場合は浮 動小数点数を返す。{expr} が|Number|に変換可能な場合は数値が戻 り値になる。それ以外の場合はエラーメッセージを表示し、-1 @@ -890,7 +891,7 @@ abs({expr}) *abs()* 戻り値の型: |Number| または |Float|。{expr} による -acos({expr}) *acos()* +acos({expr}) *acos()* {expr} の逆余弦 (アークコサイン) をラジアンで返す。 値は [0, pi] の範囲の浮動小数点数 (|Float|)。 {expr} は [-1, 1] の範囲の浮動小数点数 (|Float|) か数値 @@ -929,7 +930,7 @@ add({object}, {expr}) *add()* and({expr}, {expr}) *and()* 二つの引数のビット論理積。引数は数値に変換される。リスト、辞 書、浮動小数点数を指定するとエラーになる。 - `or()` および `xor()` も参照。 + |or()| および |xor()| も参照。 例: > :let flag = and(bits, 0x80) < |method| としても使用できる: > @@ -990,7 +991,7 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()* 戻り値の型: |Number| -argc([{winid}]) *argc()* +argc([{winid}]) *argc()* 引数リスト内の、ファイルの数を返す。|arglist|を参照。 {winid} が指定されていない場合は、カレントウィンドウの引数リス トが使われる。 @@ -1001,14 +1002,13 @@ argc([{winid}]) *argc()* 戻り値の型: |Number| - *argidx()* -argidx() 引数リスト内の現在のインデックスを返す。最初のファイルは0とな - る。argc() - 1が最後のファイルとなる。|arglist|を参照。 +argidx() *argidx()* + 引数リスト内の現在のインデックスを返す。最初のファイルは0とな + る。|argc()| - 1が最後のファイルとなる。|arglist|を参照。 戻り値の型: |Number| - *arglistid()* -arglistid([{winnr} [, {tabnr}]]) +arglistid([{winnr} [, {tabnr}]]) *arglistid()* 引数リストの ID を返す。値は引数リストを区別するための数値であ る。ゼロはグローバル引数リストを意味する。|arglist| 参照。 引数が無効な場合は -1 を返す。 @@ -1022,8 +1022,7 @@ arglistid([{winnr} [, {tabnr}]]) 戻り値の型: |Number| - *argv()* -argv([{nr} [, {winid}]]) +argv([{nr} [, {winid}]]) *argv()* 結果は引数リスト内の、{nr}番目のファイル。|arglist| を参照。 "argv(0)" は一番最初のファイルを示す。例: > :let i = 0 @@ -1317,6 +1316,7 @@ balloon_split({msg}) *balloon_split()* 戻り値の型: list または list + base64_decode({string}) *base64_decode()* {string} の base64 でエンコードされた文字列からデコードされた バイト列を含む Blob を返す。 @@ -1364,6 +1364,7 @@ bindtextdomain({package}, {path}) *bindtextdomain()* 戻り値の型: |vim9-boolean| + blob2list({blob}) *blob2list()* Blob {blob} の各バイトを数値として保持するリストを返す。例: > blob2list(0z0102.0304) returns [1, 2, 3, 4] @@ -1415,8 +1416,7 @@ blob2str({blob} [, {options}]) *blob2str()* 戻り値の型: list - *browse()* -browse({save}, {title}, {initdir}, {default}) +browse({save}, {title}, {initdir}, {default}) *browse()* ファイル選択ダイアログを起動。"has("browse")" が|TRUE|を返すと き (幾つかのGUIバージョンに限定)だけ利用可能。 入力フィールドの意味は: @@ -1481,8 +1481,8 @@ bufexists({buf}) *bufexists()* ある名前を bufexists() に与えて非零になったとしても、その名前 をコマンド |:buffer| に与える際には |expand()| を使って展開し なければならない場合がある。特に MS-Windows の "c:\DOCUME~1" - という 8.3 名形式において。 - 代替ファイル名が存在するかを判定するには "bufexists(0)" を使う。 + のような 8.3 形式の名前に関して。 + 代替ファイル名の存在を調べるには "bufexists(0)" を使用する。 |method| としても使用できる: > let exists = 'somename'->bufexists() @@ -1587,7 +1587,7 @@ bufnr([{buf} [, {create}]]) *bufnr()* となる。Note そのバッファ番号より小さいバッファ番号を持つ(ハズ の)バッファが、必ずしも全て存在するとは限らない。なぜなら ":bwipeout" がバッファを消すことができるからだ。バッファが存在 - するかテストするにはbufexists()を使う。 + するかテストするには |bufexists()| を使う。 |method| としても使用できる: > echo bufref->bufnr() @@ -1684,15 +1684,15 @@ byteidx({expr}, {nr} [, {utf16}]) *byteidx()* byteidxcomp({expr}, {nr} [, {utf16}]) *byteidxcomp()* - byteidx() と同じだが、合成文字は個別にカウントされる。例: > + |byteidx()| と同じだが、合成文字は個別にカウントされる。例: > let s = 'e' .. nr2char(0x301) echo byteidx(s, 1) echo byteidxcomp(s, 1) echo byteidxcomp(s, 2) < 1 番目と 3 番目は 3 が出力される ('e' の長さと合成文字の長さを 足すと 3 バイト)。2 番目は 1 が出力される ('e' は 1 バイト)。 - 'encoding' に Unicode が設定されているときのみ byteidx() と違っ - た動作になる。 + 'encoding' に Unicode が設定されているときのみ |byteidx()| と + 違った動作になる。 |method| としても使用できる: > GetName()->byteidxcomp(idx) @@ -1714,7 +1714,7 @@ call({func}, {arglist} [, {dict}]) *call()* *E699* 戻り値の型: any。{func} による -ceil({expr}) *ceil()* +ceil({expr}) *ceil()* {expr} 以上となる最小の整数を浮動小数点数 |Float| で返す (切り上げる)。 {expr} は |Float| か |Number| に評価されなければならない。 @@ -1748,7 +1748,7 @@ changenr() *changenr()* 戻り値の型: |Number| -char2nr({string} [, {utf8}]) *char2nr()* +char2nr({string} [, {utf8}]) *char2nr()* {string}の最初の文字のASCIIコードを返す。例: > char2nr(" ") returns 32 char2nr("ABC") returns 65 @@ -1800,8 +1800,7 @@ charcol({expr} [, {winid}]) *charcol()* < 戻り値の型: |Number| - *charidx()* -charidx({string}, {idx} [, {countcc} [, {utf16}]]) +charidx({string}, {idx} [, {countcc} [, {utf16}]]) *charidx()* {string} 内の {idx} バイト目の文字インデックスを返す。最初の文 字のインデックスは0。 マルチバイト文字がない時は {idx} に等しい値を返す。 @@ -1967,23 +1966,23 @@ col({expr} [, {winid}]) *col()* 戻り値の型: |Number| -complete({startcol}, {matches}) *complete()* *E785* +complete({startcol}, {matches}) *complete()* *E785* 挿入モード補完のマッチを設定する。挿入モードでのみ使用できる。 通常は CTRL-R = (|i_CTRL-R| を参照) のマッピングから呼び出され る。ただし、|| または || マッピングからも呼び 出される。CTRL-O の後や式のマッピングでは機能しない。 - {startcol}は補完すべき単語の開始位置を示す、行内のバイトオフセッ - トである。その位置からカーソルまでのテキストが補完すべき単語と - なる。 - {matches}はリスト|List|でなければならない。リストの各要素が1つ + {startcol} は補完すべき単語の開始位置を示す、行内のバイトオフ + セットである。その位置からカーソルまでのテキストが補完すべき単 + 語となる。 + {matches} は |List| でなければならない。|List| の各要素が 1 つ の候補となる。この要素として許される値については - |complete-items|を参照。 + |complete-items| を参照。 'completeopt' の "longest" は無視される。 Note この関数を呼んだ後は補完を停止させるようなテキストの挿入 をしないように注意しなければならない。 - この関数で設定した候補は普通の挿入モード補完と同じ様にCTRL-Nと - CTRL-Pで選択できる。設定されていればポップアップメニューが表示 - される。|ins-completion-menu|を参照。 + この関数で設定した候補は普通の挿入モード補完と同じ様に CTRL-N + と CTRL-P で選択できる。設定されていればポップアップメニューが + 表示される。|ins-completion-menu| を参照。 例 (旧来の Vim script を使用): > @@ -2018,7 +2017,7 @@ complete({startcol}, {matches}) *complete()* *E785* 戻り値の型: |Number| -complete_add({expr}) *complete_add()* +complete_add({expr}) *complete_add()* 候補のリストに{expr}を追加する。'completefunc' で指定された関 数の中でのみ使われる。 失敗したときは0を返す(空文字列かメモリ不足)。候補が追加された @@ -2032,7 +2031,7 @@ complete_add({expr}) *complete_add()* 戻り値の型: |Number| -complete_check() *complete_check()* +complete_check() *complete_check()* 補完候補を探している間にキーがタイプされたかどうか確認する。補 完の検索に時間がかかる場合に使われる。候補の検索を中断しようと しているときは|TRUE|を返す。そうでないときは0を返す。 @@ -2041,7 +2040,7 @@ complete_check() *complete_check()* 戻り値の型: |Number| -complete_info([{what}]) *complete_info()* +complete_info([{what}]) *complete_info()* 挿入モードの補完に関する情報を辞書 |Dictionary| で返す。 |ins-completion| を参照。 要素は以下の通り: @@ -2111,7 +2110,7 @@ complete_info([{what}]) *complete_info()* < 戻り値の型: dict -complete_match([{lnum}, {col}]) *complete_match()* +complete_match([{lnum}, {col}]) *complete_match()* 指定された位置から後方に検索し、'isexpand' オプションに従って マッチした文字列のリストを返す。引数が指定されていない場合は、 現在のカーソル位置を使用する。 @@ -2155,8 +2154,8 @@ complete_match([{lnum}, {col}]) *complete_match()* < 戻り値の型: list> - *confirm()* -confirm({msg} [, {choices} [, {default} [, {type}]]]) + +confirm({msg} [, {choices} [, {default} [, {type}]]]) *confirm()* confirm()はユーザーに選択させるためのダイアログを提供する。戻 り値は選択した番号になる。最初の選択肢が1である。 Note: confirm()は、ダイアログサポートを有効にしてコンパイルし @@ -2216,7 +2215,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) 戻り値の型: |Number| -copy({expr}) *copy()* +copy({expr}) *copy()* {expr}のコピーを作る。数値と文字列の場合は、{expr}そのものとコ ピーの間に違いはない。 {expr}がリスト|List|の場合は浅いコピーを作る。つまり元のリスト @@ -2283,8 +2282,8 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* < 戻り値の型: |Number| - *cscope_connection()* -cscope_connection([{num} , {dbpath} [, {prepend}]]) + +cscope_connection([{num} , {dbpath} [, {prepend}]]) *cscope_connection()* |cscope|接続が存在するかどうか判定する。引数が1個も指定されな かった場合、戻り値は以下のようになる: 0, cscopeが利用できない(コンパイル時に無効化されている) @@ -2391,7 +2390,7 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698* 1度だけコピーされる。全ての参照はこのただ1つのコピーを指す。 {noref}が1の場合、リストや辞書は現れるたびに新しいコピーが作ら れる。そのため循環参照があるとdeepcopy()は失敗する。 - *E724* + *E724* ネストは100レベルまで可能である。それ以上参照を繰り返している 要素があると、{noref}が1の場合は失敗する。 |copy()|も参照。 @@ -2449,8 +2448,9 @@ deletebufline({buf}, {first} [, {last}]) *deletebufline()* < 戻り値の型: |Number| - *did_filetype()* -did_filetype() autocommandが実行されFileTypeイベントが一度でも起こっていれば、 + +did_filetype() *did_filetype()* + autocommandが実行されFileTypeイベントが一度でも起こっていれば、 |TRUE|が返る。スクリプトのFileTypeイベントが、複数回呼び出され るのを回避するのに使える。 |FileType| `:setf FALLBACK` が使用されている場合は |FALSE| を返す。 @@ -2729,8 +2729,9 @@ escape({string}, {chars}) *escape()* < 戻り値の型: |String| - *eval()* -eval({string}) {string}を評価し、値を返す。|string()|の戻り値を元の値に戻すの + +eval({string}) *eval()* + {string}を評価し、値を返す。|string()|の戻り値を元の値に戻すの に非常に便利である。数値、浮動小数点数、文字列、Blob およびそ れらの複合に対して動作する。実際に存在する関数への |Funcref| に対しても動作する。|Vim9| script においては、完全修飾名から @@ -2790,7 +2791,7 @@ executable({expr}) *executable()* 戻り値の型: |Number| -execute({command} [, {silent}]) *execute()* +execute({command} [, {silent}]) *execute()* 単一あるいは複数のExコマンドを実行して、出力を文字列として返 す。 {command} は文字列かリストを使える。リストの場合はそれらの行は @@ -2842,7 +2843,7 @@ exepath({expr}) *exepath()* 戻り値の型: |String| -exists({expr}) *exists()* +exists({expr}) *exists()* 結果は数値で、変数{expr}が存在すれば|TRUE|となり、そうでなけれ ば0となる。 @@ -2963,7 +2964,7 @@ exists_compiled({expr}) *exists_compiled()* 戻り値の型: |String| -exp({expr}) *exp()* +exp({expr}) *exp()* {expr} の指数を返す。 値は [0, inf] の範囲の浮動小数点数 (|Float|)。 {expr} は浮動小数点数 (|Float|) か数値 (|Number|) でなければな @@ -2981,7 +2982,7 @@ exp({expr}) *exp()* 戻り値の型: |Float| -expand({string} [, {nosuf} [, {list}]]) *expand()* +expand({string} [, {nosuf} [, {list}]]) *expand()* ワイルドカードと{string}内の特殊なキーワードを展開する。 'wildignorecase' が適用される。 @@ -3105,6 +3106,7 @@ expandcmd({string} [, {options}]) *expandcmd()* < 戻り値の型: |String| または list。{list} による + extend({expr1}, {expr2} [, {expr3}]) *extend()* {expr1}と{expr2}は両方ともリスト|List|であるか、両方とも辞書 |Dictionaries|でなければならない。 @@ -3329,7 +3331,7 @@ filter({expr1}, {expr2}) *filter()* dict<{type}>。{expr1} による -finddir({name} [, {path} [, {count}]]) *finddir()* +finddir({name} [, {path} [, {count}]]) *finddir()* {path}から{name}という名前のディレクトリを探す。ディレクトリを 上方・下方のどちらにも再帰的に検索できる。{path}の記法について は|file-searching|を参照。 @@ -3356,7 +3358,7 @@ finddir({name} [, {path} [, {count}]]) *finddir()* は |String| 。 -findfile({name} [, {path} [, {count}]]) *findfile()* +findfile({name} [, {path} [, {count}]]) *findfile()* |finddir()|と同様だが、ディレクトリでなくファイルを検索する。 'suffixesadd' が適用される。 例: > @@ -3371,7 +3373,7 @@ findfile({name} [, {path} [, {count}]]) *findfile()* は |String| 。 -flatten({list} [, {maxdepth}]) *flatten()* +flatten({list} [, {maxdepth}]) *flatten()* リスト {list} を {maxdepth} の深さまで平坦化する。{maxdepth} が無い場合の結果は {maxdepth} が非常に巨大な数であるのように、 リスト |List| からネストを除去する。 @@ -3379,7 +3381,7 @@ flatten({list} [, {maxdepth}]) *flatten()* 使うこと。 Vim9 script では flatten() は使用できないため、常に |flattennew()| を使う必要がある。 - *E900* + *E900* {maxdepth} はリストのネストをどれだけ深く変更するかを意味する。 {maxdepth} が0なら {list} は変更されない。 {maxdepth} は正の数でなければならない。 @@ -3431,7 +3433,7 @@ float2nr({expr}) *float2nr()* 戻り値の型: |Number| -floor({expr}) *floor()* +floor({expr}) *floor()* {expr} 以下の最大の整数を |Float| で返す(切り捨て)。 {expr} は |Float| または |Number| に評価されなければならない。 {expr} が |Float| または |Number| でない場合は 0.0 を返す。 @@ -3558,8 +3560,9 @@ foldlevel({lnum}) *foldlevel()* < 戻り値の型: |Number| - *foldtext()* -foldtext() 閉じた折り畳みに表示する文字列を返す。これはオプション + +foldtext() *foldtext()* + 閉じた折り畳みに表示する文字列を返す。これはオプション 'foldtext' のデフォルトの関数であり、'foldtext' を評価している ときにだけ呼ぶようにすべきである。この関数は変数|v:foldstart|, |v:foldend|, |v:folddashes|を使用する。 @@ -3639,8 +3642,9 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* 戻り値の型: |String|, |Blob| list<{type}>, tuple<{type}> また は dict<{type}>。{expr1} による - *foreground()* -foreground() Vimのウィンドウを前面に移動する。この関数はクライアントからVim + +foreground() *foreground()* + Vimのウィンドウを前面に移動する。この関数はクライアントからVim サーバーへ送ると便利である。|remote_send()| Win32では自分自身のウィンドウを前面に持ってくることが必ずしも 許可されていないので、動作しないかもしれない。そのときは代わり @@ -3692,8 +3696,8 @@ funcref({name} [, {arglist}] [, {dict}]) *funcref()* < 戻り値の型: func(...): any または、エラー時は |Number| - *function()* *partial* *E700* *E923* -function({name} [, {arglist}] [, {dict}]) + +function({name} [, {arglist}] [, {dict}]) *function()* *partial* *E700* *E923* 関数{name}を参照する|Funcref|の変数を返す。{name}はユーザー定義 関数でも組み込み関数でもよい。 @@ -3809,6 +3813,7 @@ get({list}, {idx} [, {default}]) *get()* *get()-list* < 戻り値の型: any。{list} による + get({tuple}, {idx} [, {default}]) *get()-tuple* |Tuple| {tuple} から {idx} 番目の項目を取得する。この項目を取 得できない場合は {default} を返す。{default} が省略されたとき @@ -3818,6 +3823,7 @@ get({tuple}, {idx} [, {default}]) *get()-tuple* < 戻り値の型: any。{tuple} による + get({blob}, {idx} [, {default}]) *get()-blob* |Blob| {blob}から{idx}番目のバイトを取得する。このバイトを取得 できないときは{default}を返す。{default}が省略されたときは -1 @@ -3827,6 +3833,7 @@ get({blob}, {idx} [, {default}]) *get()-blob* < 戻り値の型: |Number| + get({dict}, {key} [, {default}]) *get()-dict* 辞書|Dictionary| {dict}からキー{key}に関連づけられた値を取得す る。この要素を取得できないときは{default}を返す。{default}が省 @@ -3839,6 +3846,7 @@ get({dict}, {key} [, {default}]) *get()-dict* < 戻り値の型: any。{dict} による + get({func}, {what}) *get()-func* |Funcref| {func} から項目 {what} を取得する。{what} の可能な値 は: @@ -3865,8 +3873,8 @@ get({func}, {what}) *get()-func* < 戻り値の型: any。{func} および {what} による - *getbufinfo()* -getbufinfo([{buf}]) + +getbufinfo([{buf}]) *getbufinfo()* getbufinfo([{dict}]) バッファの情報を辞書のリストとして取得する。 @@ -3938,8 +3946,7 @@ getbufinfo([{dict}]) 戻り値の型: list> - *getbufline()* -getbufline({buf}, {lnum} [, {end}]) +getbufline({buf}, {lnum} [, {end}]) *getbufline()* バッファ{buf}の{lnum}行目から{end}行目まで(両端含む)の行からな るリスト|List|を返す。{end}が省略されたときは{lnum}行目だけか らなるリストを返す。1 行のみの取得については `getbufoneline()` @@ -3969,15 +3976,15 @@ getbufline({buf}, {lnum} [, {end}]) < 戻り値の型: list - *getbufoneline()* -getbufoneline({buf}, {lnum}) + +getbufoneline({buf}, {lnum}) *getbufoneline()* `getbufline()` と似ているが、1 行だけを取得して文字列として返 す。 戻り値の型: |String| -getbufvar({buf}, {varname} [, {def}]) *getbufvar()* +getbufvar({buf}, {varname} [, {def}]) *getbufvar()* バッファ{buf}のオプションの値やバッファローカル変数{varname} の値を返す。Note "b:" をつけない変数名を指定すること。 {varname} が空文字列の場合、全てのバッファローカル変数からなる @@ -4072,9 +4079,9 @@ getchar([{expr} [, {opts}]]) *getchar()* {expr} が1のときは最初のバイトだけを返す。1バイト文字の場合、 これはその文字そのものを表す数値である。これを文字列に変換する - にはnr2char()を使う。 + には |nr2char()| を使う。 - 修飾キーを取得するには getcharmod() を使う。 + 修飾キーを取得するには |getcharmod()| を使う。 オプション引数 {opts} は Dict であり、次の項目をサポートする: @@ -4099,10 +4106,10 @@ getchar([{expr} [, {opts}]]) *getchar()* 飾子を含めない。 (デフォルト: |TRUE|) - ユーザーがマウスをクリックしたときはマウスイベントを返す。クリッ - クした位置は|v:mouse_col|, |v:mouse_lnum|, |v:mouse_winid|, - |v:mouse_win|で得られる。|getmousepos()| も使える。マウスの移 - 動イベントは無視される。 + ユーザーがマウスをクリックしたときはマウスイベントを返す。ク + リックした位置は |v:mouse_col|, |v:mouse_lnum|, + |v:mouse_winid|, |v:mouse_win| で得られる。|getmousepos()| も + 使える。マウスの移動イベントは無視される。 以下の例は、普通にマウスがクリックされたときと同じようにカーソ ルを移動させる。 > let c = getchar() @@ -4155,8 +4162,8 @@ getchar([{expr} [, {opts}]]) *getchar()* getcharmod() *getcharmod()* - 最後にgetchar()などで得た文字に対する修飾キーの状態を表す数値 - を返す。以下の値の和となる: + 最後に |getchar()| などで得た文字に対する修飾キーの状態を表す + 数値を返す。以下の値の和となる: 2 shift 4 control 8 alt (meta) @@ -4194,17 +4201,16 @@ getcharsearch() *getcharsearch()* リを持つ: char 文字検索(|t|, |f|, |T|, |F|)で以前に使われた文 - 字。 - もし文字検索が実行されていないなら空文字列。 - forward 文字検索の方向。1は前方、0は後方。 - until 文字検索の種類。1は|t|もしくは|T|の文字検索、0は - |f|もしくは|F|の文字検索。 + 字。文字検索が実行されていない場合は空文字列。 + forward 文字検索の方向。1 は前方、0 は後方。 + until 文字検索の種類。1 は |t| もしくは |T| の文字検 + 索、0 は |f| もしくは |F| の文字検索。 下記の設定は前回の文字検索の方向にかかわらず、|;| で前方検索、 |,| で後方検索を常に行えるようになり便利である: > :nnoremap ; getcharsearch().forward ? ';' : ',' :nnoremap , getcharsearch().forward ? ',' : ';' -< |setcharsearch()|も参照。 +< |setcharsearch()| も参照。 戻り値の型: dict @@ -4215,6 +4221,7 @@ getcharstr([{expr} [, {opts}]]) *getcharstr()* 戻り値の型: |String| + getcmdcomplpat() *getcmdcomplpat()* 現在のコマンドラインの補完パターンを返す。 コマンドラインが編集されている場合にのみ機能するため、 @@ -4396,6 +4403,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* < 戻り値の型: list + getcompletiontype({pat}) *getcompletiontype()* {pat} を使用したコマンドライン補完の種類を返す。 対応する補完の種類が見つからない場合は、空の文字列が返される。 @@ -4404,8 +4412,8 @@ getcompletiontype({pat}) *getcompletiontype()* 戻り値の型: |String| - *getcurpos()* -getcurpos([{winid}]) + +getcurpos([{winid}]) *getcurpos()* カーソルの位置を返す。これは getpos('.') に似ているが、追加の "curswant" 情報を含む: [0, lnum, col, off, curswant] ~ @@ -4435,7 +4443,7 @@ getcurpos([{winid}]) 戻り値の型: list -getcursorcharpos([{winid}]) *getcursorcharpos()* +getcursorcharpos([{winid}]) *getcursorcharpos()* |getcurpos()| と同様だが返すリスト内の桁番号はバイトインデック スの代わりに文字インデックスになっている。 @@ -4488,6 +4496,7 @@ getcwd([{winnr} [, {tabnr}]]) *getcwd()* < 戻り値の型: |String| + getenv({name}) *getenv()* 環境変数{name}の値を返す。引数 {name} は先行する '$' のない文 字列。例: > @@ -4556,8 +4565,8 @@ getfsize({fname}) *getfsize()* getftime({fname}) *getftime()* 結果は{fname}で与えられたファイルの、最終更新時間を示す数値。 - 1970年1月1日からの経過時間(秒)で、strftime()に渡すことができる - だろう。|localtime()|と|strftime()|も参照。 + 1970年1月1日からの経過時間(秒)で、|strftime()| に渡すことがで + きるだろう。|localtime()|と|strftime()|も参照。 ファイル{fname}が見つからなかった場合には-1を返す。 |method| としても使用できる: > @@ -4590,6 +4599,7 @@ getftype({fname}) *getftype()* < 戻り値の型: |String| + getimstatus() *getimstatus()* 結果は数値で、IMEステータスがアクティブの場合は |TRUE| で、そ れ以外の場合は |FALSE| である。 @@ -4622,8 +4632,8 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* < 戻り値の型: list - *getline()* -getline({lnum} [, {end}]) + +getline({lnum} [, {end}]) *getline()* {end}が指定されない場合は、カレントバッファの{lnum}行目の内容 を文字列にして返す。例: > getline(1) @@ -4779,16 +4789,16 @@ getmouseshape() *getmouseshape()* 戻り値の型: |String| -getpid() *getpid()* +getpid() *getpid()* Vim のプロセス ID を数値で返す。Unix と MS-Windows では Vim が 終了するまでこれは一意な数値である。 戻り値の型: |Number| -getpos({expr}) *getpos()* +getpos({expr}) *getpos()* 文字列{expr}の位置を返す。 - {expr} に受け入れられる値は以下: *E1209* + {expr} に受け入れられる値は以下: *E1209* . カーソルの位置。 $ カレントバッファの最終行。 'x マーク x の位置 (マークが設定されていない場合は、 @@ -4851,7 +4861,7 @@ getqflist([{what}]) *getqflist()* 現在の全quickfixエラーのリスト |List| を返す。リストの各要素は 辞書で、以下の要素を持つ: bufnr ファイル名を持つバッファの番号。その名前を取得 - するにはbufname()を使う。 + するには |bufname()| を使う。 module モジュール名 lnum バッファ中の行番号(最初の行は1) end_lnum @@ -5073,7 +5083,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* 戻り値の型: list -getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* +getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* |getregion()| と同じだが、{pos1} と {pos2} によって囲まれたバッ ファのテキストセグメントを表す位置のリストを返す。 セグメントは、各行の位置のペアである: > @@ -5203,7 +5213,7 @@ gettabinfo([{tabnr}]) *gettabinfo()* 戻り値の型: list> -gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* +gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* タブページ {tabnr} のタブローカル変数 {varname} を取得する。 |t:var| タブの番号は 1 から始まる。 @@ -5219,7 +5229,7 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* 戻り値の型: any。{varname} による -gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* +gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* タブページ{tabnr}内のウィンドウ{winnr}のウィンドウローカル変数 {varname}の値を取得する。 引数 {varname} は文字列。{varname}が空のときは全ウィンドウロー @@ -5393,7 +5403,7 @@ getwinposy() *getwinposy()* 戻り値の型: |Number| -getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* +getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* カレントタブページに対する|gettabwinvar()|と同様。 例: > :let list_is_on = getwinvar(2, '&list') @@ -5405,7 +5415,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* 戻り値の型: any。{varname} による -glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* +glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* {expr}内のファイル名のワイルドカードを展開する。特殊文字につい ては|wildcards|を参照。 @@ -5449,7 +5459,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* glob2regpat({string}) *glob2regpat()* - glob()に使われるファイルパターンを検索パターンに変換する。 + |glob()| に使われるファイルパターンを検索パターンに変換する。 結果はファイル名の文字列とのマッチに使用できる。例えば、 > if filename =~ glob2regpat('Make*.mak') < 上記は次と同じである: > @@ -5463,10 +5473,10 @@ glob2regpat({string}) *glob2regpat()* < 戻り値の型: |String| - *globpath()* + *globpath()* globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) - {path}の中の全ディレクトリで文字列 {expr} に対して|glob()|を実 - 行し、結果を連結する。例: > + {path} の中の全ディレクトリで文字列 {expr} に対して |glob()| + を実行し、結果を連結する。例: > :echo globpath(&rtp, "syntax/c.vim") < {path}はコンマ区切りのディレクトリのリスト。各ディレクトリを @@ -5507,7 +5517,7 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) {list} による -has({feature} [, {check}]) *has()* +has({feature} [, {check}]) *has()* {check} がない、もしくは0: 結果は機能{feature}がサポートしてい る場合1、されない場合0となる。引数{feature}は文字列で大文字/ 小文字の区別が無視される。下記の |feature-list| を参照。 @@ -5720,6 +5730,7 @@ histnr({history}) *histnr()* < 戻り値の型: |Number| + hlexists({name}) *hlexists()* 結果は数値で、{name}という名のハイライトグループが存在すれば、 真が返される。これはなんらかの方法でそのグループが既に定義され @@ -5836,7 +5847,7 @@ hlset({list}) *hlset()* < 戻り値の型: |Number| -hlID({name}) *hlID()* +hlID({name}) *hlID()* 結果は数値で、{name}という名前のハイライトグループのID番号。そ のハイライトグループが存在しない場合は0が返される。 これはハイライトグループについての情報を獲得するために使用され @@ -5912,7 +5923,7 @@ id({item}) *id()* 戻り値の型: |String| -indent({lnum}) *indent()* +indent({lnum}) *indent()* カレントバッファの{lnum}行目のインデント量を数値で返す。この インデント量はスペース単位で数えられ、'tabstop' の値が関係する。 {lnum}は|getline()|の場合と同様に扱われる。 @@ -5924,7 +5935,7 @@ indent({lnum}) *indent()* 戻り値の型: |Number| -index({object}, {expr} [, {start} [, {ic}]]) *index()* +index({object}, {expr} [, {start} [, {ic}]]) *index()* {object} から {expr} を探し、そのインデックスを返す。ラムダを 使って項目を選択する方法については |indexof()| を参照。 @@ -6047,7 +6058,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* 戻り値の型: |String| -inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* +inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* |input()|と同様。GUIで動作していて、テキストダイアログがサポー トされている場合はダイアログを表示してテキストを入力させる。 例: > @@ -6090,10 +6101,10 @@ inputlist({textlist}) *inputlist()* inputrestore() *inputrestore()* - 前回の|inputsave()|で保存しておいた先行入力を復元する。 - inputsave()と同じ回数だけ呼ぶようにしなければならない。しかし - 多く呼びすぎても害はない。復元するものがなければ真を、そうでな - ければ偽を返す。 + 前回の |inputsave()| で保存しておいた先行入力を復元する。 + |inputsave()| と同じ回数だけ呼ぶようにしなければならない。しか + し多く呼びすぎても害はない。復元するものがなければ真を、そうで + なければ偽を返す。 戻り値の型: |Number| @@ -6101,9 +6112,9 @@ inputrestore() *inputrestore()* inputsave() *inputsave()* 先行入力(マッピングにより入力された文字も含む)を保存し、クリア することにより、これ以降のプロンプトがユーザーからの入力を得る - ようにする。プロンプトの後で、対応するinputrestore()を呼び出さ - ねばならない。複数回呼ぶこともできる。ただしその場合は同じ回数 - だけinputrestore()を呼ばなくてはならない。 + ようにする。プロンプトの後で、対応する |inputrestore()| を呼び + 出さねばならない。複数回呼ぶこともできる。ただしその場合は同じ + 回数だけ |inputrestore()| を呼ばなくてはならない。 メモリ不足のときは真を、そうでなければ偽を返す。 戻り値の型: |Number| @@ -6146,8 +6157,7 @@ insert({object}, {item} [, {idx}]) *insert()* 戻り値の型: |Number| - *instanceof()* *E614* *E616* *E693* -instanceof({object}, {class}) +instanceof({object}, {class}) *instanceof()* *E614* *E616* *E693* 結果は数値で、{object} 引数が {class} で指定された |Class|, |Interface|, または、クラスの |:type| エイリアスの直接または間 接インスタンスである場合に |TRUE| となる。 @@ -6161,6 +6171,7 @@ instanceof({object}, {class}) < 戻り値の型: |Number| + interrupt() *interrupt()* スクリプトの実行を中断する。これは多かれ少なかれ、ユーザーが CTRL-C をタイプしたように動作する。多くのコマンドが実行されず、 @@ -6176,6 +6187,7 @@ interrupt() *interrupt()* < 戻り値の型: void + invert({expr}) *invert()* ビット反転。引数は数値に変換される。リスト、辞書、浮動小数点数 を指定するとエラーになる。例: > @@ -6348,7 +6360,7 @@ js_encode({expr}) *js_encode()* 戻り値の型: |String| -json_decode({string}) *json_decode()* *E491* +json_decode({string}) *json_decode()* *E491* これはJSONフォーマットの文字列を解析し、それと同等のVimの値を 返す。JSONとVimの値の関係は|json_encode()|を参照。 デコードは寛容である: @@ -6375,7 +6387,7 @@ json_decode({string}) *json_decode()* *E491* のような連続した 12 文字でなければならないが、json_decode() は、"\uD834" や "\uD834\u" のような途切れたサロゲートペアを 黙って受け付ける。 - *E938* + *E938* 結果は Vim の有効な型でなければならないため、rfc7159 では有効 なオブジェクト内の重複キーは、json_decode() では受け付けられな い、例えばこれは失敗する: {"a":"b", "a":"c"} @@ -6461,20 +6473,20 @@ len({expr}) *len()* *E701* 戻り値の型: |Number| - *libcall()* *E364* *E368* -libcall({libname}, {funcname}, {argument}) - ランタイムライブラリ{libname}の関数{funcname}を、単一の引数 - {argument}で呼び出す。 - Vimで使うように特別に作ったライブラリの関数を呼ぶために使われ - る。引数は1個しか指定できないため、普通のライブラリ関数を呼ぶ - にはかなり制限がある。 +libcall({libname}, {funcname}, {argument}) *libcall()* *E364* *E368* + ランタイムライブラリ {libname} の関数 {funcname} を、単一の引 + 数 {argument} で呼び出す。 + Vim で使うように特別に作ったライブラリの関数を呼ぶために使われ + る。引数は 1 個しか指定できないため、普通のライブラリ関数を呼 + ぶにはかなり制限がある。 結果には、呼び出した関数から返された文字列が返される。呼び出し - た関数がNULLを返した場合には、Vimには空文字列 "" が戻される。 - 関数の戻り値が数値である場合には|libcallnr()|を使うこと。 - もしも引数が数値ならば、関数にはint型の引数が1つ渡される。引数 - が文字列の場合には、関数にはヌル終端記号を持つ文字列が引数とし - て渡される。 - |restricted-mode|の中で呼ぶと失敗する。 + た関数が NULL を返した場合には、Vim には空文字列 "" が戻され + る。 + 関数の戻り値が数値である場合には |libcallnr()| を使うこと。 + {argument} が数値の場合、関数には int 型の引数が 1 つ渡される。 + {argument} が文字列の場合は、関数にはヌル終端記号を持つ文字列 + が引数として渡される。 + |restricted-mode| の中で呼ぶと失敗する。 libcall()によってVimを再コンパイルすることなく 'plug-in' と呼 ばれる独自の拡張を行うことができるようになる。それは (直接) シ @@ -6508,8 +6520,8 @@ libcall({libname}, {funcname}, {argument}) < |method| としても使用でき、ベースは第3引数として渡される: > GetValue()->libcall("libc.so", "getenv") < - *libcallnr()* -libcallnr({libname}, {funcname}, {argument}) + +libcallnr({libname}, {funcname}, {argument}) *libcallnr()* |libcall()|とほぼ同様だが、文字列でなくintを返す関数に使う。 {Win32と、|+libcall|機能が有効になっているUnixでのみ利用可能} 例: > @@ -6750,7 +6762,7 @@ listener_flush([{buf}]) *listener_flush()* listener_remove({id}) *listener_remove()* - 以前に listener_add() で追加されたリスナーを削除する。 + 以前に |listener_add()| で追加されたリスナーを削除する。 {id} が見つからなかった場合は偽、{id} が削除された場合は真を返 す。 @@ -6801,7 +6813,7 @@ log10({expr}) *log10()* 戻り値の型: |Float| -luaeval({expr} [, {expr}]) *luaeval()* +luaeval({expr} [, {expr}]) *luaeval()* Lua の式 {expr} を評価し、その結果を Vim のデータ構造に変換し たものを返す。2番目の {expr} は、最初の {expr} の中では _A と してアクセスできる追加の引数を保持する。 @@ -6885,7 +6897,7 @@ map({expr1}, {expr2}) *map()* dict<{type}>。{expr1} による -maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* +maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* {dict}が省略されたかゼロのとき: モード{mode}におけるキーマップ {name}のrhsを返す。結果の文字列内の特殊文字は、":map" コマンド でリスト表示した時のように変換される。 @@ -6929,8 +6941,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* "expr" 式マッピング (|:map-|) なら 1。 "buffer" バッファローカルマッピング (|:map-local|) なら 1。 - "mode" マッピングが定義されているモード。上述のモードに - 加え、次の文字が使用される: + "mode" マッピングが定義されているモード。上述のモード + に加え、次の文字が使用される: " " ノーマル、ビジュアル、オペレータ待機 "!" 挿入、コマンドラインモード (|mapmode-ic|) @@ -6975,13 +6987,13 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* mapcheck("ax") yes no no mapcheck("b") no no no - maparg()との違いは、mapcheck()は{name}にマッチするマップを見つ - けるが、maparg()はぴったり{name}に一致するマッピングのみを見つ - ける。 - {name}にマッチするキーマップが存在しない時には、空文字列が返さ - れる。結果が一つならばマップされたRHSが返される。{name} で始ま - るマッピングが複数見つかった場合には、それらのうちどれか一つの - RHSが返される。RHS が空の場合は "" となる。 + |maparg()| との違いは、mapcheck()は {name} にマッチするマップ + を見つけるが、|maparg()| はぴったり {name} に一致するマッピン + グのみを見つける。 + {name} にマッチするキーマップが存在しない時には、空文字列が返 + される。結果が 1 つならばマップされた RHS が返される。{name} + で始まるマッピングが複数見つかった場合には、それらのうちどれか + 1 つのRHS が返される。RHS が空の場合は "" となる。 まずカレントバッファにローカルなマッピングを探し、次のグローバ ルマッピングを探す。 この関数はマッピングが曖昧にならないかチェックするために使うこ @@ -7034,7 +7046,7 @@ maplist([{abbr}]) *maplist()* 戻り値の型: list> -mapnew({expr1}, {expr2}) *mapnew()* +mapnew({expr1}, {expr2}) *mapnew()* |map()| と同様だが、{expr1} の要素を置き換える代わりに、新しい リストまたは辞書が作成されて返される。{expr1} は変更されない。 要素は引き続き {expr2} で変更できるが、そうしたくないなら最初 @@ -7043,7 +7055,7 @@ mapnew({expr1}, {expr2}) *mapnew()* 戻り値の型: |String|, |Blob|, list<{type}> または dict<{type}>。{expr1} による -mapset({mode}, {abbr}, {dict}) *mapset()* +mapset({mode}, {abbr}, {dict}) *mapset()* mapset({dict}) |maparg()| または |maplist()| によって返される可能性のある辞書 からマッピングを復元する。dict.buffer が真の場合、バッファの @@ -7085,7 +7097,7 @@ mapset({dict}) 戻り値の型: |Number| -match({expr}, {pat} [, {start} [, {count}]]) *match()* +match({expr}, {pat} [, {start} [, {count}]]) *match()* {expr}がリストの場合は、{pat}にマッチする最初の要素のインデッ クスを返す。各要素は文字列として扱われる。リストと辞書はechoし たときと同じように文字列表現に変換される。 @@ -7102,11 +7114,11 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* :echo match("testing", "ing") " 結果は 4 :echo match([1, 'x'], '\a') " 結果は 1 < {pat}の扱われ方については|string-match|を参照。 - *strpbrk()* + *strpbrk()* strpbrk()に相当する関数はVimに存在しない。しかし同じことを次の ようにしてできる: > :let sepidx = match(line, '[.,;: \t]') -< *strcasestr()* +< *strcasestr()* strcasestr()に相当する関数はVimに存在しない。しかし正規表現に "\c" をつければ大文字・小文字の違いを無視できる: > :let idx = match(haystack, '\cneedle') @@ -7155,7 +7167,7 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* 戻り値の型: |Number| - *matchadd()* *E290* *E798* *E799* *E801* *E957* + *matchadd()* *E290* *E798* *E799* *E801* *E957* matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) カレントウィンドウで強調表示するパターンを定義する。このパター ンのことを「マッチ」と呼ぶ。構文グループ {group}で強調する。戻 @@ -7253,15 +7265,15 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) 戻り値の型: |Number| -matcharg({nr}) *matcharg()* - |:match|、|:2match|、|:3match|によって設定されているマッチパター - ンの情報を返す。{nr}が1のときは|:match|の情報、2のときは - |:2match|の情報、3のときは|:3match|の情報を返す。 - 戻り値は次の2個の要素を持つリストである: +matcharg({nr}) *matcharg()* + |:match|、|:2match|、|:3match| によって設定されているマッチパ + ターンの情報を返す。{nr} が 1 のときは |:match| の情報、2 のと + きは |:2match| の情報、3 のときは |:3match| の情報を返す。 + 戻り値は次の 2 個の要素を持つリストである: 引数で指定したハイライトグループ名 引数で指定した検索パターン - {nr}が1、2、3のどれでもないときは空リストを返す。 - マッチパターンがセットされていないときは['', '']を返す。 + {nr} が 1、2、3 のどれでもないときは空リストを返す。 + マッチパターンがセットされていないときは ['', ''] を返す。 |:match| を保存し、復元するのに便利である。 |:match| を使った強調は 3 個までに限られている。 |matchadd()| にはこの制限はない。 @@ -7271,8 +7283,8 @@ matcharg({nr}) *matcharg()* < 戻り値の型: list - *matchbufline()* -matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) + +matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) *matchbufline()* バッファ {buf} 内の {lnum} から {end} までの行で、{pat} がマッ チした行の |List| を返す。 @@ -7338,7 +7350,7 @@ matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* 戻り値の型: |Number| -matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* +matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* |match()|と同じだが、返されるのはマッチした部分文字列の終了後の インデックスである。例: > :echo matchend("testing", "ing") @@ -7413,7 +7425,8 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* :echo v:oldfiles->matchfuzzy("test") < 結果は "test" とファジーマッチしたファイル名のリストになる。 > :let l = readfile("buffer.c")->matchfuzzy("str") -< 結果は "str" とファジーマッチした "buffer.c" 内の行のリストになる。 > +< 結果は "str" とファジーマッチした "buffer.c" 内の行のリストに + なる。 > :echo ['one two', 'two one']->matchfuzzy('two one') < 結果は ['two one', 'one two'] になる。 > :echo ['one two', 'two one']->matchfuzzy('two one', @@ -7449,13 +7462,14 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()* 戻り値の型: list> -matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* - |match()| と同じだがリストを返す。リストの最初の要素は、 - matchstr()が返すのと同じマッチした文字列。それ以降の要素は - |:substitute|における "\1"、"\2" のようなサブマッチである。\1 - から\9までの間で、指定されなかったものは空文字列となる。例: > +matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* + |match()| と同じだがリストを返す。リストの最初の要素 + は、|matchstr()| が返すのと同じマッチした文字列。それ以降の要 + 素は |:substitute| における "\1"、"\2" のようなサブマッチであ + る。\1 から \9 までの間で、指定されなかったものは空文字列とな + る。例: > echo matchlist('acd', '\(a\)\?\(b\)\?\(c\)\?\(.*\)') -< 結果は['acd', 'a', '', 'c', 'd', '', '', '', '', '']となる。 +< 結果は ['acd', 'a', '', 'c', 'd', '', '', '', '', ''] となる。 マッチしなかったときは空リストを返す。 リストを渡すことはできるが、あまり役に立たない。 @@ -7465,8 +7479,8 @@ matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* < 戻り値の型: list または list - *matchstrlist()* -matchstrlist({list}, {pat} [, {dict}]) + +matchstrlist({list}, {pat} [, {dict}]) *matchstrlist()* {pat} がマッチする {list} 内のマッチの |List| を返す。 {list} は文字列の |List| である。{list} 内の各文字列に対して {pat} がマッチする。 @@ -7508,7 +7522,7 @@ matchstrlist({list}, {pat} [, {dict}]) 戻り値の型: list> または list -matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* +matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* |match()| と同じだが、マッチした文字列を返す。例: > :echo matchstr("testing", "ing") < 結果は "ing"。 @@ -7528,7 +7542,7 @@ matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* 戻り値の型: |String| -matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* +matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* |matchstr()| と同じだがマッチした文字列とマッチした開始位置と 終了位置を返す。例: > :echo matchstrpos("testing", "ing") @@ -7551,7 +7565,7 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* 戻り値の型: list -max({expr}) *max()* +max({expr}) *max()* {expr} の全要素の値の最大値を返す。例: > echo max([apples, pears, oranges]) @@ -7585,7 +7599,7 @@ menu_info({name} [, {mode}]) *menu_info()* "!" 挿入、コマンドライン {mode} を指定していないときは、モードとして "" が使用される。 - 戻り値の辞書|Dictionary| は以下の項目が含まれる: + 戻り値の |Dictionary| は以下の項目が含まれる: accel メニュー項目のアクセラレータテキスト |menu-text| display 表示名 ('&' を含まない) enabled v:true ならメニュー項目が有効 @@ -7641,7 +7655,7 @@ menu_info({name} [, {mode}]) *menu_info()* < 戻り値の型: dict -min({expr}) *min()* +min({expr}) *min()* {expr} の全要素の値の最小値を返す。例: > echo min([apples, pears, oranges]) @@ -7710,7 +7724,7 @@ mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739* 戻り値の型: |Number| -mode([{expr}]) *mode()* +mode([{expr}]) *mode()* 現在のモードを示す文字列を返す。 {expr} に 0 でない数値か空でない文字列 (|non-zero-arg|) を指定 した場合、フルモードが返される。それ以外の場合は最初の一文字だ @@ -7775,7 +7789,7 @@ mode([{expr}]) *mode()* 戻り値の型: |String| -mzeval({expr}) *mzeval()* +mzeval({expr}) *mzeval()* MzScheme の式 {expr} を評価してその結果を Vim の変数に変換した 結果を返す。 数値と文字列はそのまま返る。 @@ -8058,16 +8072,17 @@ printf({fmt}, {expr1} ...) *printf()* *printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X* - dbBoxX 数値の引数を符号付き10進数(d)、符号なし2進数(bまたは - B)、符号なし8進数(o)、符号なし16進数(xまたはX)の書式に - 変換する。xの場合は "abcdef" と小文字を使い、Xの場合は - "ABCDEF" と大文字を使う。 + dbBoxX 数値の引数を符号付き 10 進数 (d)、符号なし 2 進数 (b + またはB)、符号なし 8 進数 (o)、符号なし 16 進数 (x また + は X) の書式に変換する。x の場合は "abcdef" と小文字を + 使い、X の場合は "ABCDEF" と大文字を使う。 精度が指定されていれば出力する最小桁数を意味する。変換 された値を出力するのにそれ以下しか必要としない場合は、 左側にゼロを加えて埋める。 フィールド幅が存在しない場合や小さすぎる場合でも、数値 の幅を切り詰めることは決してない。変換結果がフィールド - 幅より多くの桁を必要とする場合は、十分な幅に広げられる。 + 幅より多くの桁を必要とする場合は、十分な幅に広げられ + る。 モディファイア 'h' は引数が16ビット引数である事を示す。 モディファイア 'l' 修飾子は、引数が長整数であることを 示す。サイズはプラットフォームによって 32 ビットか 64 @@ -8433,7 +8448,7 @@ rand([{expr}]) *rand()* *random* 戻り値の型: |Number| *E726* *E727* -range({expr} [, {max} [, {stride}]]) *range()* +range({expr} [, {max} [, {stride}]]) *range()* 以下のような数値のリスト|List|を返す。 - {expr}のみを指定したときは: [0, 1, ..., {expr} - 1] - {max}を指定したときは: [{expr}, {expr} + 1, ..., {max}] @@ -8455,7 +8470,7 @@ range({expr} [, {max} [, {stride}]]) *range()* 戻り値の型: list -readblob({fname} [, {offset} [, {size}]]) *readblob()* +readblob({fname} [, {offset} [, {size}]]) *readblob()* ファイル {fname} をバイナリモードで読み |Blob| を返す。 {offset} が指定されている場合は、指定されたオフセットからファ イルを読み取る。負の値の場合、ファイルの終わりからのオフセット @@ -8483,7 +8498,7 @@ readblob({fname} [, {offset} [, {size}]]) *readblob()* 戻り値の型: |Blob| -readdir({directory} [, {expr} [, {dict}]]) *readdir()* +readdir({directory} [, {expr} [, {dict}]]) *readdir()* {directory}内のファイル名とディレクトリ名のリストを返す。 一致数を制限するなど、複雑なことをする必要がない場合は、 |glob()| を使用することもできる。 @@ -8544,7 +8559,7 @@ readdir({directory} [, {expr} [, {dict}]]) *readdir()* 戻り値の型: list または list -readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* +readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* |readdir()| の拡張バージョン。 {directory} にあるファイルとディレクトリの情報を持つ辞書のリス トを返す。 @@ -8613,8 +8628,7 @@ readdirex({directory} [, {expr} [, {dict}]]) *readdirex()* 戻り値の型: list> または list - *readfile()* -readfile({fname} [, {type} [, {max}]]) +readfile({fname} [, {type} [, {max}]]) *readfile()* ファイル{fname}を読み込み、各行を要素とするリスト|List|を返す。 行はNL文字で終わるものとする。改行文字がCRであるMacintoshのファ イルは単一の長い行となる(どこかにNLが現れない限り)。 @@ -8650,6 +8664,7 @@ readfile({fname} [, {type} [, {max}]]) < 戻り値の型: list または list + reduce({object}, {func} [, {initial}]) *reduce()* *E998* |String|、|List|、|Tuple| もしくは |Blob| である {object} の各 要素ごとに {func} を呼ぶ。{func} は2つの引数で呼ばれる: こ @@ -8719,13 +8734,13 @@ reltime({start}, {end}) {|+reltime| 機能付きでコンパイルされたときのみ利用可能} -reltimefloat({time}) *reltimefloat()* +reltimefloat({time}) *reltimefloat()* {time} の値を代わりに浮動小数点で返す。 例: > let start = reltime() call MyFunction() let seconds = reltimefloat(reltime(start)) -< オーバーヘッドについては reltimestr() の note を参照。 +< オーバーヘッドについては |reltimestr()| の note を参照。 |profiling|も参照。 旧来の Vim script ではエラーがあると0.0を返すが、Vim9 script ではエラーとなる。 @@ -8738,7 +8753,7 @@ reltimefloat({time}) *reltimefloat()* {|+reltime| 機能付きでコンパイルされたときのみ利用可能} -reltimestr({time}) *reltimestr()* +reltimestr({time}) *reltimestr()* 時刻値{time}を表現する文字列を返す。秒、ドット、マイクロ秒とい う形式になる。例: > let start = reltime() @@ -8746,9 +8761,9 @@ reltimestr({time}) *reltimestr()* echo reltimestr(reltime(start)) < Note このコマンドにかかるオーバーヘッドがこの時間に加算される。 精度はシステムに依存する。最高の精度 (システムによってはナノ秒) - を得るには、reltimefloat() を使用すること。 + を得るには、|reltimefloat()| を使用すること。 文字列をきれいに揃えるために、先頭にスペースが挿入される。この - スペースを取り除くにはsplit()を使えばよい。 > + スペースを取り除くには |split()| を使えばよい。 > echo split(reltimestr(reltime(start)))[0] < |profiling|も参照。 旧来の Vim script ではエラーがあると空文字列を返すが、Vim9 @@ -8805,9 +8820,9 @@ remote_foreground({server}) *remote_foreground()* < ただし、次の点が異なる: Win32では、OSが必ずしもサーバーが自分 自身をフォアグラウンドにすることを許可しないので、対応策として クライアントが仕事を行う。 - Note: foreground()と違い、最小化されていたウィンドウを復元しな - い。 - |sandbox|の中ではこの関数は利用できない。 + Note: |foreground()| と違い、最小化されていたウィンドウを復元 + しない。 + |sandbox| の中ではこの関数は使用できない。 |method| としても使用できる: > ServerName()->remote_foreground() @@ -8818,7 +8833,7 @@ remote_foreground({server}) *remote_foreground()* 能} -remote_peek({serverid} [, {retvar}]) *remote_peek()* +remote_peek({serverid} [, {retvar}]) *remote_peek()* {serverid}から文字列を取得可能ならば正の数値を返す。変数 {retvar}に返信文字列をコピーする。{retvar}は変数の名前を示す文 字列でなければならない。 @@ -8863,7 +8878,7 @@ remote_send({server}, {string} [, {idvar}]) *remote_send()* *E241* 戻ってくる。Vimサーバーにおいて、受け取ったキー入力はマッピン グ展開されない。|:map| - {idvar} には変数名を指定する。後でremote_read()で使われる + {idvar} には変数名を指定する。後で |remote_read()| で使われる {serverid} がその変数に保存される。 |clientserver| と |RemoteReply| も参照。 @@ -8900,7 +8915,7 @@ remote_startserver({name}) *remote_startserver()* *E941* *E942* {|+clientserver| 機能付きでコンパイルされたときのみ利用可能} -remove({list}, {idx}) *remove()* +remove({list}, {idx}) *remove()* remove({list}, {idx}, {end}) {end}を指定しなかった場合: リスト |List| {list}から{idx}位置の 要素を削除し、その要素を返す。 @@ -8937,6 +8952,7 @@ remove({blob}, {idx}, {end}) < 戻り値の型: |Number| + remove({dict}, {key}) {dict}からキー{key}を持つ要素を削除し、それを返す。例: > :echo "removed " .. remove(dict, "one") @@ -9014,7 +9030,7 @@ reverse({object}) *reverse()* {object} による -round({expr}) *round()* +round({expr}) *round()* {expr} を最も近い整数に丸め、|Float| を返す。{expr} が二つの整 数の真ん中にある場合、大きい方(0 から遠い方)になる。 {訳注: つまり四捨五入になる} @@ -9052,7 +9068,7 @@ rubyeval({expr}) *rubyeval()* {|+ruby| 機能つきでコンパイルされたときのみ有効} -screenattr({row}, {col}) *screenattr()* +screenattr({row}, {col}) *screenattr()* |screenchar()| と同様だが、属性を返す。これは他の位置の属性と 比較するのに利用できるだけの適当な数値である。 行または桁が範囲外の場合は -1 を返す。 @@ -9063,7 +9079,7 @@ screenattr({row}, {col}) *screenattr()* 戻り値の型: |Number| -screenchar({row}, {col}) *screenchar()* +screenchar({row}, {col}) *screenchar()* スクリーン上の位置 [row, col] の文字を数値で返す。これは全ての スクリーン位置、ステータスライン、ウィンドウセパレータ、コマン ドラインで機能する。左上の位置は行番号が1、列番号が1である。文 @@ -9078,7 +9094,7 @@ screenchar({row}, {col}) *screenchar()* 戻り値の型: |Number| -screenchars({row}, {col}) *screenchars()* +screenchars({row}, {col}) *screenchars()* 結果は数値のリスト |List|。最初の数値は |screenchar()| が返す 数値と同一。それ以降の数値は基底文字に続く合成文字の数値。 この関数は主にテスト用。 @@ -9090,7 +9106,7 @@ screenchars({row}, {col}) *screenchars()* 戻り値の型: list または list -screencol() *screencol()* +screencol() *screencol()* 現在のカーソルのスクリーン列を数値で返す。一番左の列番号は 1。 この関数は主にテスト用。 @@ -9105,7 +9121,7 @@ screencol() *screencol()* 戻り値の型: |Number| -screenpos({winid}, {lnum}, {col}) *screenpos()* +screenpos({winid}, {lnum}, {col}) *screenpos()* 結果はウィンドウ {winid} のテキスト行のバッファ位置 {lnum} 及 び列 {col} の画面位置を含む辞書。{col} は1ベースのバイトイン デックス。 @@ -9132,7 +9148,7 @@ screenpos({winid}, {lnum}, {col}) *screenpos()* 戻り値の型: dict または dict -screenrow() *screenrow()* +screenrow() *screenrow()* 現在のカーソルのスクリーン行を数値で返す。一番上の行番号は 1。 この関数は主にテスト用。 代用として |winline()| を使う事ができる。 @@ -9142,7 +9158,7 @@ screenrow() *screenrow()* 戻り値の型: |Number| -screenstring({row}, {col}) *screenstring()* +screenstring({row}, {col}) *screenstring()* 結果は文字列で、スクリーンの位置 [row, col] の基底文字と合成文 字全てを含む。 |screenchars()| と似ているが文字を文字列として返す。 @@ -9154,7 +9170,7 @@ screenstring({row}, {col}) *screenstring()* < 戻り値の型: |String| - *search()* + *search()* search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) 正規表現パターン{pattern}を検索する。検索はカーソル位置から開 始する(検索位置を指定するには|cursor()|を使えばよい)。 @@ -9265,7 +9281,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) 戻り値の型: |Number| -searchcount([{options}]) *searchcount()* +searchcount([{options}]) *searchcount()* 最後の検索数の取得もしくは更新をする。'shortmess' で "S" 無し で表示されるのと同等の結果が得られる。'shortmess' で "S" あり の場合でも動作する。 @@ -9393,7 +9409,7 @@ searchcount([{options}]) *searchcount()* 戻り値の型: dict -searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* +searchdecl({name} [, {global} [, {thisblock}]]) *searchdecl()* {name}の宣言を検索する。 {global}が0でないときは|gD|と同じようにファイル中の最初のマッ @@ -9552,7 +9568,7 @@ server2client({clientid}, {string}) *server2client()* 戻り値の型: |Number| -serverlist() *serverlist()* +serverlist() *serverlist()* 利用可能なサーバー名のリストを返す。1行に1つの形式。 サーバーが1つもないとき、または情報を取得できないときは空文字 列を返す。|clientserver|も参照。 @@ -9670,20 +9686,20 @@ setcharpos({expr}, {list}) *setcharpos()* setcharsearch({dict}) *setcharsearch()* - 現在の文字検索の情報を{dict}に設定する。 + 現在の文字検索の情報を {dict} に設定する。 この辞書は下記のエントリを1以上持つ: - char 続いて起こる|,|や|;|コマンドで使われる文字。 + char 続いて起こる |,| や |;| コマンドで使われる文字。 空文字列の場合、文字検索を解除する。 - forward 文字検索の方向。1は前方、0は後方。 - until 文字検索の種類。1は|t|もしくは|T|の文字検索、0は - |f|もしくは|F|の文字検索。 + forward 文字検索の方向。1 は前方、0 は後方。 + until 文字検索の種類。1 は |t| もしくは |T| の文字検 + 索、0 は |f| もしくは |F| の文字検索。 これはユーザーの文字検索のセーブ/リストアを使うことができる: > :let prevsearch = getcharsearch() :" ユーザーの検索に影響を与えるコマンドを実行する。 :call setcharsearch(prevsearch) -< |getcharsearch()|も参照。 +< |getcharsearch()| も参照。 |method| としても使用できる: > SavedSearch()->setcharsearch() @@ -9691,7 +9707,7 @@ setcharsearch({dict}) *setcharsearch()* 戻り値の型: dict -setcmdline({str} [, {pos}]) *setcmdline()* +setcmdline({str} [, {pos}]) *setcmdline()* コマンドラインを {str} に設定し、カーソル位置を {pos} に設定す る。 {pos} を省略した場合、カーソルはテキストの後に配置される。 @@ -9745,7 +9761,7 @@ setcursorcharpos({list}) 戻り値の型: |Number| -setenv({name}, {val}) *setenv()* +setenv({name}, {val}) *setenv()* 環境変数{name} に {val} を設定する。例: > call setenv('HOME', '/home/myhome') @@ -9817,7 +9833,7 @@ setline({lnum}, {text}) *setline()* 戻り値の型: |Number| -setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()* +setloclist({nr}, {list} [, {action} [, {what}]]) *setloclist()* ウィンドウ{nr}のlocationリストを作成・置き換え・追加する。 {nr} にはウィンドウ番号または|window-ID|が使える。 {nr}が0のときはカレントウィンドウを対象にする。 @@ -10020,7 +10036,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* 戻り値の型: |Number| -setreg({regname}, {value} [, {options}]) *setreg()* +setreg({regname}, {value} [, {options}]) *setreg()* レジスタ{regname}に{value}をセットする。 {regname} が "" もしくは "@" のとき、無名レジスタ '"' を使う。 引数 {regname} は文字列。|Vim9-script| では {regname} は1文字 @@ -10225,7 +10241,7 @@ shellescape({string} [, {special}]) *shellescape()* 戻り値の型: |String| -shiftwidth([{col}]) *shiftwidth()* +shiftwidth([{col}]) *shiftwidth()* 実際に使用される 'shiftwidth' の値を返す。'shiftwidth' がゼロ 以外の場合はその値が返る。ゼロの場合は 'tabstop' の値が返る。 この関数は2012年のパッチ 7.3.694 で導入されたので、現在では皆 @@ -10378,8 +10394,8 @@ sort({list} [, {how} [, {dict}]]) *sort()* *E702* return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1 endfunc eval mylist->sort("MyCompare") -< この例の場合、より短く次のように書くことができる。ただしオーバー - フローは無視される: > +< この例の場合、より短く次のように書くことができる。ただしオー + バーフローは無視される: > func MyCompare(i1, i2) return a:i1 - a:i2 endfunc @@ -10399,8 +10415,8 @@ sound_clear() *sound_clear()* {|+sound| 機能つきでコンパイルされたときのみ有効} - *sound_playevent()* -sound_playevent({name} [, {callback}]) + +sound_playevent({name} [, {callback}]) *sound_playevent()* {name} で識別されるサウンドを再生する。サポートされているイベ ント名はシステムによって異なる。XDGのサウンド名がよく使われる。 Ubuntuでは、それらは /usr/share/sounds/freedesktop/stereo に見 @@ -10437,8 +10453,8 @@ sound_playevent({name} [, {callback}]) {|+sound| 機能つきでコンパイルされたときのみ有効} - *sound_playfile()* -sound_playfile({name} [, {callback}]) + +sound_playfile({path} [, {callback}]) *sound_playfile()* `sound_playevent()` と似ているが、サウンドファイル {name} を再 生する。{name} はフルパスでなければならない。Ubuntuでは、この コマンドで再生するファイルが見つかるかもしれない: > @@ -10471,8 +10487,8 @@ sound_stop({id}) *sound_stop()* {|+sound| 機能つきでコンパイルされたときのみ有効} - *soundfold()* -soundfold({word}) + +soundfold({word}) *soundfold()* {word} の soundfold 値を返す。カレントウィンドウの 'spelllang' で設定された言語のうち、soundfold に対応している最初の言語が使 用される。'spell' がオンでなければならない。soundfold ができな @@ -10521,13 +10537,13 @@ spellsuggest({word} [, {max} [, {capital}]]) *spellsuggest()* 候補の数の最大値となる。{max}を指定しないと、25個までの候補を 返す。 - {capital}に0でない値を指定すると、先頭が大文字の候補だけを返す。 - これは 'spellcapcheck' とのマッチの後に使う。 + {capital}に0でない値を指定すると、先頭が大文字の候補だけを返 + す。これは 'spellcapcheck' とのマッチの後に使う。 - {word}はスペルの間違った単語で、後に他のテキストが続いてもよい。 - これにより、分割された2つの単語を連結することができる。候補も - また続きのテキストを含んでいるので、これによって行を置き換える - ことができる。 + {word}はスペルの間違った単語で、後に他のテキストが続いてもよ + い。これにより、分割された2つの単語を連結することができる。候 + 補もまた続きのテキストを含んでいるので、これによって行を置き換 + えることができる。 {word}は正しい単語でもよい。すると似た単語が返ってくるだろう。 {word}自身は候補に含まれないが、大文字化されたものが含まれてい @@ -10543,7 +10559,7 @@ spellsuggest({word} [, {max} [, {capital}]]) *spellsuggest()* 戻り値の型: list または list -split({string} [, {pattern} [, {keepempty}]]) *split()* +split({string} [, {pattern} [, {keepempty}]]) *split()* {string}を分割してリスト |List| にする。{pattern}を省略した場 合、または {pattern}が空文字列の場合は、{expr}を空白文字で区 切った各文字列が要素となる。 @@ -10571,6 +10587,7 @@ split({string} [, {pattern} [, {keepempty}]]) *split()* < 戻り値の型: list + sqrt({expr}) *sqrt()* 浮動小数点数 {expr} の非負平方根を |Float| で返す。 {expr} は |Float| または |Number| に評価されなければならない。 @@ -10630,13 +10647,13 @@ state([{what}]) *state()* " 画面はスクロールしていない < これらの文字は状態を示し、大概は何かがビジーであることを示す: - m マッピングの途中、:normalコマンド、feedkeys() または詰 - め込まれたコマンド + m マッピングの途中、:normalコマンド、|feedkeys()| または + 詰め込まれたコマンド o オペレータ待機、例えば |d| の後 a 挿入モード自動補完がアクティブ x 自動コマンド実行中 - w 待機中にブロックされた。例えば、jsonを読む時の - ch_evalexpr(), ch_read() および ch_readraw() + w 待機中にブロックされた。例えば、json を読む時の + |ch_evalexpr()|, |ch_read()| および |ch_readraw()| S SafeState または SafeStateAgain をトリガーしない、例え ば |f| の後やカウント時 c タイマーを含むコールバック呼び出し(再帰呼び出しは @@ -10646,7 +10663,7 @@ state([{what}]) *state()* 戻り値の型: |String| -str2blob({list} [, {options}]) *str2blob()* +str2blob({list} [, {options}]) *str2blob()* {list} 内の文字列リスト内の文字をバイト列に変換して Blob を返 す。 @@ -10682,7 +10699,7 @@ str2blob({list} [, {options}]) *str2blob()* < 戻り値の型: |Blob| -str2float({string} [, {quoted}]) *str2float()* +str2float({string} [, {quoted}]) *str2float()* 文字列 {string} を浮動小数点数に変換する。これは式の中で浮動小 数点数を使っているときと同じように働く (|floating-point-format| を参照)。しかしこちらの方がゆるやかで @@ -10706,7 +10723,7 @@ str2float({string} [, {quoted}]) *str2float()* 戻り値の型: |Float| -str2list({string} [, {utf8}]) *str2list()* +str2list({string} [, {utf8}]) *str2list()* 文字列{string}の各文字を表す数値を含むリストを返す。例: > str2list(" ") returns [32] str2list("ABC") returns [65, 66, 67] @@ -10723,7 +10740,7 @@ str2list({string} [, {utf8}]) *str2list()* 戻り値の型: list -str2nr({string} [, {base} [, {quoted}]]) *str2nr()* +str2nr({string} [, {base} [, {quoted}]]) *str2nr()* 文字列{string}を数値に変換する。 {base}は変換の底。2、8、10、16のいずれか。 {quoted} が与えられ 0 以外の場合、埋め込まれた単一引用符は無視 @@ -10761,7 +10778,7 @@ strcharlen({string}) *strcharlen()* < 戻り値の型: |Number| -strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* +strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* |strpart()| と同様だがバイトのインデックスおよび長さではなく文 字のインデックスおよび長さを使用する。 {skipcc} を省略するかゼロにすると、合成文字は別々にカウントさ @@ -10781,7 +10798,7 @@ strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()* 戻り値の型: |String| -strchars({string} [, {skipcc}]) *strchars()* +strchars({string} [, {skipcc}]) *strchars()* 結果は数値で、文字列 {string} の文字の数を返す。 {skipcc} を省略またはゼロを指定すると、合成文字は別々にカウン トされる。 @@ -10889,7 +10906,7 @@ stridx({haystack}, {needle} [, {start}]) *stridx()* :echo stridx("An Example", "Example") 3 :echo stridx("Starting point", "Start") 0 :echo stridx("Starting point", "start") -1 -< *strstr()* *strchr()* +< *strstr()* *strchr()* stridx()はCの関数strstr()と同じように動作する。{needle}が1文字 のときはstrchr()と同じように動作する。 @@ -10899,7 +10916,7 @@ stridx({haystack}, {needle} [, {start}]) *stridx()* 戻り値の型: |Number| -string({expr}) *string()* +string({expr}) *string()* {expr}を文字列に変換して返す。{expr}が数値、浮動小数点数、文字 列、Blob またはそれらの複合の場合は、この戻り値を |eval()| で パースして復元できる。 @@ -10920,7 +10937,7 @@ string({expr}) *string()* |List|、|Tuple| または |Dictionary| に循環参照がある場合、それ らは "[...]" や "(...)" や "{...}" に置き換えられる。その結果 - に対して eval()を使用すると失敗する。 + に対して |eval()| を使用すると失敗する。 オブジェクトに対しては、string() メソッドを呼び出してオブジェ クトのテキスト表現を取得する。メソッドが存在しない場合は、デ @@ -10933,7 +10950,7 @@ string({expr}) *string()* 戻り値の型: |String| -strlen({string}) *strlen()* +strlen({string}) *strlen()* 結果は数値で、文字列{string}のバイト単位での長さ。 引数が数値の場合は、まず文字列に変換される。 それ以外の型の場合はエラーとなり、ゼロが返される。 @@ -10946,7 +10963,7 @@ strlen({string}) *strlen()* 戻り値の型: |Number| -strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* +strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* 結果は文字列で、{src}の{start}番目の文字から始まる、長さ{len} の部分文字列。 引数 {chars} が存在し真であれば {len} は文字の位置の数字 (合成 @@ -10975,7 +10992,7 @@ strpart({src}, {start} [, {len} [, {chars}]]) *strpart()* 戻り値の型: |String| -strptime({format}, {timestring}) *strptime()* +strptime({format}, {timestring}) *strptime()* 結果は数値で、{format} で指定した書式に一致する {timestring} が 表す日付と時刻の unix タイムスタンプを返す。 @@ -11005,7 +11022,7 @@ strptime({format}, {timestring}) *strptime()* 戻り値の型: |Number| -strridx({haystack}, {needle} [, {start}]) *strridx()* +strridx({haystack}, {needle} [, {start}]) *strridx()* 結果は数値で、{haystack}の中で文字列{needle}が最後に現れる位置 のバイトインデックスとなる。 {start}を指定すると、そのインデックス以降でのマッチは無視され @@ -11081,8 +11098,8 @@ strwidth({string}) *strwidth()* 戻り値の型: |Number| -submatch({nr} [, {list}]) *submatch()* *E935* - |:substitute| や substitute() 関数の中の式でのみ使われる。 +submatch({nr} [, {list}]) *submatch()* *E935* + |:substitute| や |substitute()| 関数の中の式でのみ使われる。 マッチしたテキストの{nr} 番目の部分マッチを返す。{nr}が0のとき はマッチしたテキスト全体を返す。 Note: 文字列中の NL 文字は複数行マッチにおける改行文字か、NUL @@ -11096,8 +11113,8 @@ submatch({nr} [, {list}]) *submatch()* *E935* |substitute()| では、実際の改行はそこにはないので、リストは常 に 0 または 1 つの要素である。 - substitute() が再帰的に使用された場合、現在の(最も深い)サブ - マッチのみが取得できる。 + |substitute()| が再帰的に使用された場合、現在の(最も深い)サ + ブマッチのみが取得できる。 エラーの場合は空の文字列かリストを返す。 @@ -11250,8 +11267,8 @@ synIDattr({synID}, {what} [, {mode}]) "term" が指定できる。{mode}が省略されるか、無効な値が指定され た場合、現在有効になっているハイライトモードが使用される (GUI、 cterm、termのどれか)。 - ハイライトグループにリンクされた属性を取得するにはsynIDtrans() - を使用する。 + ハイライトグループにリンクされた属性を取得するには + |synIDtrans()| を使用する。 {what} 結果 "name" 構文アイテムの名前 "fg" 前景色(GUI:カラー名、cterm:文字列としてのカ @@ -11439,16 +11456,16 @@ systemlist({expr} [, {input}]) *systemlist()* tabpagebuflist([{arg}]) *tabpagebuflist()* カレントタブページ内の各ウィンドウに表示されているバッファの番 - 号を要素とするリスト|List|を返す。{arg}は対象とするタブページ - の番号を指定する。省略したときはカレントタブページを対象とする。 - {arg}が無効なときは数値0を返す。 + 号を要素とする |List| を返す。{arg} は対象とするタブページの番 + 号を指定する。省略したときはカレントタブページを対象とする。 + {arg} が無効なときは数値 0 を返す。 全タブページ中の全バッファのリストを得るには次のようにする: > let buflist = [] for i in range(tabpagenr('$')) call extend(buflist, tabpagebuflist(i + 1)) endfor -< Note 1つのバッファが複数のウィンドウに表示されている場合がある - ことに注意。 +< Note 1 つのバッファが複数のウィンドウに表示されている場合があ + ることに注意。 |method| としても使用できる: > GetTabpage()->tabpagebuflist() @@ -11493,14 +11510,14 @@ tabpagewinnr({tabarg} [, {arg}]) *tabpagewinnr()* tagfiles() *tagfiles()* カレントバッファにおいて、タグを検索するときに使うファイルの名 - 前からなるリスト|List|を返す。オプション 'tags' を展開したもので - ある。 + 前からなる |List| を返す。'tags' オプションを展開したものであ + る。 戻り値の型: list または list taglist({expr} [, {filename}]) *taglist()* - 正規表現 {expr} にマッチするタグのリスト |List| を返す。 + 正規表現 {expr} にマッチするタグの |List| を返す。 {filename} が渡された場合、|:tselect| と同じ方法で結果を優先順 位付けするために使われる。|tag-priority| を参照。 @@ -11512,18 +11529,18 @@ taglist({expr} [, {filename}]) *taglist()* トディレクトリからの相対パス、またはフ ルパスである。 cmd そのファイルの中でタグの位置を特定する - ために使うexコマンド。 + ために使う Ex コマンド。 kind タグの種類。種類は言語に依存する。この - 要素は、Universal/Exuberant ctagsか - hdrtagによって生成されたタグファイルを - 使っているときのみ使用できる。 + 要素は、Universal/Exuberant ctags か + hdrtag によって生成されたタグファイル + を使っているときのみ使用できる。 static ファイル固有のタグ。より詳しくは - |static-tag|を参照。 - タグファイルの内容によってはこれ以上の要素が存在することもある。 - 例: アクセス、実装、継承、シグネチャ。これらのフィールドについ - ての情報はctagsのドキュメントを参照。Cのソースにおいては、 - フィールド "struct"、"class"、"enum" が現れることがある。これ - らは、タグを含んでいるものの名前を示す。 + |static-tag| を参照。 + タグファイルの内容によってはこれ以上の要素が存在することもあ + る。例: アクセス、実装、継承、シグネチャ。これらのフィールドに + ついての情報は ctags のドキュメントを参照。C のソースにおいて + は、フィールド "struct"、"class"、"enum" が現れることがある。 + これらは、タグを含んでいるものの名前を示す。 exコマンド "cmd" は検索パターンか、行番号か、行番号とバイト番 号のいずれかである。 @@ -11637,8 +11654,7 @@ terminalprops() *terminalprops()* test_ 関数群はここに文書化されている: |test-functions-details| - *timer_info()* -timer_info([{id}]) +timer_info([{id}]) *timer_info()* タイマーに関する情報のリストを返す。 {id} が指定された場合はそのタイマーに関する情報だけが返され る。タイマー {id} が存在しない場合は空のリストが返される。 @@ -11730,9 +11746,9 @@ timer_start({time}, {callback} [, {options}]) timer_stop({timer}) *timer_stop()* タイマーを停止する。タイマーのコールバックは以降呼び出されな - い。{timer} は timer_start() が返した ID である。よって数値で - なければならない。{timer} が存在しなかった場合でもエラーは発生 - しない。 + い。{timer} は |timer_start()| が返した ID である。よって数値 + でなければならない。{timer} が存在しなかった場合でもエラーは発 + 生しない。 |method| としても使用できる: > GetTimer()->timer_stop() @@ -11795,7 +11811,7 @@ tr({src}, {fromstr}, {tostr}) *tr()* 戻り値の型: |String| -trim({text} [, {mask} [, {dir}]]) *trim()* +trim({text} [, {mask} [, {dir}]]) *trim()* {text} の先頭と/もしくは末尾から、{mask} 内のすべての文字を取 り除いた文字列を返す。 @@ -11828,7 +11844,7 @@ trim({text} [, {mask} [, {dir}]]) *trim()* 戻り値の型: |String| -trunc({expr}) *trunc()* +trunc({expr}) *trunc()* {expr} をゼロ方向に切りつめた整数を |Float| で返す。 {expr} は |Float| または |Number| に評価されなければならない。 {expr} が |Float| または |Number| でない場合は 0.0 を返す。 @@ -11864,8 +11880,8 @@ tuple2list({tuple}) *tuple2list()* 戻り値の型: list<{type}> (指定された |Tuple| による) - *type()* -type({expr}) {expr}の型を示す数値を返す。 +type({expr}) *type()* + {expr} の型を示す数値を返す。 マジックナンバーを使わずに、v:t_ 変数を使う方が良い。それぞれ の値は以下の通り: 数値: 0 |v:t_number| @@ -12017,6 +12033,7 @@ uri_decode({string}) *uri_decode()* < 戻り値の型: |String| + uri_encode({string}) *uri_encode()* {string} の URI エンコード形式を返す。URI エンコードでは、安全 でない文字や予約文字がパーセントエンコードされたシーケンスに置 @@ -12044,8 +12061,8 @@ uri_encode({string}) *uri_encode()* < 戻り値の型: |String| - *utf16idx()* -utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) + +utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) *utf16idx()* |charidx()| と同じだが、{string} の {idx} にあるバイトの UTF-16 コード単位インデックスを返す (UTF-16 に変換後)。 @@ -12166,7 +12183,7 @@ virtcol2col({winid}, {lnum}, {col}) *virtcol2col()* 戻り値の型: |Number| -visualmode([{expr}]) *visualmode()* +visualmode([{expr}]) *visualmode()* 結果は文字列で、カレントバッファ内で最後に使われたビジュアル モードを教えてくれる。初期状態では単に空文字列を返すだけだが、 一度でもビジュアルモードが使われた場合、その種類によって "v" @@ -12186,7 +12203,7 @@ visualmode([{expr}]) *visualmode()* 戻り値の型: |String| -wildmenumode() *wildmenumode()* +wildmenumode() *wildmenumode()* wildmenuが有効な場合は|TRUE|を返し、そうでなければ|FALSE|を返 す。'wildmenu' と 'wildmode' を参照。 マッピングの中で 'wildcharm' オプションを有効に扱うために使用 @@ -12409,8 +12426,8 @@ win_splitmove({nr}, {target} [, {options}]) *win_splitmove()* 戻り値の型: |Number| - *winbufnr()* -winbufnr({nr}) 結果は数値で、{nr}番目のウィンドウに関連付けられているバッファ +winbufnr({nr}) *winbufnr()* + 結果は数値で、{nr}番目のウィンドウに関連付けられているバッファ の番号。{nr} にはウィンドウ番号または|window-ID|が使える。 {nr}が0の場合、現在のウィンドウに関連付けられているバッファの 番号が返る。{nr}で存在しないウィンドウを指定した場合には-1が返 @@ -12424,22 +12441,22 @@ winbufnr({nr}) 結果は数値で、{nr}番目のウィンドウに関連付け 戻り値の型: |Number| - *wincol()* -wincol() 結果は数値で、ウィンドウの中でカーソルがある位置の仮想桁番号を +wincol() *wincol()* + 結果は数値で、ウィンドウの中でカーソルがある位置の仮想桁番号を 表す。これはウィンドウの左側から数えたスクリーン上の桁である。 一番左の桁は1となる。 戻り値の型: |Number| - *windowsversion()* -windowsversion() +windowsversion() *windowsversion()* 文字列を返す。MS-Windows では OS のバージョンを示す。例えば、 Windows 10 は "10.0"、Windows 8 は "6.2"、Windows XP は "5.1" である。MS-Windows 以外のシステムでは、結果は空文字列である。 戻り値の型: |String| + winheight({nr}) *winheight()* 結果は数値で、{nr}で示されるウィンドウの高さ(行数)を示す。 {nr} にはウィンドウ番号または|window-ID|が使える。 @@ -12491,7 +12508,7 @@ winlayout([{tabnr}]) *winlayout()* 戻り値の型: list -winline() *winline()* +winline() *winline()* 結果は数値で、ウィンドウの最上行から数えた行番号を返す。ウィン ドウでの最上行が1となる。 カーソルが移動するとファイルの表示が更新され、それによってスク @@ -12500,7 +12517,7 @@ winline() *winline()* 戻り値の型: |Number| -winnr([{arg}]) *winnr()* +winnr([{arg}]) *winnr()* 結果は現在のウィンドウを示す数値。最上位のウィンドウは1であ る。ポップアップウィンドウは0を返す。 @@ -12533,7 +12550,7 @@ winnr([{arg}]) *winnr()* 戻り値の型: |Number| -winrestcmd() *winrestcmd()* +winrestcmd() *winrestcmd()* 現在のウィンドウサイズを復元するための一連の|:resize|コマンド を返す。これが返すコマンドは、ウィンドウを開閉せず、カレント ウィンドウとカレントタブページが変更されていないときのみ正しく @@ -12546,7 +12563,7 @@ winrestcmd() *winrestcmd()* 戻り値の型: |String| -winrestview({dict}) *winrestview()* +winrestview({dict}) *winrestview()* |winsaveview()|が返す辞書|Dictionary|を使ってカレントウィンド ウの表示状態を復元する。 Note: {dict} は |winsaveview()| の戻り値に含まれる値をすべて @@ -12569,7 +12586,7 @@ winrestview({dict}) *winrestview()* 戻り値の型: |Number| -winsaveview() *winsaveview()* +winsaveview() *winsaveview()* カレントウィンドウの表示状態を復元するための情報を持つ辞書 |Dictionary|を返す。この表示状態を復元するには|winrestview()| を使う。 @@ -12617,8 +12634,8 @@ winwidth({nr}) *winwidth()* wordcount() *wordcount()* - この結果は現在のバッファのバイト/文字/単語統計情報の辞書である。 - これは|g_CTRL-G|が提供する情報と同じである。 + この結果は現在のバッファのバイト/文字/単語統計情報の辞書であ + る。これは |g_CTRL-G| が提供する情報と同じである。 この値には下記が含まれる: bytes バッファ内のバイト数 chars バッファ内の文字数 @@ -12639,7 +12656,7 @@ wordcount() *wordcount()* 戻り値の型: dict -writefile({object}, {fname} [, {flags}]) *writefile()* +writefile({object}, {fname} [, {flags}]) *writefile()* {object}が |List| の場合、それをファイル{fname}に書き込む。リ ストの各要素は改行文字(NL)で区切られる。各要素は文字列か数値で なければならない。 @@ -12725,8 +12742,8 @@ xor({expr}, {expr}) *xor()* とを確認する): > :if v:version > 602 || (v:version == 602 && has("patch148")) -ヒント: Vim がファイル名(MS-Windows)でバックスラッシュをサポートしているかどうか -を調べるには `if exists('+shellslash')` を使用する。 +ヒント: Vim がファイル名 (MS-Windows) でバックスラッシュをサポートしているかど +うかを調べるには `if exists('+shellslash')` を使用する。 acl |ACL| をサポート @@ -12741,7 +12758,7 @@ autoservername |clientserver| を自動的に有効化する balloon_eval |balloon-eval| をサポート balloon_multiline 複数行バルーンをサポート beos BeOSバージョン -browse |:browse|をサポートし、browse()が動作する +browse |:browse|をサポートし、|browse()| が動作する browsefilter |browsefilter| をサポート bsd BSDファミリのOSでコンパイルされている (macOS を除く) builtin_terms 幾つかの組込みターミナルが有効。(常に true) @@ -12750,6 +12767,7 @@ channel |channel| プロセス間通信と |job| ジョブをサポート cindent 'cindent' をサポート。(常に true) clientserver リモート呼び出しをサポート |clientserver| clipboard 'clipboard' をサポート +clipboard_provider |clipboard-providers| をサポート clipboard_working 'clipboard' をサポートし、使用可能 cmdline_compl |cmdline-completion| コマンドライン補完をサポート cmdline_hist |cmdline-history| コマンドライン履歴をサポート @@ -12869,7 +12887,8 @@ python3_dynamic Python 3.x インターフェイスが動的にロードされ |has-python| python3_stable Python 3.x インターフェイスは Python Stable ABI を使 用。 |has-python| -pythonx Python 2.x と/もしくは Python 3.x インターフェイスが使用可能。|python_x| +pythonx Python 2.x および/または Python 3.x インターフェイスが + 使用可能。|python_x| qnx QNXバージョン quickfix |quickfix|をサポート reltime |reltime()|をサポート diff --git a/en/builtin.txt b/en/builtin.txt index 46450685a..7389a86b9 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Oct 01 +*builtin.txt* For Vim version 9.1. Last change: 2025 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -797,7 +797,7 @@ Not all functions are here, some have been moved to a help file covering the specific functionality. Return type specifies the type for |Vim9-script|, see |vim9-types| -abs({expr}) *abs()* +abs({expr}) *abs()* Return the absolute value of {expr}. When {expr} evaluates to a |Float| abs() returns a |Float|. When {expr} can be converted to a |Number| abs() returns a |Number|. Otherwise @@ -816,7 +816,7 @@ abs({expr}) *abs()* Return type: |Number| or |Float| depending on {expr} -acos({expr}) *acos()* +acos({expr}) *acos()* Return the arc cosine of {expr} measured in radians, as a |Float| in the range of [0, pi]. {expr} must evaluate to a |Float| or a |Number| in the range @@ -854,7 +854,7 @@ add({object}, {expr}) *add()* and({expr}, {expr}) *and()* Bitwise AND on the two arguments. The arguments are converted to a number. A List, Dict or Float argument causes an error. - Also see `or()` and `xor()`. + Also see |or()| and |xor()|. Example: > :let flag = and(bits, 0x80) < Can also be used as a |method|: > @@ -889,7 +889,7 @@ append({lnum}, {text}) *append()* appendbufline({buf}, {lnum}, {text}) *appendbufline()* Like |append()| but append the text in buffer {buf}. - This function works only for loaded buffers. First call + This function works only for loaded buffers. First call |bufload()| if needed. For the use of {buf}, see |bufname()|. @@ -903,7 +903,7 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()* In |Vim9| script an error is given for an invalid {lnum}. If {buf} is not a valid buffer or {lnum} is not valid, an - error message is given. Example: > + error message is given. Example: > :let failed = appendbufline(13, 0, "# THE START") < However, when {text} is an empty list then no error is given for an invalid {lnum}, since {lnum} isn't actually used. @@ -915,7 +915,7 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()* Return type: |Number| -argc([{winid}]) *argc()* +argc([{winid}]) *argc()* The result is the number of files in the argument list. See |arglist|. If {winid} is not supplied, the argument list of the current @@ -927,14 +927,15 @@ argc([{winid}]) *argc()* Return type: |Number| - *argidx()* -argidx() The result is the current index in the argument list. 0 is - the first file. argc() - 1 is the last one. See |arglist|. + +argidx() *argidx()* + The result is the current index in the argument list. 0 is + the first file. |argc()| - 1 is the last one. See |arglist|. Return type: |Number| - *arglistid()* -arglistid([{winnr} [, {tabnr}]]) + +arglistid([{winnr} [, {tabnr}]]) *arglistid()* Return the argument list ID. This is a number which identifies the argument list being used. Zero is used for the global argument list. See |arglist|. @@ -948,8 +949,8 @@ arglistid([{winnr} [, {tabnr}]]) Return type: |Number| - *argv()* -argv([{nr} [, {winid}]]) + +argv([{nr} [, {winid}]]) *argv()* The result is the {nr}th file in the argument list. See |arglist|. "argv(0)" is the first one. Example: > :let i = 0 @@ -1036,19 +1037,19 @@ autocmd_add({acmds}) *autocmd_add()* If this item is specified, then the "pattern" item is ignored. cmd Ex command to execute for this autocmd event - event autocmd event name. Refer to |autocmd-events|. + event autocmd event name. Refer to |autocmd-events|. This can be either a String with a single event name or a List of event names. - group autocmd group name. Refer to |autocmd-groups|. + group autocmd group name. Refer to |autocmd-groups|. If this group doesn't exist then it is created. If not specified or empty, then the default group is used. nested boolean flag, set to v:true to add a nested autocmd. Refer to |autocmd-nested|. once boolean flag, set to v:true to add an autocmd - which executes only once. Refer to + which executes only once. Refer to |autocmd-once|. - pattern autocmd pattern string. Refer to + pattern autocmd pattern string. Refer to |autocmd-patterns|. If "bufnr" item is present, then this item is ignored. This can be a String with a single pattern or a List of @@ -1057,7 +1058,8 @@ autocmd_add({acmds}) *autocmd_add()* commands associated with the specified autocmd event and group and add the {cmd}. This is useful to avoid adding the same command - multiple times for an autocmd event in a group. + multiple times for an autocmd event in a + group. Returns v:true on success and v:false on failure. Examples: > @@ -1080,21 +1082,21 @@ autocmd_delete({acmds}) *autocmd_delete()* The {acmds} argument is a List where each item is a Dict with the following optional items: - bufnr buffer number to delete a buffer-local autocmd. - If this item is specified, then the "pattern" - item is ignored. + bufnr buffer number to delete a buffer-local + autocmd. If this item is specified, then the + "pattern" item is ignored. cmd Ex command for this autocmd event - event autocmd event name. Refer to |autocmd-events|. + event autocmd event name. Refer to |autocmd-events|. If '*' then all the autocmd events in this group are deleted. - group autocmd group name. Refer to |autocmd-groups|. + group autocmd group name. Refer to |autocmd-groups|. If not specified or empty, then the default group is used. nested set to v:true for a nested autocmd. Refer to |autocmd-nested|. once set to v:true for an autocmd which executes - only once. Refer to |autocmd-once|. - pattern autocmd pattern string. Refer to + only once. Refer to |autocmd-once|. + pattern autocmd pattern string. Refer to |autocmd-patterns|. If "bufnr" item is present, then this item is ignored. @@ -1128,22 +1130,22 @@ autocmd_delete({acmds}) *autocmd_delete()* autocmd_get([{opts}]) *autocmd_get()* - Returns a |List| of autocmds. If {opts} is not supplied, then + Returns a |List| of autocmds. If {opts} is not supplied, then returns the autocmds for all the events in all the groups. The optional {opts} Dict argument supports the following items: - group Autocmd group name. If specified, returns only - the autocmds defined in this group. If the - specified group doesn't exist, results in an - error message. If set to an empty string, + group Autocmd group name. If specified, returns + only the autocmds defined in this group. If + the specified group doesn't exist, results in + an error message. If set to an empty string, then the default autocmd group is used. - event Autocmd event name. If specified, returns only - the autocmds defined for this event. If set - to "*", then returns autocmds for all the + event Autocmd event name. If specified, returns + only the autocmds defined for this event. If + set to "*", then returns autocmds for all the events. If the specified event doesn't exist, results in an error message. - pattern Autocmd pattern. If specified, returns only + pattern Autocmd pattern. If specified, returns only the autocmds defined for this pattern. A combination of the above three times can be supplied in {opts}. @@ -1155,11 +1157,12 @@ autocmd_get([{opts}]) *autocmd_get()* event Autocmd event name. group Autocmd group name. nested Boolean flag, set to v:true for a nested - autocmd. See |autocmd-nested|. + autocmd. See |autocmd-nested|. once Boolean flag, set to v:true, if the autocmd - will be executed only once. See |autocmd-once|. + will be executed only once. See |autocmd-once|. pattern Autocmd pattern. For a buffer-local - autocmd, this will be of the form "". + autocmd, this will be of the form + "". If there are multiple commands for an autocmd event in a group, then separate items are returned for each command. @@ -1243,6 +1246,7 @@ balloon_split({msg}) *balloon_split()* Return type: list or list + base64_decode({string}) *base64_decode()* Return a Blob containing the bytes decoded from the base64 encoded characters in {string}. @@ -1291,6 +1295,7 @@ bindtextdomain({package}, {path}) *bindtextdomain()* Return type: |vim9-boolean| + blob2list({blob}) *blob2list()* Return a List containing the number value of each byte in Blob {blob}. Examples: > @@ -1346,8 +1351,7 @@ blob2str({blob} [, {options}]) *blob2str()* Return type: list - *browse()* -browse({save}, {title}, {initdir}, {default}) +browse({save}, {title}, {initdir}, {default}) *browse()* Put up a file requester. This only works when "has("browse")" returns |TRUE| (only in some GUI versions). The input fields are: @@ -1510,7 +1514,7 @@ bufnr([{buf} [, {create}]]) *bufnr()* {create} argument is present and TRUE, a new, unlisted, buffer is created and its number is returned. Example: > let newbuf = bufnr('Scratch001', 1) -< Using an empty name uses the current buffer. To create a new +< Using an empty name uses the current buffer. To create a new buffer with an empty name use |bufadd()|. bufnr("$") is the last buffer: > @@ -1518,7 +1522,7 @@ bufnr([{buf} [, {create}]]) *bufnr()* < The result is a Number, which is the highest buffer number of existing buffers. Note that not all buffers with a smaller number necessarily exist, because ":bwipeout" may have removed - them. Use bufexists() to test for the existence of a buffer. + them. Use |bufexists()| to test for the existence of a buffer. Can also be used as a |method|: > echo bufref->bufnr() @@ -1579,8 +1583,7 @@ byte2line({byte}) *byte2line()* < Return type: |Number| - {not available when compiled without the |+byte_offset| - feature} + {not available when compiled without the |+byte_offset| feature} byteidx({expr}, {nr} [, {utf16}]) *byteidx()* @@ -1625,7 +1628,7 @@ byteidx({expr}, {nr} [, {utf16}]) *byteidx()* byteidxcomp({expr}, {nr} [, {utf16}]) *byteidxcomp()* - Like byteidx(), except that a composing character is counted + Like |byteidx()|, except that a composing character is counted as a separate character. Example: > let s = 'e' .. nr2char(0x301) echo byteidx(s, 1) @@ -1634,7 +1637,7 @@ byteidxcomp({expr}, {nr} [, {utf16}]) *byteidxcomp()* < The first and third echo result in 3 ('e' plus composing character is 3 bytes), the second echo results in 1 ('e' is one byte). - Only works differently from byteidx() when 'encoding' is set + Only works differently from |byteidx()| when 'encoding' is set to a Unicode encoding. Can also be used as a |method|: > @@ -1658,7 +1661,7 @@ call({func}, {arglist} [, {dict}]) *call()* *E699* Return type: any, depending on {func} -ceil({expr}) *ceil()* +ceil({expr}) *ceil()* Return the smallest integral value greater than or equal to {expr} as a |Float| (round up). {expr} must evaluate to a |Float| or a |Number|. @@ -1693,12 +1696,13 @@ changenr() *changenr()* Return type: |Number| -char2nr({string} [, {utf8}]) *char2nr()* +char2nr({string} [, {utf8}]) *char2nr()* Return Number value of the first char in {string}. Examples: > char2nr(" ") returns 32 char2nr("ABC") returns 65 -< When {utf8} is omitted or zero, the current 'encoding' is used. +< When {utf8} is omitted or zero, the current 'encoding' is + used. Example for "utf-8": > char2nr("á") returns 225 char2nr("á"[0]) returns 195 @@ -1746,8 +1750,8 @@ charcol({expr} [, {winid}]) *charcol()* < Return type: |Number| - *charidx()* -charidx({string}, {idx} [, {countcc} [, {utf16}]]) + +charidx({string}, {idx} [, {countcc} [, {utf16}]]) *charidx()* Return the character index of the byte at {idx} in {string}. The index of the first character is zero. If there are no multibyte characters the returned value is @@ -1763,7 +1767,7 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]]) index in the String {expr} instead of as the byte index. Returns -1 if the arguments are invalid or if there are less - than {idx} bytes. If there are exactly {idx} bytes the length + than {idx} bytes. If there are exactly {idx} bytes the length of the string in characters is returned. An error is given and -1 is returned if the first argument is @@ -1855,7 +1859,7 @@ cmdcomplete_info() *cmdcomplete_info()* completion began. pum_visible |TRUE| if popup menu is visible. See |pumvisible()|. - matches List of all completion candidates. Each item + matches List of all completion candidates. Each item is a string. selected Selected item index. First index is zero. Index is -1 if no item is selected (showing @@ -1877,7 +1881,7 @@ col({expr} [, {winid}]) *col()* When {expr} is "$", it means the end of the cursor line, so the result is the number of bytes in the cursor line plus one. Additionally {expr} can be [lnum, col]: a |List| with the line - and column number. Most useful when the column is "$", to get + and column number. Most useful when the column is "$", to get the last column of a specific line. When "lnum" or "col" is out of range then col() returns zero. @@ -1913,8 +1917,8 @@ col({expr} [, {winid}]) *col()* Return type: |Number| -complete({startcol}, {matches}) *complete()* *E785* - Set the matches for Insert mode completion. Can only be +complete({startcol}, {matches}) *complete()* *E785* + Set the matches for Insert mode completion. Can only be used in Insert mode. Typically invoked from a mapping with CTRL-R = (see |i_CTRL-R|), but may also be called from a || or || mapping. It does not work after @@ -1967,7 +1971,7 @@ complete({startcol}, {matches}) *complete()* *E785* Return type: |Number| -complete_add({expr}) *complete_add()* +complete_add({expr}) *complete_add()* Add {expr} to the list of matches. Only to be used by the function specified with the 'completefunc' option. Returns 0 for failure (empty string or out of memory), @@ -1982,7 +1986,7 @@ complete_add({expr}) *complete_add()* Return type: |Number| -complete_check() *complete_check()* +complete_check() *complete_check()* Check for a key typed while looking for completion matches. This is to be used when looking for matches takes some time. Returns |TRUE| when searching for matches is to be aborted, @@ -1993,7 +1997,7 @@ complete_check() *complete_check()* Return type: |Number| -complete_info([{what}]) *complete_info()* +complete_info([{what}]) *complete_info()* Returns a |Dictionary| with information about Insert mode completion. See |ins-completion|. The items are: @@ -2001,12 +2005,13 @@ complete_info([{what}]) *complete_info()* See |complete_info_mode| for the values. pum_visible |TRUE| if popup menu is visible. See |pumvisible()|. - items List of all completion candidates. Each item + items List of all completion candidates. Each item is a dictionary containing the entries "word", - "abbr", "menu", "kind", "info" and "user_data". + "abbr", "menu", "kind", "info" and + "user_data". See |complete-items|. matches Same as "items", but only returns items that - are matching current query. If both "matches" + are matching current query. If both "matches" and "items" are in "what", the returned list will still be named "items", but each item will have an additional "match" field. @@ -2045,7 +2050,7 @@ complete_info([{what}]) *complete_info()* {what} are silently ignored. To get the position and size of the popup menu, see - |pum_getpos()|. It's also available in |v:event| during the + |pum_getpos()|. It's also available in |v:event| during the |CompleteChanged| event. Returns an empty |Dictionary| on error. @@ -2063,15 +2068,16 @@ complete_info([{what}]) *complete_info()* < Return type: dict -complete_match([{lnum}, {col}]) *complete_match()* + +complete_match([{lnum}, {col}]) *complete_match()* Searches backward from the given position and returns a List - of matches according to the 'isexpand' option. When no + of matches according to the 'isexpand' option. When no arguments are provided, uses the current cursor position. Each match is represented as a List containing [startcol, trigger_text] where: - startcol: column position where completion should start, - or -1 if no trigger position is found. For multi-character + or -1 if no trigger position is found. For multi-character triggers, returns the column of the first character. - trigger_text: the matching trigger string from 'isexpand', or empty string if no match was found or when using the @@ -2107,8 +2113,8 @@ complete_match([{lnum}, {col}]) *complete_match()* < Return type: list> - *confirm()* -confirm({msg} [, {choices} [, {default} [, {type}]]]) + +confirm({msg} [, {choices} [, {default} [, {type}]]]) *confirm()* confirm() offers the user a dialog, from which a choice can be made. It returns the number of the choice. For the first choice this is 1. @@ -2169,7 +2175,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) Return type: |Number| -copy({expr}) *copy()* +copy({expr}) *copy()* Make a copy of {expr}. For Numbers and Strings this isn't different from using {expr} directly. When {expr} is a |List| a shallow copy is created. This means @@ -2228,7 +2234,7 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* When {ic} is given and it's |TRUE| then case is ignored. When {comp} is a string then the number of not overlapping - occurrences of {expr} is returned. Zero is returned when + occurrences of {expr} is returned. Zero is returned when {expr} is an empty string. Can also be used as a |method|: > @@ -2236,8 +2242,8 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* *E706* < Return type: |Number| - *cscope_connection()* -cscope_connection([{num} , {dbpath} [, {prepend}]]) + +cscope_connection([{num} , {dbpath} [, {prepend}]]) *cscope_connection()* Checks for the existence of a |cscope| connection. If no parameters are specified, then the function returns: 0, if cscope was not available (not compiled in), or @@ -2322,7 +2328,7 @@ cursor({list}) debugbreak({pid}) *debugbreak()* Specifically used to interrupt a program being debugged. It will cause process {pid} to get a SIGTRAP. Behavior for other - processes is undefined. See |terminal-debugger|. + processes is undefined. See |terminal-debugger|. {only available on MS-Windows} Returns |TRUE| if successfully interrupted the program. @@ -2351,7 +2357,7 @@ deepcopy({expr} [, {noref}]) *deepcopy()* *E698* this single copy. With {noref} set to 1 every occurrence of a |List| or |Dictionary| results in a new copy. This also means that a cyclic reference causes deepcopy() to fail. - *E724* + *E724* Nesting is possible up to 100 levels. When there is an item that refers back to a higher level making a deep copy with {noref} set to 1 will fail. @@ -2397,13 +2403,13 @@ deletebufline({buf}, {first} [, {last}]) *deletebufline()* If {last} is omitted then delete line {first} only. On success 0 is returned, on failure 1 is returned. - This function works only for loaded buffers. First call + This function works only for loaded buffers. First call |bufload()| if needed. For the use of {buf}, see |bufname()| above. - {first} and {last} are used like with |getline()|. Note that - when using |line()| this refers to the current buffer. Use "$" + {first} and {last} are used like with |getline()|. Note that + when using |line()| this refers to the current buffer. Use "$" to refer to the last line in buffer {buf}. Can also be used as a |method|: > @@ -2411,8 +2417,9 @@ deletebufline({buf}, {first} [, {last}]) *deletebufline()* < Return type: |Number| - *did_filetype()* -did_filetype() Returns |TRUE| when autocommands are being executed and the + +did_filetype() *did_filetype()* + Returns |TRUE| when autocommands are being executed and the FileType event has been triggered at least once. Can be used to avoid triggering the FileType event again in the scripts that detect the file type. |FileType| @@ -2640,7 +2647,7 @@ digraph_setlist({digraphlist}) *digraph_setlist()* echoraw({string}) *echoraw()* Output {string} as-is, including unprintable characters. - This can be used to output a terminal code. For example, to + This can be used to output a terminal code. For example, to disable modifyOtherKeys: > call echoraw(&t_TE) < and to enable it again: > @@ -2673,7 +2680,7 @@ empty({expr}) *empty()* environ() *environ()* - Return all of environment variables as dictionary. You can + Return all of environment variables as dictionary. You can check if an environment variable exists like this: > :echo has_key(environ(), 'HOME') < Note that the variable name may be CamelCase; to ignore case @@ -2706,8 +2713,9 @@ escape({string}, {chars}) *escape()* < Return type: |String| - *eval()* -eval({string}) Evaluate {string} and return the result. Especially useful to + +eval({string}) *eval()* + Evaluate {string} and return the result. Especially useful to turn the result of |string()| back into the original value. This works for Numbers, Floats, Strings, Blobs and composites of them. Also works for |Funcref|s that refer to existing @@ -2766,7 +2774,7 @@ executable({expr}) *executable()* Return type: |Number| -execute({command} [, {silent}]) *execute()* +execute({command} [, {silent}]) *execute()* Execute an Ex command or commands and return the output as a string. {command} can be a string or a List. In case of a List the @@ -2817,7 +2825,7 @@ exepath({expr}) *exepath()* Return type: |String| -exists({expr}) *exists()* +exists({expr}) *exists()* The result is a Number, which is |TRUE| if {expr} is defined, zero otherwise. @@ -2942,7 +2950,7 @@ exists_compiled({expr}) *exists_compiled()* Return type: |String| -exp({expr}) *exp()* +exp({expr}) *exp()* Return the exponential of {expr} as a |Float| in the range [0, inf]. {expr} must evaluate to a |Float| or a |Number|. @@ -2959,7 +2967,7 @@ exp({expr}) *exp()* Return type: |Float| -expand({string} [, {nosuf} [, {list}]]) *expand()* +expand({string} [, {nosuf} [, {list}]]) *expand()* Expand wildcards and the following special keywords in {string}. 'wildignorecase' applies. @@ -3090,6 +3098,7 @@ expandcmd({string} [, {options}]) *expandcmd()* < Return type: |String| or list depending on {list} + extend({expr1}, {expr2} [, {expr3}]) *extend()* {expr1} and {expr2} must be both |Lists| or both |Dictionaries|. @@ -3157,21 +3166,21 @@ feedkeys({string} [, {mode}]) *feedkeys()* {string}. To include special keys into {string}, use double-quotes - and "\..." notation |expr-quote|. For example, - feedkeys("\") simulates pressing of the key. But + and "\..." notation |expr-quote|. For example, + feedkeys("\") simulates pressing of the key. But feedkeys('\') pushes 5 characters. A special code that might be useful is , it exits the wait for a character without doing anything. ** {mode} is a String, which can contain these character flags: - 'm' Remap keys. This is default. If {mode} is absent, + 'm' Remap keys. This is default. If {mode} is absent, keys are remapped. 'n' Do not remap keys. 't' Handle keys as if typed; otherwise they are handled as if coming from a mapping. This matters for undo, opening folds, etc. 'L' Lowlevel input. Only works for Unix or when using the - GUI. Keys are used as if they were coming from the + GUI. Keys are used as if they were coming from the terminal. Other flags are not used. *E980* When a CTRL-C interrupts and 't' is included it sets the internal "got_int" flag. @@ -3191,7 +3200,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* legacy script syntax applies, "s:var" does not work, etc. Note that if the string being fed sets a script context this still applies. - '!' When used with 'x' will not end Insert mode. Can be + '!' When used with 'x' will not end Insert mode. Can be used in a test when a timer is set to exit Insert mode a little later. Useful for testing CursorHoldI. @@ -3204,7 +3213,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* filecopy({from}, {to}) *filecopy()* - Copy the file pointed to by the name {from} to {to}. The + Copy the file pointed to by the name {from} to {to}. The result is a Number, which is |TRUE| if the file was copied successfully, and |FALSE| when it failed. If a file with name {to} already exists, it will fail. @@ -3265,7 +3274,7 @@ filter({expr1}, {expr2}) *filter()* of the current item. For a |Dictionary| |v:key| has the key of the current item and for a |List| |v:key| has the index of the current item. For a |Blob| |v:key| has the index of the - current byte. For a |String| |v:key| has the index of the + current byte. For a |String| |v:key| has the index of the current character. Examples: > call filter(mylist, 'v:val !~ "OLD"') @@ -3307,8 +3316,8 @@ filter({expr1}, {expr2}) *filter()* or a new |Blob| or |String|. When an error is encountered while evaluating {expr2} no further items in {expr1} are processed. - When {expr2} is a Funcref errors inside a function are ignored, - unless it was defined with the "abort" flag. + When {expr2} is a Funcref errors inside a function are + ignored, unless it was defined with the "abort" flag. Can also be used as a |method|: > mylist->filter(expr2) @@ -3317,7 +3326,7 @@ filter({expr1}, {expr2}) *filter()* depending on {expr1} -finddir({name} [, {path} [, {count}]]) *finddir()* +finddir({name} [, {path} [, {count}]]) *finddir()* Find directory {name} in {path}. Supports both downwards and upwards recursive directory searches. See |file-searching| for the syntax of {path}. @@ -3342,7 +3351,7 @@ finddir({name} [, {path} [, {count}]]) *finddir()* otherwise -findfile({name} [, {path} [, {count}]]) *findfile()* +findfile({name} [, {path} [, {count}]]) *findfile()* Just like |finddir()|, but find a file instead of a directory. Uses 'suffixesadd'. Example: > @@ -3357,7 +3366,7 @@ findfile({name} [, {path} [, {count}]]) *findfile()* otherwise -flatten({list} [, {maxdepth}]) *flatten()* +flatten({list} [, {maxdepth}]) *flatten()* Flatten {list} up to {maxdepth} levels. Without {maxdepth} the result is a |List| without nesting, as if {maxdepth} is a very large number. @@ -3365,7 +3374,7 @@ flatten({list} [, {maxdepth}]) *flatten()* not want that. In Vim9 script flatten() cannot be used, you must always use |flattennew()|. - *E900* + *E900* {maxdepth} means how deep in nested lists changes are made. {list} is not modified when {maxdepth} is 0. {maxdepth} must be positive number. @@ -3418,7 +3427,7 @@ float2nr({expr}) *float2nr()* Return type: |Number| -floor({expr}) *floor()* +floor({expr}) *floor()* Return the largest integral value less than or equal to {expr} as a |Float| (round down). {expr} must evaluate to a |Float| or a |Number|. @@ -3547,8 +3556,9 @@ foldlevel({lnum}) *foldlevel()* < Return type: |Number| - *foldtext()* -foldtext() Returns a String, to be displayed for a closed fold. This is + +foldtext() *foldtext()* + Returns a String, to be displayed for a closed fold. This is the default function used for the 'foldtext' option and should only be called from evaluating 'foldtext'. It uses the |v:foldstart|, |v:foldend| and |v:folddashes| variables. @@ -3588,7 +3598,7 @@ foldtextresult({lnum}) *foldtextresult()* foreach({expr1}, {expr2}) *foreach()* *E1525* {expr1} must be a |List|, |Tuple|, |String|, |Blob| or |Dictionary|. - For each item in {expr1} execute {expr2}. {expr1} is not + For each item in {expr1} execute {expr2}. {expr1} is not modified; its values may be, as with |:lockvar| 1. |E741| See |map()| and |filter()| to modify {expr1}. @@ -3598,7 +3608,7 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* of the current item. For a |Dictionary| |v:key| has the key of the current item and for a |List| or a |Tuple| |v:key| has the index of the current item. For a |Blob| |v:key| has the - index of the current byte. For a |String| |v:key| has the + index of the current byte. For a |String| |v:key| has the index of the current character. Examples: > call foreach(mylist, 'used[v:val] = true') @@ -3619,8 +3629,8 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* Returns {expr1} in all cases. When an error is encountered while executing {expr2} no further items in {expr1} are processed. - When {expr2} is a Funcref errors inside a function are ignored, - unless it was defined with the "abort" flag. + When {expr2} is a Funcref errors inside a function are + ignored, unless it was defined with the "abort" flag. Can also be used as a |method|: > mylist->foreach(expr2) @@ -3628,8 +3638,9 @@ foreach({expr1}, {expr2}) *foreach()* *E1525* Return type: |String|, |Blob|, list<{type}>, tuple<{type}> or dict<{type}> depending on {expr1} - *foreground()* -foreground() Move the Vim window to the foreground. Useful when sent from + +foreground() *foreground()* + Move the Vim window to the foreground. Useful when sent from a client to a Vim server. |remote_send()| On Win32 systems this might not work, the OS does not always allow a window to bring itself to the foreground. Use @@ -3672,7 +3683,7 @@ funcref({name} [, {arglist}] [, {dict}]) *funcref()* It only works for an autoloaded function if it has already been loaded (to avoid mistakenly loading the autoload script when only intending to use the function name, use |function()| - instead). {name} cannot be a builtin function. + instead). {name} cannot be a builtin function. Returns 0 on error. Can also be used as a |method|: > @@ -3680,15 +3691,15 @@ funcref({name} [, {arglist}] [, {dict}]) *funcref()* < Return type: func(...): any or |Number| on error - *function()* *partial* *E700* *E923* -function({name} [, {arglist}] [, {dict}]) + +function({name} [, {arglist}] [, {dict}]) *function()* *partial* *E700* *E923* Return a |Funcref| variable that refers to function {name}. {name} can be the name of a user defined function or an internal function. {name} can also be a Funcref or a partial. When it is a partial the dict stored in it will be used and the {dict} - argument is not allowed. E.g.: > + argument is not allowed. E.g.: > let FuncWithArg = function(dict.Func, [arg]) let Broken = function(dict.Func, [arg], dict) < @@ -3697,8 +3708,8 @@ function({name} [, {arglist}] [, {dict}]) same function. When {arglist} or {dict} is present this creates a partial. - That means the argument list and/or the dictionary is stored in - the Funcref and will be used when the Funcref is called. + That means the argument list and/or the dictionary is stored + in the Funcref and will be used when the Funcref is called. The arguments are passed to the function in front of other arguments, but after any argument from |method|. Example: > @@ -3732,7 +3743,7 @@ function({name} [, {arglist}] [, {dict}]) call Callback('one', 'two', 'name') < The Dictionary is only useful when calling a "dict" function. - In that case the {dict} is passed in as "self". Example: > + In that case the {dict} is passed in as "self". Example: > function Callback() dict echo "called for " .. self.name endfunction @@ -3799,6 +3810,7 @@ get({list}, {idx} [, {default}]) *get()* *get()-list* < Return type: any, depending on {list} + get({tuple}, {idx} [, {default}]) *get()-tuple* Get item {idx} from |Tuple| {tuple}. When this item is not available return {default}. Return zero when {default} is @@ -3808,6 +3820,7 @@ get({tuple}, {idx} [, {default}]) *get()-tuple* < Return type: any, depending on {tuple} + get({blob}, {idx} [, {default}]) *get()-blob* Get byte {idx} from |Blob| {blob}. When this byte is not available return {default}. Return -1 when {default} is @@ -3817,6 +3830,7 @@ get({blob}, {idx} [, {default}]) *get()-blob* < Return type: |Number| + get({dict}, {key} [, {default}]) *get()-dict* Get item with key {key} from |Dictionary| {dict}. When this item is not available return {default}. Return zero when @@ -3829,6 +3843,7 @@ get({dict}, {key} [, {default}]) *get()-dict* < Return type: any, depending on {dict} + get({func}, {what}) *get()-func* Get item {what} from |Funcref| {func}. Possible values for {what} are: @@ -3856,8 +3871,8 @@ get({func}, {what}) *get()-func* < Return type: any, depending on {func} and {what} - *getbufinfo()* -getbufinfo([{buf}]) + +getbufinfo([{buf}]) *getbufinfo()* getbufinfo([{dict}]) Get information about buffers as a List of Dictionaries. @@ -3934,8 +3949,7 @@ getbufinfo([{dict}]) Return type: list> - *getbufline()* -getbufline({buf}, {lnum} [, {end}]) +getbufline({buf}, {lnum} [, {end}]) *getbufline()* Return a |List| with the lines starting from {lnum} to {end} (inclusive) in the buffer {buf}. If {end} is omitted, a |List| with only the line {lnum} is returned. See @@ -3965,15 +3979,15 @@ getbufline({buf}, {lnum} [, {end}]) < Return type: list - *getbufoneline()* -getbufoneline({buf}, {lnum}) + +getbufoneline({buf}, {lnum}) *getbufoneline()* Just like `getbufline()` but only get one line and return it as a string. Return type: |String| -getbufvar({buf}, {varname} [, {def}]) *getbufvar()* +getbufvar({buf}, {varname} [, {def}]) *getbufvar()* The result is the value of option or local buffer variable {varname} in buffer {buf}. Note that the name without "b:" must be used. @@ -4004,12 +4018,14 @@ getcellpixels() *getcellpixels()* Returns a |List| of terminal cell pixel size. List format is [xpixel, ypixel]. - Only works on Unix (terminal and gVim) and Windows (gVim only). + Only works on Unix (terminal and gVim) and Windows (gVim + only). Returns [] on other systems or on failure. - Note that there could be variations across different terminals. + Note that there could be variations across different + terminals. On macOS, system Terminal.app returns sizes in points (before - Retina scaling), whereas third-party terminals return raw pixel - sizes (post Retina scaling). + Retina scaling), whereas third-party terminals return raw + pixel sizes (post Retina scaling). Return type: list @@ -4024,8 +4040,8 @@ getcellwidths() *getcellwidths()* getchangelist([{buf}]) *getchangelist()* - Returns the |changelist| for the buffer {buf}. For the use - of {buf}, see |bufname()| above. If buffer {buf} doesn't + Returns the |changelist| for the buffer {buf}. For the use + of {buf}, see |bufname()| above. If buffer {buf} doesn't exist, an empty list is returned. The returned list contains two entries: a list with the change @@ -4036,7 +4052,7 @@ getchangelist([{buf}]) *getchangelist()* coladd column offset for 'virtualedit' lnum line number If buffer {buf} is the current buffer, then the current - position refers to the position in the list. For other + position refers to the position in the list. For other buffers, it is set to the length of the list. Can also be used as a |method|: > @@ -4073,9 +4089,9 @@ getchar([{expr} [, {opts}]]) *getchar()* When {expr} is 1 only the first byte is returned. For a one-byte character it is the character itself as a number. - Use nr2char() to convert it to a String. + Use |nr2char()| to convert it to a String. - Use getcharmod() to obtain any additional modifiers. + Use |getcharmod()| to obtain any additional modifiers. The optional argument {opts} is a Dict and supports the following items: @@ -4143,7 +4159,7 @@ getchar([{expr} [, {opts}]]) *getchar()* :endfunction < You may also receive synthetic characters, such as - ||. Often you will want to ignore this and get + ||. Often you will want to ignore this and get another character: > :function GetKey() : let c = getchar() @@ -4158,7 +4174,7 @@ getchar([{expr} [, {opts}]]) *getchar()* getcharmod() *getcharmod()* The result is a Number which is the state of the modifiers for - the last obtained character with getchar() or in another way. + the last obtained character with |getchar()| or in another way. These values are added together: 2 shift 4 control @@ -4176,7 +4192,7 @@ getcharmod() *getcharmod()* getcharpos({expr}) *getcharpos()* - Get the position for String {expr}. Same as |getpos()| but the + Get the position for String {expr}. Same as |getpos()| but the column number in the returned List is a character index instead of a byte index. If |getpos()| returns a very large column number, equal to @@ -4223,6 +4239,7 @@ getcharstr([{expr} [, {opts}]]) *getcharstr()* Return type: |String| + getcmdcomplpat() *getcmdcomplpat()* Return completion pattern of the current command-line. Only works when the command line is being edited, thus @@ -4300,7 +4317,7 @@ getcmdscreenpos() *getcmdscreenpos()* getcmdtype() *getcmdtype()* - Return the current command-line type. Possible return values + Return the current command-line type. Possible return values are: : normal Ex command > debug mode command |debug-mode| @@ -4318,15 +4335,15 @@ getcmdtype() *getcmdtype()* getcmdwintype() *getcmdwintype()* - Return the current |command-line-window| type. Possible return - values are the same as |getcmdtype()|. Returns an empty string + Return the current |command-line-window| type. Possible return + values are the same as |getcmdtype()|. Returns an empty string when not in the command-line window. Return type: |String| getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* - Return a list of command-line completion matches. The String + Return a list of command-line completion matches. The String {type} argument specifies what for. The following completion types are supported: @@ -4383,10 +4400,10 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* If the optional {filtered} flag is set to 1, then 'wildignore' is applied to filter the results. Otherwise all the matches - are returned. The 'wildignorecase' option always applies. + are returned. The 'wildignorecase' option always applies. If the 'wildoptions' option contains 'fuzzy', then fuzzy - matching is used to get the completion matches. Otherwise + matching is used to get the completion matches. Otherwise regular expression matching is used. Thus this function follows the user preference, what happens on the command line. If you do not want this you can make 'wildoptions' empty @@ -4405,6 +4422,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* < Return type: list + getcompletiontype({pat}) *getcompletiontype()* Return the type of the command-line completion using {pat}. When no corresponding completion type is found, an empty @@ -4414,8 +4432,8 @@ getcompletiontype({pat}) *getcompletiontype()* Return type: |String| - *getcurpos()* -getcurpos([{winid}]) + +getcurpos([{winid}]) *getcurpos()* Get the position of the cursor. This is like getpos('.'), but includes an extra "curswant" item in the list: [0, lnum, col, off, curswant] ~ @@ -4423,8 +4441,8 @@ getcurpos([{winid}]) cursor vertically. After |$| command it will be a very large number equal to |v:maxcol|. Also see |getcursorcharpos()| and |getpos()|. - The first "bufnum" item is always zero. The byte position of - the cursor is returned in 'col'. To get the character + The first "bufnum" item is always zero. The byte position of + the cursor is returned in 'col'. To get the character position, use |getcursorcharpos()|. The optional {winid} argument can specify the window. It can @@ -4446,7 +4464,7 @@ getcurpos([{winid}]) Return type: list -getcursorcharpos([{winid}]) *getcursorcharpos()* +getcursorcharpos([{winid}]) *getcursorcharpos()* Same as |getcurpos()| but the column number in the returned List is a character index instead of a byte index. @@ -4472,7 +4490,7 @@ getcwd([{winnr} [, {tabnr}]]) *getcwd()* directory. See also |haslocaldir()|. With {winnr} and {tabnr} return the local current directory of - the window in the specified tab page. If {winnr} is -1 return + the window in the specified tab page. If {winnr} is -1 return the working directory of the tabpage. If {winnr} is zero use the current window, if {tabnr} is zero use the current tabpage. @@ -4499,6 +4517,7 @@ getcwd([{winnr} [, {tabnr}]]) *getcwd()* < Return type: |String| + getenv({name}) *getenv()* Return the value of environment variable {name}. The {name} argument is a string, without a leading '$'. Example: > @@ -4572,7 +4591,7 @@ getfsize({fname}) *getfsize()* getftime({fname}) *getftime()* The result is a Number, which is the last modification time of the given file {fname}. The value is measured as seconds - since 1st Jan 1970, and may be passed to strftime(). See also + since 1st Jan 1970, and may be passed to |strftime()|. See also |localtime()| and |strftime()|. If the file {fname} can't be found -1 is returned. @@ -4608,6 +4627,7 @@ getftype({fname}) *getftype()* < Return type: |String| + getimstatus() *getimstatus()* The result is a Number, which is |TRUE| when the IME status is active and |FALSE| otherwise. @@ -4641,8 +4661,8 @@ getjumplist([{winnr} [, {tabnr}]]) *getjumplist()* < Return type: list - *getline()* -getline({lnum} [, {end}]) + +getline({lnum} [, {end}]) *getline()* Without {end} the result is a String, which is line {lnum} from the current buffer. Example: > getline(1) @@ -4679,19 +4699,19 @@ getloclist({nr} [, {what}]) *getloclist()* For a location list window, the displayed location list is returned. For an invalid window number {nr}, an empty list is - returned. Otherwise, same as |getqflist()|. + returned. Otherwise, same as |getqflist()|. If the optional {what} dictionary argument is supplied, then - returns the items listed in {what} as a dictionary. Refer to + returns the items listed in {what} as a dictionary. Refer to |getqflist()| for the supported items in {what}. In addition to the items supported by |getqflist()| in {what}, the following item is supported by |getloclist()|: filewinid id of the window used to display files - from the location list. This field is + from the location list. This field is applicable only when called from a - location list window. See + location list window. See |location-list-file-window| for more details. @@ -4802,7 +4822,7 @@ getmouseshape() *getmouseshape()* Return type: |String| -getpid() *getpid()* +getpid() *getpid()* Return a Number which is the process ID of the Vim process. On Unix and MS-Windows this is a unique number, until Vim exits. @@ -4810,9 +4830,9 @@ getpid() *getpid()* Return type: |Number| -getpos({expr}) *getpos()* +getpos({expr}) *getpos()* Get the position for String {expr}. - The accepted values for {expr} are: *E1209* + The accepted values for {expr} are: *E1209* . The cursor position. $ The last line in the current buffer. 'x Position of mark x (if the mark is not set, 0 is @@ -4852,7 +4872,7 @@ getpos({expr}) *getpos()* For getting the cursor position see |getcurpos()|. The column number in the returned List is the byte position - within the line. To get the character position in the line, + within the line. To get the character position in the line, use |getcharpos()|. Note that for '< and '> Visual mode matters: when it is "V" @@ -4879,7 +4899,7 @@ getqflist([{what}]) *getqflist()* Returns a |List| with all the current quickfix errors. Each list item is a dictionary with these entries: bufnr number of buffer that has the file name, use - bufname() to get the name + |bufname()| to get the name module module name lnum line number in the buffer (first line is 1) end_lnum @@ -4898,7 +4918,7 @@ getqflist([{what}]) *getqflist()* any type. When there is no error list or it's empty, an empty list is - returned. Quickfix list entries with a non-existing buffer + returned. Quickfix list entries with a non-existing buffer number are returned with "bufnr" set to zero (Note: some functions accept buffer number zero for the alternate buffer, you may need to explicitly check for zero). @@ -4911,12 +4931,12 @@ getqflist([{what}]) *getqflist()* :endfor < If the optional {what} dictionary argument is supplied, then - returns only the items listed in {what} as a dictionary. The + returns only the items listed in {what} as a dictionary. The following string items are supported in {what}: changedtick get the total number of changes made to the list |quickfix-changedtick| context get the |quickfix-context| - efm errorformat to use when parsing "lines". If + efm errorformat to use when parsing "lines". If not present, then the 'errorformat' option value is used. id get information for the quickfix list with @@ -4930,24 +4950,24 @@ getqflist([{what}]) *getqflist()* lines parse a list of lines using 'efm' and return the resulting entries. Only a |List| type is accepted. The current quickfix list is not - modified. See |quickfix-parse|. + modified. See |quickfix-parse|. nr get information for this quickfix list; zero means the current quickfix list and "$" means the last quickfix list qfbufnr number of the buffer displayed in the quickfix - window. Returns 0 if the quickfix buffer is - not present. See |quickfix-buffer|. + window. Returns 0 if the quickfix buffer is + not present. See |quickfix-buffer|. size number of entries in the quickfix list title get the list title |quickfix-title| winid get the quickfix |window-ID| all all of the above quickfix properties - Non-string items in {what} are ignored. To get the value of a + Non-string items in {what} are ignored. To get the value of a particular item, set it to zero. If "nr" is not present then the current quickfix list is used. If both "nr" and a non-zero "id" are specified, then the list specified by "id" is used. To get the number of lists in the quickfix stack, set "nr" to - "$" in {what}. The "nr" value in the returned dictionary + "$" in {what}. The "nr" value in the returned dictionary contains the quickfix stack size. When "lines" is specified, all the other items except "efm" are ignored. The returned dictionary contains the entry @@ -4956,22 +4976,23 @@ getqflist([{what}]) *getqflist()* The returned dictionary contains the following entries: changedtick total number of changes made to the list |quickfix-changedtick| - context quickfix list context. See |quickfix-context| + context quickfix list context. See |quickfix-context| If not present, set to "". - id quickfix list ID |quickfix-ID|. If not + id quickfix list ID |quickfix-ID|. If not present, set to 0. - idx index of the quickfix entry in the list. If not - present, set to 0. - items quickfix list entries. If not present, set to + idx index of the quickfix entry in the list. If + not present, set to 0. + items quickfix list entries. If not present, set to an empty list. - nr quickfix list number. If not present, set to 0 + nr quickfix list number. If not present, set to + 0 qfbufnr number of the buffer displayed in the quickfix - window. If not present, set to 0. - size number of entries in the quickfix list. If not - present, set to 0. - title quickfix list title text. If not present, set + window. If not present, set to 0. + size number of entries in the quickfix list. If + not present, set to 0. + title quickfix list title text. If not present, set to "". - winid quickfix |window-ID|. If not present, set to 0 + winid quickfix |window-ID|. If not present, set to 0 Examples (See also |getqflist-examples|): > :echo getqflist({'all': 1}) @@ -4996,7 +5017,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* argument is ignored, thus you can always give it. If {list} is present and |TRUE|, the result type is changed - to |List|. Each list item is one text line. Use it if you care + to |List|. Each list item is one text line. Use it if you care about zero bytes possibly present inside register: without third argument both NLs and zero bytes are represented as NLs (see |NL-used-for-Nul|). @@ -5104,7 +5125,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* Return type: list -getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* +getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* Same as |getregion()|, but returns a list of positions describing the buffer text segments bound by {pos1} and {pos2}. @@ -5170,7 +5191,7 @@ getscriptinfo([{opts}]) *getscriptinfo()* The optional Dict argument {opts} supports the following optional items: - name Script name match pattern. If specified, + name Script name match pattern. If specified, and "sid" is not specified, information about scripts with a name that match the pattern "name" are returned. @@ -5224,7 +5245,7 @@ getstacktrace() *getstacktrace()* gettabinfo([{tabnr}]) *gettabinfo()* If {tabnr} is not specified, then information about all the - tab pages is returned as a |List|. Each List item is a + tab pages is returned as a |List|. Each List item is a |Dictionary|. Otherwise, {tabnr} specifies the tab page number and information about that one is returned. If the tab page does not exist an empty List is returned. @@ -5241,7 +5262,7 @@ gettabinfo([{tabnr}]) *gettabinfo()* Return type: list> -gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* +gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page {tabnr}. |t:var| Tabs are numbered starting with one. @@ -5257,7 +5278,7 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Return type: any, depending on {varname} -gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* +gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* Get the value of window-local variable {varname} in window {winnr} in tab page {tabnr}. The {varname} argument is a string. When {varname} is empty a @@ -5290,16 +5311,17 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* gettagstack([{winnr}]) *gettagstack()* - The result is a Dict, which is the tag stack of window {winnr}. + The result is a Dict, which is the tag stack of window + {winnr}. {winnr} can be the window number or the |window-ID|. When {winnr} is not specified, the current window is used. When window {winnr} doesn't exist, an empty Dict is returned. The returned dictionary contains the following entries: - curidx Current index in the stack. When at + curidx Current index in the stack. When at top of the stack, set to (length + 1). Index of bottom of the stack is 1. - items List of items in the stack. Each item + items List of items in the stack. Each item is a dictionary containing the entries described below. length Number of entries in the stack. @@ -5310,9 +5332,9 @@ gettagstack([{winnr}]) *gettagstack()* from cursor position before the tag jump. See |getpos()| for the format of the returned list. - matchnr current matching tag number. Used when - multiple matching tags are found for a - name. + matchnr current matching tag number. Used + when multiple matching tags are found + for a name. tagname name of the tag See |tagstack| for more information about the tag stack. @@ -5417,7 +5439,7 @@ getwinpos([{timeout}]) *getwinpos()* getwinposx() *getwinposx()* The result is a Number, which is the X coordinate in pixels of - the left hand side of the GUI Vim window. Also works for an + the left hand side of the GUI Vim window. Also works for an xterm (uses a timeout of 100 msec). The result will be -1 if the information is not available (e.g. on the Wayland backend). @@ -5437,7 +5459,7 @@ getwinposy() *getwinposy()* Return type: |Number| -getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* +getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Like |gettabwinvar()| for the current tabpage. Examples: > :let list_is_on = getwinvar(2, '&list') @@ -5449,7 +5471,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Return type: any, depending on {varname} -glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* +glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* Expand the file wildcards in {expr}. See |wildcards| for the use of special characters. @@ -5460,7 +5482,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* 'wildignorecase' always applies. When {list} is present and it is |TRUE| the result is a |List| - with all matching files. The advantage of using a List is, + with all matching files. The advantage of using a List is, you also get filenames containing newlines correctly. Otherwise the result is a String and when there are several matches, they are separated by characters. @@ -5493,7 +5515,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* glob2regpat({string}) *glob2regpat()* - Convert a file pattern, as used by glob(), into a search + Convert a file pattern, as used by |glob()|, into a search pattern. The result can be used to match with a string that is a file name. E.g. > if filename =~ glob2regpat('Make*.mak') @@ -5509,9 +5531,9 @@ glob2regpat({string}) *glob2regpat()* < Return type: |String| - *globpath()* + *globpath()* globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) - Perform glob() for String {expr} on all directories in {path} + Perform |glob()| for String {expr} on all directories in {path} and concatenate the results. Example: > :echo globpath(&rtp, "syntax/c.vim") < @@ -5530,10 +5552,10 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) 'suffixes' affect the ordering of matches. When {list} is present and it is |TRUE| the result is a |List| - with all matching files. The advantage of using a List is, you - also get filenames containing newlines correctly. Otherwise - the result is a String and when there are several matches, - they are separated by characters. Example: > + with all matching files. The advantage of using a List is, + you also get filenames containing newlines correctly. + Otherwise the result is a String and when there are several + matches, they are separated by characters. Example: > :echo globpath(&rtp, "syntax/c.vim", 0, 1) < {alllinks} is used as with |glob()|. @@ -5553,7 +5575,7 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) on {list} -has({feature} [, {check}]) *has()* +has({feature} [, {check}]) *has()* When {check} is omitted or is zero: The result is a Number, which is 1 if the feature {feature} is supported, zero otherwise. The {feature} argument is a string, case is @@ -5773,6 +5795,7 @@ histnr({history}) *histnr()* < Return type: |Number| + hlexists({name}) *hlexists()* The result is a Number, which is TRUE if a highlight group called {name} exists. This is when the group has been @@ -5804,24 +5827,24 @@ hlget([{name} [, {resolve}]]) *hlget()* cleared boolean flag, set to v:true if the highlight group attributes are cleared or not yet specified. See |highlight-clear|. - cterm cterm attributes. See |highlight-cterm|. + cterm cterm attributes. See |highlight-cterm|. ctermbg cterm background color. See |highlight-ctermbg|. ctermfg cterm foreground color. See |highlight-ctermfg|. ctermul cterm underline color. See |highlight-ctermul|. default boolean flag, set to v:true if the highlight - group link is a default link. See + group link is a default link. See |highlight-default|. font highlight group font. See |highlight-font|. - gui gui attributes. See |highlight-gui|. + gui gui attributes. See |highlight-gui|. guibg gui background color. See |highlight-guibg|. guifg gui foreground color. See |highlight-guifg|. guisp gui special color. See |highlight-guisp|. id highlight group ID. linksto linked highlight group name. See |:highlight-link|. - name highlight group name. See |group-name|. + name highlight group name. See |group-name|. start start terminal keycode. See |highlight-start|. stop stop terminal keycode. See |highlight-stop|. term term attributes. See |highlight-term|. @@ -5845,7 +5868,7 @@ hlget([{name} [, {resolve}]]) *hlget()* hlset({list}) *hlset()* Creates or modifies the attributes of a List of highlight groups. Each item in {list} is a dictionary containing the - attributes of a highlight group. See |hlget()| for the list of + attributes of a highlight group. See |hlget()| for the list of supported items in this dictionary. In addition to the items described in |hlget()|, the following @@ -5895,7 +5918,8 @@ hlset({list}) *hlset()* < Return type: |Number| -hlID({name}) *hlID()* + +hlID({name}) *hlID()* The result is a Number, which is the ID of the highlight group with name {name}. When the highlight group doesn't exist, zero is returned. @@ -5945,18 +5969,18 @@ iconv({string}, {from}, {to}) *iconv()* Return type: |String| -id({item}) *id()* +id({item}) *id()* The result is a unique String associated with the {item} and - not with the {item}'s contents. It is only valid while the - {item} exists and is referenced. It is valid only in the - instance of vim that produces the result. The whole idea is + not with the {item}'s contents. It is only valid while the + {item} exists and is referenced. It is valid only in the + instance of vim that produces the result. The whole idea is that `id({item})` does not change if the contents of {item} - changes. This is useful as a `key` for creating an identity + changes. This is useful as a `key` for creating an identity dictionary, rather than one based on equals. This operation does not reference {item} and there is no - function to convert the `id` to the {item}. It may be useful to - have a map of `id` to {item}. The following > + function to convert the `id` to the {item}. It may be useful to + have a map of `id` to {item}. The following > var referenceMap: dict var id = item->id() referenceMap[id] = item @@ -5964,7 +5988,7 @@ id({item}) *id()* way to get the {item} from the `id`. {item} may be a List, Tuple, Dictionary, Object, Job, Channel - or Blob. If the item is not a permitted type, or it is a null + or Blob. If the item is not a permitted type, or it is a null value, then an empty String is returned. Can also be used as a |method|: > @@ -5973,7 +5997,7 @@ id({item}) *id()* Return type: |String| -indent({lnum}) *indent()* +indent({lnum}) *indent()* The result is a Number, which is indent of line {lnum} in the current buffer. The indent is counted in spaces, the value of 'tabstop' is relevant. {lnum} is used just like in @@ -5987,7 +6011,7 @@ indent({lnum}) *indent()* Return type: |Number| -index({object}, {expr} [, {start} [, {ic}]]) *index()* +index({object}, {expr} [, {start} [, {ic}]]) *index()* Find {expr} in {object} and return its index. See |indexof()| for using a lambda to select the item. @@ -6113,7 +6137,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* Return type: |String| -inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* +inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* Like |input()|, but when the GUI is running and text dialogs are supported, a dialog window pops up to input the text. Example: > @@ -6158,9 +6182,10 @@ inputlist({textlist}) *inputlist()* inputrestore() *inputrestore()* Restore typeahead that was saved with a previous |inputsave()|. - Should be called the same number of times inputsave() is + Should be called the same number of times |inputsave()| is called. Calling it more often is harmless though. - Returns TRUE when there is nothing to restore, FALSE otherwise. + Returns TRUE when there is nothing to restore, FALSE + otherwise. Return type: |Number| @@ -6168,9 +6193,9 @@ inputrestore() *inputrestore()* inputsave() *inputsave()* Preserve typeahead (also from mappings) and clear it, so that a following prompt gets input from the user. Should be - followed by a matching inputrestore() after the prompt. Can + followed by a matching |inputrestore()| after the prompt. Can be used several times, in which case there must be just as - many inputrestore() calls. + many |inputrestore()| calls. Returns TRUE when out of memory, FALSE otherwise. Return type: |Number| @@ -6216,8 +6241,7 @@ insert({object}, {item} [, {idx}]) *insert()* Return type: |Number| - *instanceof()* *E614* *E616* *E693* -instanceof({object}, {class}) +instanceof({object}, {class}) *instanceof()* *E614* *E616* *E693* The result is a Number, which is |TRUE| when the {object} argument is a direct or indirect instance of a |Class|, |Interface|, or class |:type| alias specified by {class}. @@ -6231,6 +6255,7 @@ instanceof({object}, {class}) < Return type: |Number| + interrupt() *interrupt()* Interrupt script execution. It works more or less like the user typing CTRL-C, most commands won't execute and control @@ -6246,6 +6271,7 @@ interrupt() *interrupt()* < Return type: void + invert({expr}) *invert()* Bitwise invert. The argument is converted to a number. A List, Dict or Float argument causes an error. Example: > @@ -6259,10 +6285,11 @@ invert({expr}) *invert()* isabsolutepath({path}) *isabsolutepath()* The result is a Number, which is |TRUE| when {path} is an absolute path. - On Unix, a path is considered absolute when it starts with '/'. - On MS-Windows, it is considered absolute when it starts with an - optional drive prefix and is followed by a '\' or '/'. UNC paths - are always absolute. + On Unix, a path is considered absolute when it starts with + '/'. + On MS-Windows, it is considered absolute when it starts with + an optional drive prefix and is followed by a '\' or '/'. UNC + paths are always absolute. Example: > echo isabsolutepath('/usr/share/') " 1 echo isabsolutepath('./foobar') " 0 @@ -6408,7 +6435,7 @@ js_encode({expr}) *js_encode()* [1,,{one:1},,] ~ While json_encode() would produce: [1,null,{"one":1},null] ~ - This encoding is valid for JavaScript. It is more efficient + This encoding is valid for JavaScript. It is more efficient than JSON, especially when using an array with optional items. Can also be used as a |method|: > @@ -6417,7 +6444,7 @@ js_encode({expr}) *js_encode()* Return type: |String| -json_decode({string}) *json_decode()* *E491* +json_decode({string}) *json_decode()* *E491* This parses a JSON formatted string and returns the equivalent in Vim values. See |json_encode()| for the relation between JSON and Vim values. @@ -6427,7 +6454,7 @@ json_decode({string}) *json_decode()* *E491* - Integer keys are accepted in objects, e.g. {1:2} is the same as {"1":2}. - More floating point numbers are recognized, e.g. "1." for - "1.0", or "001.2" for "1.2". Special floating point values + "1.0", or "001.2" for "1.2". Special floating point values "Infinity", "-Infinity" and "NaN" (capitalization ignored) are accepted. - Leading zeroes in integer numbers are ignored, e.g. "012" @@ -6445,7 +6472,7 @@ json_decode({string}) *json_decode()* *E491* a 12 character sequence such as "\uD834\uDD1E", but json_decode() silently accepts truncated surrogate pairs such as "\uD834" or "\uD834\u" - *E938* + *E938* A duplicate key in an object, valid in rfc7159, is not accepted by json_decode() as the result must be a valid Vim type, e.g. this fails: {"a":"b", "a":"c"} @@ -6535,8 +6562,7 @@ len({expr}) *len()* *E701* Return type: |Number| - *libcall()* *E364* *E368* -libcall({libname}, {funcname}, {argument}) +libcall({libname}, {funcname}, {argument}) *libcall()* *E364* *E368* Call function {funcname} in the run-time library {libname} with single argument {argument}. This is useful to call functions in a library that you @@ -6546,7 +6572,7 @@ libcall({libname}, {funcname}, {argument}) The result is the String returned by the function. If the function returns NULL, this will appear as an empty string "" to Vim. - If the function returns a number, use libcallnr()! + If the function returns a number, use |libcallnr()|! If {argument} is a number, it is passed to the function as an int; if {argument} is a string, it is passed as a null-terminated string. @@ -6585,8 +6611,8 @@ libcall({libname}, {funcname}, {argument}) third argument: > GetValue()->libcall("libc.so", "getenv") < - *libcallnr()* -libcallnr({libname}, {funcname}, {argument}) + +libcallnr({libname}, {funcname}, {argument}) *libcallnr()* Just like |libcall()|, but used for a function that returns an int instead of a string. {only in Win32 and some Unix versions, when the |+libcall| @@ -6690,7 +6716,8 @@ list2str({list} [, {utf8}]) *list2str()* join(map(list, {nr, val -> nr2char(val)}), '') < |str2list()| does the opposite. - When {utf8} is omitted or zero, the current 'encoding' is used. + When {utf8} is omitted or zero, the current 'encoding' is + used. When {utf8} is TRUE, always return UTF-8 characters. With UTF-8 composing characters work as expected: > list2str([97, 769]) returns "á" @@ -6725,7 +6752,7 @@ list2tuple({list}) *list2tuple()* listener_add({callback} [, {buf} [, {unbuffered}]]) *listener_add()* Add a callback function that will be invoked when changes have been made to buffer {buf}. - {buf} refers to a buffer name or number. For the accepted + {buf} refers to a buffer name or number. For the accepted values, see |bufname()|. When {buf} is omitted the current buffer is used. Returns a unique ID that can be passed to |listener_remove()|. @@ -6791,16 +6818,16 @@ listener_add({callback} [, {buf} [, {unbuffered}]]) *listener_add()* Because of the third trigger reason for triggering a callback listed above, the line numbers passed to the callback are not - guaranteed to be valid. If this is a problem then make + guaranteed to be valid. If this is a problem then make {unbuffered} |TRUE|. When {unbuffered} is |TRUE| the {callback} is invoked for every - single change. The changes list only holds a single dictionary - and the "start", "end" and "added" values in the dictionary are - the same as the corresponding callback arguments. The line - numbers are valid when the callback is invoked, but later - changes may make them invalid, thus keeping a copy for later - might not work. + single change. The changes list only holds a single + dictionary and the "start", "end" and "added" values in the + dictionary are the same as the corresponding callback + arguments. The line numbers are valid when the callback is + invoked, but later changes may make them invalid, thus keeping + a copy for later might not work. The {callback} is invoked with the text locked, see |textlock|. If you do need to make changes to the buffer, use @@ -6827,7 +6854,7 @@ listener_flush([{buf}]) *listener_flush()* Invoke listener callbacks for buffer {buf}. If there are no pending changes then no callbacks are invoked. - {buf} refers to a buffer name or number. For the accepted + {buf} refers to a buffer name or number. For the accepted values, see |bufname()|. When {buf} is omitted the current buffer is used. @@ -6838,7 +6865,7 @@ listener_flush([{buf}]) *listener_flush()* listener_remove({id}) *listener_remove()* - Remove a listener previously added with listener_add(). + Remove a listener previously added with |listener_add()|. Returns FALSE when {id} could not be found, TRUE when {id} was removed. @@ -6888,9 +6915,9 @@ log10({expr}) *log10()* Return type: |Float| -luaeval({expr} [, {expr}]) *luaeval()* +luaeval({expr} [, {expr}]) *luaeval()* Evaluate Lua expression {expr} and return its result converted - to Vim data structures. Second {expr} may hold additional + to Vim data structures. Second {expr} may hold additional argument accessible as _A inside first {expr}. Strings are returned as they are. Boolean objects are converted to numbers. @@ -6927,7 +6954,7 @@ map({expr1}, {expr2}) *map()* of the current item. For a |Dictionary| |v:key| has the key of the current item and for a |List| |v:key| has the index of the current item. For a |Blob| |v:key| has the index of the - current byte. For a |String| |v:key| has the index of the + current byte. For a |String| |v:key| has the index of the current character. Example: > :call map(mylist, '"> " .. v:val .. " <"') @@ -6945,7 +6972,7 @@ map({expr1}, {expr2}) *map()* accepts one argument, but with a Vim9 lambda you get "E1106: One argument too many", the number of arguments must match. - The function must return the new value of the item. Example + The function must return the new value of the item. Example that changes each value by "key-value": > func KeyValue(key, val) return a:key .. '-' .. a:val @@ -6966,8 +6993,8 @@ map({expr1}, {expr2}) *map()* or a new |Blob| or |String|. When an error is encountered while evaluating {expr2} no further items in {expr1} are processed. - When {expr2} is a Funcref errors inside a function are ignored, - unless it was defined with the "abort" flag. + When {expr2} is a Funcref errors inside a function are + ignored, unless it was defined with the "abort" flag. Can also be used as a |method|: > mylist->map(expr2) @@ -6976,12 +7003,12 @@ map({expr1}, {expr2}) *map()* depending on {expr1} -maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* +maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* When {dict} is omitted or zero: Return the rhs of mapping {name} in mode {mode}. The returned String has special characters translated like in the output of the ":map" command - listing. When {dict} is TRUE a dictionary is returned, see - below. To get a list of all mappings see |maplist()|. + listing. When {dict} is TRUE a dictionary is returned, see + below. To get a list of all mappings see |maplist()|. When there is no mapping for {name}, an empty String is returned if {dict} is FALSE, otherwise returns an empty Dict. @@ -7020,7 +7047,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* "script" 1 if mapping was defined with