Skip to content
Merged
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
56 changes: 6 additions & 50 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 Nov 09
*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Nov 28


VIM リファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -149,7 +149,6 @@ 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 @@ -984,8 +983,8 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
< ただし、{text} が空のリストの場合、{lnum} は実際には使用されな
いため、無効な {lnum} に対してエラーは発生しない。

リストの後に |method| としても使用でき、ベースは第2引数として
渡される: >
リストの後に |method| としても使用でき、ベースは第 3 引数とし
て渡される: >
mylist->appendbufline(buf, lnum)
<
戻り値の型: |Number|
Expand Down Expand Up @@ -2112,50 +2111,6 @@ 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({msg} [, {choices} [, {default} [, {type}]]]) *confirm()*
confirm()はユーザーに選択させるためのダイアログを提供する。戻
Expand Down Expand Up @@ -6718,8 +6673,9 @@ listener_add({callback} [, {buf} [, {unbuffered}]]) *listener_add()*
に表示される。

上記のコールバックをトリガーする 3 番目の理由により、コールバッ
クに渡される行番号の有効性が保証されない。これが問題となる場合
は、{unbuffered} を |TRUE| に設定すること。
クに渡される行番号の有効性は保証されない。特に、終了値は
line('$') + 1 よりも大きくなる可能性がある。これが問題となる場
合は、{unbuffered} を |TRUE| に設定すること。

{unbuffered} が |TRUE| の場合、変更ごとに {callback} が呼び出
される。変更リストは単一の辞書のみを保持し、辞書内の "start"、
Expand Down
57 changes: 6 additions & 51 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 Nov 09
*builtin.txt* For Vim version 9.1. Last change: 2025 Nov 28


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -136,7 +136,6 @@ 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 @@ -909,7 +908,7 @@ appendbufline({buf}, {lnum}, {text}) *appendbufline()*
for an invalid {lnum}, since {lnum} isn't actually used.

Can also be used as a |method| after a List, the base is
passed as the second argument: >
passed as the third argument: >
mylist->appendbufline(buf, lnum)
<
Return type: |Number|
Expand Down Expand Up @@ -2072,51 +2071,6 @@ 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({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
Expand Down Expand Up @@ -6819,9 +6773,10 @@ listener_add({callback} [, {buf} [, {unbuffered}]]) *listener_add()*
The entries are in the order the changes were made, thus the
most recent change is at the end.

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
Because of the third reason for triggering a callback listed
above, the line numbers passed to the callback are not
guaranteed to be valid. In particular, the end value can be
greater than line('$') + 1. If this is a problem then make
{unbuffered} |TRUE|.

When {unbuffered} is |TRUE| the {callback} is invoked for every
Expand Down