Skip to content

Update builtin.{txt,jax} #2062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 76 additions & 3 deletions doc/builtin.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Apr 18
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Apr 27


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -142,12 +142,14 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
chdir({dir}) 文字列 現在の作業ディレクトリを変更する
cindent({lnum}) 数値 {lnum}行目のCインデント量
clearmatches([{win}]) なし 全マッチをクリアする
cmdcomplete_info() 辞書 現在のコマンドライン補完の情報を取得
col({expr} [, {winid}]) 数値 カーソルかマークのカラムバイトインデッ
クス
complete({startcol}, {matches}) なし 挿入モード補完を設定する
complete_add({expr}) 数値 補完候補を追加する
complete_check() 数値 補完中に押されたキーをチェックする
complete_info([{what}]) 辞書 現在の補完情報を取得
complete_match([{lnum}, {col}]) リスト 補完桁とトリガーテキストを取得
confirm({msg} [, {choices} [, {default} [, {type}]]])
数値 ユーザーへの選択肢と番号
copy({expr}) 任意 {expr}の浅いコピーを作る
Expand Down Expand Up @@ -1881,6 +1883,30 @@ clearmatches([{win}]) *clearmatches()*
戻り値の型: |Number|


cmdcomplete_info() *cmdcomplete_info()*
コマンドライン補完に関する情報を含む |Dictionary| を返す。
|cmdline-completion| を参照。
項目は以下:
cmdline_orig 補完が始まる前の元のコマンドライン文字列。
pum_visible ポップアップメニューが表示されている場合は
|TRUE|。
|pumvisible()| を参照。
matches すべての補完候補のリスト。各項目は文字列であ
る。
selected 選択された項目のインデックス。最初のインデック
スは 0 である。項目が選択されていない場合、イ
ンデックスは-1 になる (入力されたテキストのみ、
または <Up> キーまたは <Down> キーを使用した場
合は、項目が選択されていない状態で最後に補完さ
れた項目が表示される)

補完が試行されなかった場合、候補が 1 つしかなくそれが完全に補
完された場合、またはエラーが発生した場合は、空の |Dictionary|
を返す。

戻り値の型: dict<any>


col({expr} [, {winid}]) *col()*
戻り値は数値で、{expr} で与えられる位置の桁番号(バイトインデッ
クス)。
Expand Down Expand Up @@ -2050,6 +2076,50 @@ complete_info([{what}]) *complete_info()*
<
戻り値の型: dict<any>

complete_match([{lnum}, {col}]) *complete_match()*
指定された位置から後方に検索し、'isexpand' オプションに従って
マッチした文字列のリストを返す。引数が指定されていない場合は、
現在のカーソル位置を使用する。

各マッチは、[startcol, trigger_text] を含むリストとして表され
る:
- startcol: 補完を開始する桁位置。トリガー位置が見つからない場
合は -1 を返す。複数文字のトリガーの場合は、最初の文字の桁を
返す。
- trigger_text: 'isexpand' からのマッチするトリガー文字列、ま
たはマッチするものが見つからなかったか、デフォルトの
'iskeyword' パターンを使用している場合は空の文字列。

'isexpand' が空の場合、'iskeyword' のパターン "\k\+$" を使用し
て現在のキーワードの開始位置を検索する。

例: >
set isexpand=.,->,/,/*,abc
func CustomComplete()
let res = complete_match()
if res->len() == 0 | return | endif
let [col, trigger] = res[0]
let items = []
if trigger == '/*'
let items = ['/** */']
elseif trigger == '/'
let items = ['/*! */', '// TODO:', '// fixme:']
elseif trigger == '.'
let items = ['length()']
elseif trigger =~ '^\->'
let items = ['map()', 'reduce()']
elseif trigger =~ '^\abc'
let items = ['def', 'ghk']
endif
if items->len() > 0
let startcol = trigger =~ '^/' ? col : col + len(trigger)
call complete(startcol, items)
endif
endfunc
inoremap <Tab> <Cmd>call CustomComplete()<CR>
<
戻り値の型: list<list<any>>

*confirm()*
confirm({msg} [, {choices} [, {default} [, {type}]]])
confirm()はユーザーに選択させるためのダイアログを提供する。戻
Expand Down Expand Up @@ -3244,7 +3314,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
|method| としても使用できる: >
GetName()->finddir()
<
戻り値の型: |String|
戻り値の型: {count} が負の場合は list<string>、それ以外の場合
は |String| 。


