diff --git a/doc/options.jax b/doc/options.jax index d62d8d784..bda5a7a15 100644 --- a/doc/options.jax +++ b/doc/options.jax @@ -1,4 +1,4 @@ -*options.txt* For Vim バージョン 9.1. Last change: 2025 Sep 02 +*options.txt* For Vim バージョン 9.1. Last change: 2025 Sep 11 VIMリファレンスマニュアル by Bram Moolenaar @@ -2167,10 +2167,10 @@ Note 1番目の形式では、行全体がオプション指定に使われる *'complete'* *'cpt'* *E535* 'complete' 'cpt' 文字列 (既定では: ".,w,b,u,t,i") バッファについてローカル - コマンド CTRL-P や CTRL-N によるキーワード補完 |ins-completion| の動作 - を指定する。このオプションは行全体の補完 |i_CTRL-X_CTRL-L| にも適用さ - れる。このオプションは補完の方法と、キーワード検索の対象となる場所を示 - す、コンマ区切りのフラグのリストである。 + このオプションは、CTRL-P、CTRL-N、または |ins-autocompletion| を使用し + た場合の補完 |ins-completion| の動作を制御する。また、行全体補完 + |i_CTRL-X_CTRL-L| にも使用される。補完の種類とスキャンする場所を指定す + る。以下のフラグをコンマ区切りで指定する: . カレントバッファから検索 ('wrapscan' の値は無視) w 別のウィンドウ内のバッファから検索 b バッファリスト内の、現在読み込まれている別のバッファから検索 @@ -2206,8 +2206,9 @@ Note 1番目の形式では、行全体がオプション指定に使われる に |ins-autocompletion| において重要である。 F 'completefunc' オプションから取得した関数を使って "F{func}" を 使用するのと同じである。 - o 'omnifunc' オプションから取得した関数を使って "F{func}" を使用 - するのと同じである。 + o "F{func}" と同等だが、{func} は 'omnifunc' オプションから取得 + される。プラグイン (LSP クライアント等) が 'omnifunc' を定義し + ている場合は、このフラグを介して使用できる。 読み込まれていないバッファでは、何しろ読み込まれていないのだから、 |:autocmd| は実行されていない。そのため、ある種のファイルからは思いも @@ -2223,9 +2224,10 @@ Note 1番目の形式では、行全体がオプション指定に使われる 5. タグ 6. インクルードされるファイル - CTRL-N と CTRL-P は 'iskeyword' を利用した全てのファイル名展開で使用で - きる (つまり辞書 |i_CTRL-X_CTRL-K|、インクルードされるパターン - |i_CTRL-X_CTRL-I|、タグ |i_CTRL-X_CTRL-]| および通常の展開)。 + CTRL-N、CTRL-P および |ins-autocompletion| は、'iskeyword' ベースの補完 + (辞書 |i_CTRL-X_CTRL-K|、包含パターン |i_CTRL-X_CTRL-I|、タグ + |i_CTRL-X_CTRL-]|、および通常の展開) に使用できる。'complete' に "F" + および "o" フラグを指定すると、キーワード以外の単語も補完できる。 補完ソースのフラグにキャレット ("^") と {count} を付加することで、補完 ソースに任意のマッチ数制限を指定できる。 @@ -2344,17 +2346,24 @@ Note 1番目の形式では、行全体がオプション指定に使われる {|+textprop| 機能付きでコンパイルされたときのみ有効} preinsert - 現在の補完リーダーの一部ではない最初の候補単語の部分を事前 - に挿入し、|hl-ComplMatchIns| ハイライトグループを使用する。 - これを機能させるには、"fuzzy" を設定せずに、"menuone" を設 - 定する必要がある。 + 'autocomplete' がアクティブでない場合、最初の候補単語のう + ち、|hl-PreInsert| でハイライト表示されている現在の補完リー + ダーの後ろの部分を挿入する。カーソルは移動しない。'fuzzy' + が未設定で、'completeopt' に "menuone" が指定されている必 + 要がある。 + + 'autocomplete' がアクティブな場合、(表示されているすべての + 項目、または現在のバッファ項目から) マッチした単語の中で最 + 長の共通プリフィックスを挿入する。これは、メニュー項目が選 + 択されていない場合にのみ実行される。確定するには Ctrl-Y を + 押す。 preview 現在選択されている候補についての付加的な情報をプレビュー ウィンドウに表示する。"menu" または "menuone" と組み合わせ たときのみ有効。 - 'autocomplete' が有効な場合、"fuzzy"、"popup"、"popuphidden" および - "preview" のみ効果がある。 + 'autocomplete' が有効な場合、"fuzzy"、"popup"、"popuphidden"、 + "preinsert" および "preview" のみ効果がある。 このオプションは |cmdline-completion| には適用されない。詳細については 'wildoptions' を参照。 @@ -3081,8 +3090,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる 内で設定することはできない。 *'dip'* *'diffopt'* -'diffopt' 'dip' 文字列 (既定では - "internal,filler,closeoff,inline:simple") +'diffopt' 'dip' 文字列 (既定では "internal,filler,closeoff, + indent-heuristic,inline:char") グローバル {|+diff| 機能付きでコンパイルされたときのみ有効} 差分モード用のオプション設定。以下の項目で構成できる。すべてオプション @@ -4687,7 +4696,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる #:TabLineSel,_:TabLineFill,!:CursorColumn, .:CursorLine,o:ColorColumn,q:QuickFixLine, z:StatusLineTerm,Z:StatusLineTermNC, - g:MsgArea,h:ComplMatchIns") + g:MsgArea,h:ComplMatchIns,I:PreInsert") グローバル このオプションは、様々な対象に対する強調表示モードを設定する。文字の組 をコンマ区切りのリストとして指定する。1番目の文字は適用される対象を指 @@ -4752,6 +4761,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる |hl-PmenuMatch| k ポップアップメニューのマッチしたテキスト |hl-PmenuMatchSel| < ポップアップメニューの選択された行のマッチしたテ キスト + |hl-PreInsert| I "preinsert" が 'completeopt' にあるときに挿入され + るテキスト 表示モードは以下の通りである。 r 反転 (termcapの項目 "mr" と "me") @@ -5125,8 +5136,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる したい場合、autocmd で 'hlsearch' をオン/オフできる。例: > augroup vimrc-incsearch-highlight autocmd! - autocmd CmdlineEnter /,\? :set hlsearch - autocmd CmdlineLeave /,\? :set nohlsearch + autocmd CmdlineEnter [\/\?] :set hlsearch + autocmd CmdlineLeave [\/\?] :set nohlsearch augroup END < CTRL-L を押すと、現在マッチしているテキストの後からコマンドラインへ1文 diff --git a/en/options.txt b/en/options.txt index 20fe85b84..2be98a419 100644 --- a/en/options.txt +++ b/en/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2025 Sep 02 +*options.txt* For Vim version 9.1. Last change: 2025 Sep 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2124,10 +2124,11 @@ A jump table for the options with a short description can be found at |Q_op|. *'complete'* *'cpt'* *E535* 'complete' 'cpt' string (default: ".,w,b,u,t,i") local to buffer - This option specifies how keyword completion |ins-completion| works - when CTRL-P or CTRL-N are used. It is also used for whole-line - completion |i_CTRL-X_CTRL-L|. It indicates the type of completion - and the places to scan. It is a comma-separated list of flags: + This option controls how completion |ins-completion| behaves when + using CTRL-P, CTRL-N, or |ins-autocompletion|. It is also used for + whole-line completion |i_CTRL-X_CTRL-L|. It indicates the type of + completion and the places to scan. It is a comma-separated list of + flags: . scan the current buffer ('wrapscan' is ignored) w scan buffers from other windows b scan other loaded buffers that are in the buffer list @@ -2163,8 +2164,9 @@ A jump table for the options with a short description can be found at |Q_op|. is especially important for |ins-autocompletion|. F equivalent to using "F{func}", where the function is taken from the 'completefunc' option. - o equivalent to using "F{func}", where the function is taken from - the 'omnifunc' option. + o equivalent to "F{func}", where {func} is taken from the 'omnifunc' + option. If a plugin (such as an LSP client) defines 'omnifunc', it + can be used through this flag. Unloaded buffers are not loaded, thus their autocmds |:autocmd| are not executed, this may lead to unexpected completions from some files @@ -2179,9 +2181,11 @@ A jump table for the options with a short description can be found at |Q_op|. 5. tags 6. included files - As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'- - based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns - |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions). + CTRL-N, CTRL-P, and |ins-autocompletion| can be used for any + 'iskeyword'-based completion (dictionary |i_CTRL-X_CTRL-K|, included + patterns |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]|, and normal + expansions). With the "F" and "o" flags in 'complete', non-keywords + can also be completed. An optional match limit can be specified for a completion source by appending a caret ("^") followed by a {count} to the source flag. @@ -2298,17 +2302,22 @@ A jump table for the options with a short description can be found at |Q_op|. {only works when compiled with the |+textprop| feature} preinsert - Preinsert the portion of the first candidate word that is - not part of the current completion leader and using the - |hl-ComplMatchIns| highlight group. In order for it to - work, "fuzzy" must not be set and "menuone" must be set. + When 'autocomplete' is not active, inserts the part of the + first candidate word beyond the current completion leader, + highlighted with |hl-PreInsert|. The cursor doesn't move. + Requires "fuzzy" unset and "menuone" in 'completeopt'. + + When 'autocomplete' is active, inserts the longest common + prefix of matches (from all shown items or from the + current buffer items). This occurs only when no menu item + is selected. Press CTRL-Y to accept. preview Show extra information about the currently selected completion in the preview window. Only works in combination with "menu" or "menuone". - Only "fuzzy", "popup", "popuphidden" and "preview" have an effect when - 'autocomplete' is enabled. + Only "fuzzy", "popup", "popuphidden", "preinsert" and "preview" have + an effect when 'autocomplete' is enabled. This option does not apply to |cmdline-completion|. See 'wildoptions' for that. @@ -3059,7 +3068,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'dip'* *'diffopt'* 'diffopt' 'dip' string (default - "internal,filler,closeoff,inline:simple") + "internal,filler,closeoff,indent-heuristic,inline:char") global {not available when compiled without the |+diff| feature} @@ -4654,7 +4663,7 @@ A jump table for the options with a short description can be found at |Q_op|. #:TabLineSel,_:TabLineFill,!:CursorColumn, .:CursorLine,o:ColorColumn,q:QuickFixLine, z:StatusLineTerm,Z:StatusLineTermNC, - g:MsgArea,h:ComplMatchIns") + g:MsgArea,h:ComplMatchIns,I:PreInsert") global This option can be used to set highlighting mode for various occasions. It is a comma-separated list of character pairs. The @@ -4717,6 +4726,7 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-PmenuThumb| X popup menu scrollbar thumb |hl-PmenuMatch| k popup menu matched text |hl-PmenuMatchSel| < popup menu matched text in selected line + |hl-PreInsert| I text inserted when "preinsert" is in 'completeopt' The display modes are: r reverse (termcap entry "mr" and "me") @@ -5079,8 +5089,8 @@ A jump table for the options with a short description can be found at |Q_op|. autocmd. Example: > augroup vimrc-incsearch-highlight autocmd! - autocmd CmdlineEnter /,\? :set hlsearch - autocmd CmdlineLeave /,\? :set nohlsearch + autocmd CmdlineEnter [\/\?] :set hlsearch + autocmd CmdlineLeave [\/\?] :set nohlsearch augroup END < CTRL-L can be used to add one character from after the current match