Skip to content

Commit 2793388

Browse files
authored
Merge pull request #2062 from h-east/update-builtin
Update builtin.{txt,jax}
2 parents 083f622 + 57fbd4c commit 2793388

File tree

2 files changed

+152
-6
lines changed

2 files changed

+152
-6
lines changed

doc/builtin.jax

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Apr 18
1+
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Apr 27
22

33

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

18831885

1886+
cmdcomplete_info() *cmdcomplete_info()*
1887+
コマンドライン補完に関する情報を含む |Dictionary| を返す。
1888+
|cmdline-completion| を参照。
1889+
項目は以下:
1890+
cmdline_orig 補完が始まる前の元のコマンドライン文字列。
1891+
pum_visible ポップアップメニューが表示されている場合は
1892+
|TRUE|。
1893+
|pumvisible()| を参照。
1894+
matches すべての補完候補のリスト。各項目は文字列であ
1895+
る。
1896+
selected 選択された項目のインデックス。最初のインデック
1897+
スは 0 である。項目が選択されていない場合、イ
1898+
ンデックスは -1 になる (入力されたテキストの
1899+
み、または <Up> キーまたは <Down> キーを使用し
1900+
た場合は、項目が選択されていない状態で最後に補
1901+
完された項目が表示される)
1902+
1903+
補完が試行されなかった場合、候補が 1 つしかなくそれが完全に補
1904+
完された場合、またはエラーが発生した場合は、空の |Dictionary|
1905+
を返す。
1906+
1907+
戻り値の型: dict<any>
1908+
1909+
18841910
col({expr} [, {winid}]) *col()*
18851911
戻り値は数値で、{expr} で与えられる位置の桁番号(バイトインデッ
18861912
クス)。
@@ -2050,6 +2076,50 @@ complete_info([{what}]) *complete_info()*
20502076
<
20512077
戻り値の型: dict<any>
20522078

2079+
complete_match([{lnum}, {col}]) *complete_match()*
2080+
指定された位置から後方に検索し、'isexpand' オプションに従って
2081+
マッチした文字列のリストを返す。引数が指定されていない場合は、
2082+
現在のカーソル位置を使用する。
2083+
2084+
各マッチは、[startcol, trigger_text] を含むリストとして表され
2085+
る:
2086+
- startcol: 補完を開始する桁位置。トリガー位置が見つからない場
2087+
合は -1 を返す。複数文字のトリガーの場合は、最初の文字の桁を
2088+
返す。
2089+
- trigger_text: 'isexpand' からのマッチするトリガー文字列、ま
2090+
たはマッチするものが見つからなかったか、デフォルトの
2091+
'iskeyword' パターンを使用している場合は空の文字列。
2092+
2093+
'isexpand' が空の場合、'iskeyword' のパターン "\k\+$" を使用し
2094+
て現在のキーワードの開始位置を検索する。
2095+
2096+
例: >
2097+
set isexpand=.,->,/,/*,abc
2098+
func CustomComplete()
2099+
let res = complete_match()
2100+
if res->len() == 0 | return | endif
2101+
let [col, trigger] = res[0]
2102+
let items = []
2103+
if trigger == '/*'
2104+
let items = ['/** */']
2105+
elseif trigger == '/'
2106+
let items = ['/*! */', '// TODO:', '// fixme:']
2107+
elseif trigger == '.'
2108+
let items = ['length()']
2109+
elseif trigger =~ '^\->'
2110+
let items = ['map()', 'reduce()']
2111+
elseif trigger =~ '^\abc'
2112+
let items = ['def', 'ghk']
2113+
endif
2114+
if items->len() > 0
2115+
let startcol = trigger =~ '^/' ? col : col + len(trigger)
2116+
call complete(startcol, items)
2117+
endif
2118+
endfunc
2119+
inoremap <Tab> <Cmd>call CustomComplete()<CR>
2120+
<
2121+
戻り値の型: list<list<any>>
2122+
20532123
*confirm()*
20542124
confirm({msg} [, {choices} [, {default} [, {type}]]])
20552125
confirm()はユーザーに選択させるためのダイアログを提供する。戻
@@ -3244,7 +3314,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
32443314
|method| としても使用できる: >
32453315
GetName()->finddir()
32463316
<
3247-
戻り値の型: |String|
3317+
戻り値の型: {count} が負の場合は list<string>、それ以外の場合
3318+
は |String| 。
32483319

32493320

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