findfile({name} [, {path} [, {count}]]) *findfile()*
Expand All @@ -3258,7 +3329,8 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
|method| としても使用できる: >
GetName()->findfile()
<
戻り値の型: |String|
戻り値の型: {count} が負の場合は list<string>、それ以外の場合
は |String| 。


flatten({list} [, {maxdepth}]) *flatten()*
Expand Down Expand Up @@ -4229,6 +4301,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
file ファイルおよびディレクトリ名
file_in_path |'path'|のファイルおよびディレクトリ名
filetype ファイルタイプ名 |'filetype'|
filetypecmd |:filetype| サブオプション
function 関数名
help ヘルプ項目
highlight ハイライトグループ
Expand Down
79 changes: 76 additions & 3 deletions en/builtin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 18
*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 27


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -129,11 +129,14 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
chdir({dir}) String change current working directory
cindent({lnum}) Number C indent for line {lnum}
clearmatches([{win}]) none clear all matches
cmdcomplete_info() Dict get current cmdline completion
information
col({expr} [, {winid}]) Number column byte index of cursor or mark
complete({startcol}, {matches}) none set Insert mode completion
complete_add({expr}) Number add completion match
complete_check() Number check for key typed during completion
complete_info([{what}]) Dict get current completion information
complete_match([{lnum}, {col}]) List get completion column and trigger text
confirm({msg} [, {choices} [, {default} [, {type}]]])
Number number of choice picked by user
copy({expr}) any make a shallow copy of {expr}
Expand Down Expand Up @@ -1832,6 +1835,29 @@ clearmatches([{win}]) *clearmatches()*
Return type: |Number|


cmdcomplete_info() *cmdcomplete_info()*
Returns a |Dictionary| with information about cmdline
completion. See |cmdline-completion|.
The items are:
cmdline_orig The original command-line string before
completion began.
pum_visible |TRUE| if popup menu is visible.
See |pumvisible()|.
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
typed text only, or the last completion after
no item is selected when using the <Up> or
<Down> keys)

Returns an empty |Dictionary| if no completion was attempted,
if there was only one candidate and it was fully completed, or
if an error occurred.

Return type: dict<any>


col({expr} [, {winid}]) *col()*
The result is a Number, which is the byte index of the column
position given with {expr}.
Expand Down Expand Up @@ -2007,6 +2033,50 @@ complete_info([{what}]) *complete_info()*
<
Return type: dict<any>

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
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
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
default 'iskeyword' pattern.

When 'isexpand' is empty, uses the 'iskeyword' pattern
"\k\+$" to find the start of the current keyword.

Examples: >
set isexpand=.,->,/,/*,abc
func CustomComplete()
let res = complete_match()
if res->len() == 0 | return | endif
let [col, trigger] = res[0]
let items = []
if trigger == '/*'
let items = ['/** */']
elseif trigger == '/'
let items = ['/*! */', '// TODO:', '// fixme:']
elseif trigger == '.'
let items = ['length()']
elseif trigger =~ '^\->'
let items = ['map()', 'reduce()']
elseif trigger =~ '^\abc'
let items = ['def', 'ghk']
endif
if items->len() > 0
let startcol = trigger =~ '^/' ? col : col + len(trigger)
call complete(startcol, items)
endif
endfunc
inoremap <Tab> <Cmd>call CustomComplete()<CR>
<
Return type: list<list<any>>

*confirm()*
confirm({msg} [, {choices} [, {default} [, {type}]]])
confirm() offers the user a dialog, from which a choice can be
Expand Down Expand Up @@ -3235,7 +3305,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
Can also be used as a |method|: >
GetName()->finddir()
<
Return type: |String|
Return type: list<string> if {count} is negative, |String|
otherwise


findfile({name} [, {path} [, {count}]]) *findfile()*
Expand All @@ -3249,7 +3320,8 @@ findfile({name} [, {path} [, {count}]]) *findfile()*
Can also be used as a |method|: >
GetName()->findfile()
<
Return type: |String|
Return type: list<string> if {count} is negative, |String|
otherwise


flatten({list} [, {maxdepth}]) *flatten()*
Expand Down Expand Up @@ -4243,6 +4315,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
file file and directory names
file_in_path file and directory names in |'path'|
filetype filetype names |'filetype'|
filetypecmd |:filetype| suboptions
function function name
help help subjects
highlight highlight groups
Expand Down