Skip to content

Commit 1846c5a

Browse files
committed
Update options.{txt,jax}
1 parent a92940c commit 1846c5a

2 files changed

Lines changed: 108 additions & 2 deletions

File tree

doc/options.jax

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim バージョン 9.2. Last change: 2026 Apr 09
1+
*options.txt* For Vim バージョン 9.2. Last change: 2026 Apr 11
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -8644,6 +8644,60 @@ Note 1番目の形式では、行全体がオプション指定に使われる
86448644
@ - 改行を挿入する。これは、'statuslineopt' の "maxheight" 値が 1 よ
86458645
り大きい場合、または |tabpanel| の場合にのみ有効である。
86468646

8647+
*stl-%[FuncName]*
8648+
%[ はステータスライン内のクリック可能な領域を定義する。ユーザーがマウ
8649+
スで領域をクリックすると、指定された関数が呼び出される。同じ構文は
8650+
'tabline' でも使用できる。
8651+
8652+
%[FuncName] クリック可能な領域の開始位置。"FuncName" は、その領域
8653+
がクリックされたときに呼び出される Vim の関数の名前で
8654+
ある。
8655+
%[] クリック可能な領域の終了位置。省略した場合、領域はス
8656+
テータスラインの末尾、または次のクリック可能な領域の開
8657+
始位置まで延長される。
8658+
8659+
{minwid} 値を使用すると、識別子をコールバックに渡すことができる:
8660+
%3[FuncName] 最小幅 3 のクリック可能な領域を開始する。
8661+
8662+
この関数は、以下のエントリを含む単一の |Dictionary| 引数を受け取る:
8663+
"minwid" %N[Func] からの minwid 値 (指定されていない場合は 0 )。
8664+
"nclicks" クリック数: 1、2、または 3。
8665+
"button" マウスボタン: "l" (左), "m" (中央), "r" (右)。
8666+
"mods" 修飾キー: "s" (Shift)、"c" (Ctrl)、"a" (Alt) の組み合
8667+
わせ。修飾キーがない場合は空文字列。
8668+
"winid" ステータスラインがクリックされたウィンドウの
8669+
|window-ID|、またはクリックが 'tabline' 内で行われた場
8670+
合は 0。
8671+
"area" "statusline" または "tabline"。クリックされた領域がど
8672+
ちらのオプションに属するかを示す。'statusline' と
8673+
'tabline' で単一のコールバックが共有されている場合に便
8674+
利である。
8675+
8676+
関数がゼロ以外の値を返した場合、ステータスラインが再描画される。
8677+
ステータスラインをドラッグしてウィンドウのサイズを変更する操作は、ク
8678+
リックハンドラが定義されている場合でも引き続き機能する。'tabline' 内で
8679+
使用される場合、%[FuncName] 領域でのクリックは、デフォルトのタブページ
8680+
選択動作ではなく、コールバックにディスパッチされる。
8681+
8682+
例: >
8683+
func! ClickFile(info)
8684+
if a:info.button ==# 'l' && a:info.nclicks == 2
8685+
browse edit
8686+
endif
8687+
return 0
8688+
endfunc
8689+
set statusline=%[ClickFile]%f%[]\ %l:%c
8690+
< これにより、ステータスラインに表示されるファイル名がクリック可能にな
8691+
る。ダブルクリックするとファイルブラウザが開く。
8692+
8693+
`has('statusline_click')` を使用して、この機能が使用可能かどうかを確認
8694+
する。これは下位互換性のために役立つ: >
8695+
if has('statusline_click')
8696+
set statusline=%[ClickFile]%f%[]\ %l:%c
8697+
else
8698+
set statusline=%f\ %l:%c
8699+
endif
8700+
<
86478701
フラグを表示するとき、そのフラグがプレーンテキストの直後にあるな
86488702
ら、その先頭にコンマがある場合は削除される。そうすることによって以下の
86498703
例のようなフラグの使い方をしたとき、きれいに表示されるようになっている。

en/options.txt

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.2. Last change: 2026 Apr 09
1+
*options.txt* For Vim version 9.2. Last change: 2026 Apr 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -8624,6 +8624,58 @@ A jump table for the options with a short description can be found at |Q_op|.
86248624
@ - Inserts a newline. This only takes effect when the "maxheight"
86258625
value of 'statuslineopt' is greater than 1, or for |tabpanel|.
86268626

8627+
*stl-%[FuncName]*
8628+
%[ defines clickable regions in the statusline. When the user clicks
8629+
on a region with the mouse, the specified function is called. The
8630+
same syntax can also be used in 'tabline'.
8631+
8632+
%[FuncName] Start of a clickable region. "FuncName" is the name
8633+
of a Vim function to call when the region is clicked.
8634+
%[] End of the clickable region. If omitted, the region
8635+
extends to the end of the statusline or to the start
8636+
of the next clickable region.
8637+
8638+
A {minwid} value can be used to pass an identifier to the callback:
8639+
%3[FuncName] Starts a clickable region with minwid 3.
8640+
8641+
The function receives a single |Dictionary| argument with these
8642+
entries:
8643+
"minwid" The minwid value from %N[Func] (0 if not specified).
8644+
"nclicks" Number of clicks: 1, 2, or 3.
8645+
"button" Mouse button: "l" (left), "m" (middle), "r" (right).
8646+
"mods" Modifier keys: combination of "s" (shift), "c" (ctrl),
8647+
"a" (alt). Empty string if no modifiers.
8648+
"winid" |window-ID| of the window whose statusline was clicked,
8649+
or 0 when the click was in 'tabline'.
8650+
"area" "statusline" or "tabline". Indicates which option the
8651+
clicked region belongs to. Useful when a single
8652+
callback is shared between 'statusline' and 'tabline'.
8653+
8654+
If the function returns non-zero, the statusline is redrawn.
8655+
Dragging the statusline to resize the window still works even when
8656+
click handlers are defined. When used in 'tabline', clicks in
8657+
%[FuncName] regions are dispatched to the callback instead of the
8658+
default tab-selection behavior.
8659+
8660+
Example: >
8661+
func! ClickFile(info)
8662+
if a:info.button ==# 'l' && a:info.nclicks == 2
8663+
browse edit
8664+
endif
8665+
return 0
8666+
endfunc
8667+
set statusline=%[ClickFile]%f%[]\ %l:%c
8668+
< This makes the filename in the statusline clickable. Double-clicking
8669+
it opens the file browser.
8670+
8671+
Use `has('statusline_click')` to check if this feature is available.
8672+
This is useful for backward compatibility: >
8673+
if has('statusline_click')
8674+
set statusline=%[ClickFile]%f%[]\ %l:%c
8675+
else
8676+
set statusline=%f\ %l:%c
8677+
endif
8678+
<
86278679
When displaying a flag, Vim removes the leading comma, if any, when
86288680
that flag comes right after plaintext. This will make a nice display
86298681
when flags are used like in the examples below.

0 commit comments

Comments
 (0)