32633335

32643336
flatten({list} [, {maxdepth}]) *flatten()*
@@ -4229,6 +4301,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
42294301
file ファイルおよびディレクトリ名
42304302
file_in_path |'path'|のファイルおよびディレクトリ名
42314303
filetype ファイルタイプ名 |'filetype'|
4304+
filetypecmd |:filetype| サブオプション
42324305
function 関数名
42334306
help ヘルプ項目
42344307
highlight ハイライトグループ

en/builtin.txt

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 18
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Apr 27
22

33

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

18341837

1838+
cmdcomplete_info() *cmdcomplete_info()*
1839+
Returns a |Dictionary| with information about cmdline
1840+
completion. See |cmdline-completion|.
1841+
The items are:
1842+
cmdline_orig The original command-line string before
1843+
completion began.
1844+
pum_visible |TRUE| if popup menu is visible.
1845+
See |pumvisible()|.
1846+
matches List of all completion candidates. Each item
1847+
is a string.
1848+
selected Selected item index. First index is zero.
1849+
Index is -1 if no item is selected (showing
1850+
typed text only, or the last completion after
1851+
no item is selected when using the <Up> or
1852+
<Down> keys)
1853+
1854+
Returns an empty |Dictionary| if no completion was attempted,
1855+
if there was only one candidate and it was fully completed, or
1856+
if an error occurred.
1857+
1858+
Return type: dict<any>
1859+
1860+
18351861
col({expr} [, {winid}]) *col()*
18361862
The result is a Number, which is the byte index of the column
18371863
position given with {expr}.
@@ -2007,6 +2033,50 @@ complete_info([{what}]) *complete_info()*
20072033
<
20082034
Return type: dict<any>
20092035

2036+
complete_match([{lnum}, {col}]) *complete_match()*
2037+
Searches backward from the given position and returns a List
2038+
of matches according to the 'isexpand' option. When no
2039+
arguments are provided, uses the current cursor position.
2040+
2041+
Each match is represented as a List containing
2042+
[startcol, trigger_text] where:
2043+
- startcol: column position where completion should start,
2044+
or -1 if no trigger position is found. For multi-character
2045+
triggers, returns the column of the first character.
2046+
- trigger_text: the matching trigger string from 'isexpand',
2047+
or empty string if no match was found or when using the
2048+
default 'iskeyword' pattern.
2049+
2050+
When 'isexpand' is empty, uses the 'iskeyword' pattern
2051+
"\k\+$" to find the start of the current keyword.
2052+
2053+
Examples: >
2054+
set isexpand=.,->,/,/*,abc
2055+
func CustomComplete()
2056+
let res = complete_match()
2057+
if res->len() == 0 | return | endif
2058+
let [col, trigger] = res[0]
2059+
let items = []
2060+
if trigger == '/*'
2061+
let items = ['/** */']
2062+
elseif trigger == '/'
2063+
let items = ['/*! */', '// TODO:', '// fixme:']
2064+
elseif trigger == '.'
2065+
let items = ['length()']
2066+
elseif trigger =~ '^\->'
2067+
let items = ['map()', 'reduce()']
2068+
elseif trigger =~ '^\abc'
2069+
let items = ['def', 'ghk']
2070+
endif
2071+
if items->len() > 0
2072+
let startcol = trigger =~ '^/' ? col : col + len(trigger)
2073+
call complete(startcol, items)
2074+
endif
2075+
endfunc
2076+
inoremap <Tab> <Cmd>call CustomComplete()<CR>
2077+
<
2078+
Return type: list<list<any>>
2079+
20102080
*confirm()*
20112081
confirm({msg} [, {choices} [, {default} [, {type}]]])
20122082
confirm() offers the user a dialog, from which a choice can be
@@ -3235,7 +3305,8 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
32353305
Can also be used as a |method|: >
32363306
GetName()->finddir()
32373307
<
3238-
Return type: |String|
3308+
Return type: list<string> if {count} is negative, |String|
3309+
otherwise
32393310

32403311

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

32543326

32553327
flatten({list} [, {maxdepth}]) *flatten()*
@@ -4243,6 +4315,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
42434315
file file and directory names
42444316
file_in_path file and directory names in |'path'|
42454317
filetype filetype names |'filetype'|
4318+
filetypecmd |:filetype| suboptions
42464319
function function name
42474320
help help subjects
42484321
highlight highlight groups

0 commit comments

Comments
 (0)