Skip to content

Commit 528901e

Browse files
authored
Merge pull request #2576 from h-east/update-options
Update options.{txt,jax}
2 parents e983242 + 59c169a commit 528901e

2 files changed

Lines changed: 201 additions & 6 deletions

File tree

doc/options.jax

Lines changed: 101 additions & 3 deletions
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 14
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -4794,7 +4794,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる
47944794
l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,
47954795
a:LineNrAbove,b:LineNrBelow,
47964796
N:CursorLineNr,r:Question,s:StatusLine,
4797-
S:StatusLineNC,c:VertSplit,t:Title,
4797+
S:StatusLineNC,c:VertSplit,
4798+
|:VertSplitNC,t:Title,
47984799
v:Visual,V:VisualNOS,w:WarningMsg,
47994800
W:WildMenu,f:Folded,F:FoldColumn,
48004801
A:DiffAdd,C:DiffChange,D:DiffDelete,
@@ -4843,6 +4844,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる
48434844
|hl-StatusLineNC| S 非カレントウィンドウのステータス行
48444845
|hl-Title| t ":set all", ":autocmd" 等の出力のタイトル
48454846
|hl-VertSplit| c ウィンドウの垂直分割に使われる区切り
4847+
|hl-VertSplitNC| | 非カレントな垂直分割ウィンドウを区切る桁
48464848
|hl-Visual| v ビジュアルモード
48474849
|hl-VisualNOS| V Vim が「セレクションを所有していない」場合のビジュ
48484850
アルモード。X11 Gui の |gui-x11|、
@@ -6243,6 +6245,48 @@ Note 1番目の形式では、行全体がオプション指定に使われる
62436245
NOTE: 'modeline' は、'compatible' がオンになるとViの既定値に設定され、
62446246
'compatible' がオフになるとVimの既定値に設定されるので注意。
62456247

6248+
*'modelinestrict'* *'mlst'* *'nomodelinestrict'* *'nomlst'*
6249+
'modelinestrict' 'mlst' 切替 (既定ではオン)
6250+
グローバル
6251+
有効にすると、|modeline| から設定できるオプションは安全なサブセットの
6252+
みになる。以下のオプションが許可される:
6253+
'autoindent'
6254+
'cindent'
6255+
'commentstring'
6256+
'expandtab'
6257+
'filetype'
6258+
'foldcolumn'
6259+
'foldenable'
6260+
'foldmethod'
6261+
'modifiable'
6262+
'readonly'
6263+
'rightleft'
6264+
'shiftwidth'
6265+
'smartindent'
6266+
'softtabstop'
6267+
'spell'
6268+
'spelllang'
6269+
'tabstop'
6270+
'textwidth'
6271+
'varsofttabstop'
6272+
'vartabstop'
6273+
6274+
モードラインから設定されたその他のオプションは、すべて無視される。
6275+
セキュリティ上の理由から、このオプションは |modeline| または |sandbox|
6276+
内では設定できない。
6277+
6278+
'modeline'、'modelinestrict'、および 'modelineexpr' の動作は以下のとお
6279+
りである:
6280+
6281+
'modeline'| 'modelinestrict'| 'modelineexpr' | 意味
6282+
----------+-----------------+-------------------+--------~
6283+
on | off | on | 全オプションを設定可能
6284+
on | on | any | ホワイトリストに登録され
6285+
| | | たオプションのみ設定可能
6286+
on | off | off | expr オプションを除く全
6287+
| | | オプションを設定可能
6288+
off | any | any | オプションは設定不可
6289+
62466290
*'modifiable'* *'ma'* *'nomodifiable'* *'noma'*
62476291
*E21*
62486292
'modifiable' 'ma' 切替 (既定ではオン)
@@ -8640,10 +8684,64 @@ Note 1番目の形式では、行全体がオプション指定に使われる
86408684
いは非カレントウィンドウのステータス行にはハイライトグループ
86418685
StatusLineNC が適用されることである。数 N は 1 以上 9 以下であ
86428686
る。|hl-User1..9| を参照。
8643-
*stl-%@*
8687+
*stl-%@*
86448688
@ - 改行を挿入する。これは、'statuslineopt' の "maxheight" 値が 1 よ
86458689
り大きい場合、または |tabpanel| の場合にのみ有効である。
86468690

8691+
*stl-%[FuncName]*
8692+
%[ はステータスライン内のクリック可能な領域を定義する。ユーザーがマウ
8693+
スで領域をクリックすると、指定された関数が呼び出される。同じ構文は
8694+
'tabline' でも使用できる。
8695+
8696+
%[FuncName] クリック可能な領域の開始位置。"FuncName" は、その領域
8697+
がクリックされたときに呼び出される Vim の関数の名前で
8698+
ある。
8699+
%[] クリック可能な領域の終了位置。省略した場合、領域はス
8700+
テータスラインの末尾、または次のクリック可能な領域の開
8701+
始位置まで延長される。
8702+
8703+
{minwid} 値を使用すると、識別子をコールバックに渡すことができる:
8704+
%3[FuncName] 最小幅 3 のクリック可能な領域を開始する。
8705+
8706+
この関数は、以下のエントリを含む単一の |Dictionary| 引数を受け取る:
8707+
"minwid" %N[Func] からの minwid 値 (指定されていない場合は 0)。
8708+
"nclicks" クリック数: 1、2、または 3。
8709+
"button" マウスボタン: "l" (左)、"m" (中央)、"r" (右)。
8710+
"mods" 修飾キー: "s" (Shift)、"c" (Ctrl)、"a" (Alt) の組み合
8711+
わせ。修飾キーがない場合は空文字列。
8712+
"winid" ステータスラインがクリックされたウィンドウの
8713+
|window-ID|、またはクリックが 'tabline' 内で行われた場
8714+
合は 0。
8715+
"area" "statusline" または "tabline"。クリックされた領域がど
8716+
ちらのオプションに属するかを示す。'statusline' と
8717+
'tabline' で単一のコールバックが共有されている場合に便
8718+
利である。
8719+
8720+
関数がゼロ以外の値を返した場合、ステータスラインが再描画される。
8721+
ステータスラインをドラッグしてウィンドウのサイズを変更する操作は、ク
8722+
リックハンドラが定義されている場合でも引き続き機能する。'tabline' 内で
8723+
使用される場合、%[FuncName] 領域でのクリックは、デフォルトのタブページ
8724+
選択動作ではなく、コールバックにディスパッチされる。
8725+
8726+
例: >
8727+
func! ClickFile(info)
8728+
if a:info.button ==# 'l' && a:info.nclicks == 2
8729+
browse edit
8730+
endif
8731+
return 0
8732+
endfunc
8733+
set statusline=%[ClickFile]%f%[]\ %l:%c
8734+
< これにより、ステータスラインに表示されるファイル名がクリック可能にな
8735+
る。ダブルクリックするとファイルブラウザーが開く。
8736+
8737+
`has('statusline_click')` を使用して、この機能が使用可能かどうかを確認
8738+
する。これは下位互換性のために役立つ: >
8739+
if has('statusline_click')
8740+
set statusline=%[ClickFile]%f%[]\ %l:%c
8741+
else
8742+
set statusline=%f\ %l:%c
8743+
endif
8744+
<
86478745
フラグを表示するとき、そのフラグがプレーンテキストの直後にあるな
86488746
ら、その先頭にコンマがある場合は削除される。そうすることによって以下の
86498747
例のようなフラグの使い方をしたとき、きれいに表示されるようになっている。

en/options.txt

Lines changed: 100 additions & 3 deletions
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 14
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4757,7 +4757,8 @@ A jump table for the options with a short description can be found at |Q_op|.
47574757
l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,
47584758
a:LineNrAbove,b:LineNrBelow,
47594759
N:CursorLineNr,r:Question,s:StatusLine,
4760-
S:StatusLineNC,c:VertSplit,t:Title,
4760+
S:StatusLineNC,c:VertSplit,
4761+
|:VertSplitNC,t:Title,
47614762
v:Visual,V:VisualNOS,w:WarningMsg,
47624763
W:WildMenu,f:Folded,F:FoldColumn,
47634764
A:DiffAdd,C:DiffChange,D:DiffDelete,
@@ -4805,6 +4806,8 @@ A jump table for the options with a short description can be found at |Q_op|.
48054806
|hl-StatusLineNC| S status lines of not-current windows
48064807
|hl-Title| t Titles for output from ":set all", ":autocmd" etc.
48074808
|hl-VertSplit| c column used to separate vertically split windows
4809+
|hl-VertSplitNC| | column separating non-current vertically split
4810+
windows
48084811
|hl-Visual| v Visual mode
48094812
|hl-VisualNOS| V Visual mode when Vim is "Not Owning the
48104813
Selection" Only X11 Gui's |gui-x11|,
@@ -6196,6 +6199,48 @@ A jump table for the options with a short description can be found at |Q_op|.
61966199
NOTE: 'modeline' is set to the Vi default value when 'compatible' is
61976200
set and to the Vim default value when 'compatible' is reset.
61986201

6202+
*'modelinestrict'* *'mlst'* *'nomodelinestrict'* *'nomlst'*
6203+
'modelinestrict' 'mlst' boolean (default: on)
6204+
global
6205+
When on, only a safe subset of options can be set from a |modeline|.
6206+
The following options are allowed:
6207+
'autoindent'
6208+
'cindent'
6209+
'commentstring'
6210+
'expandtab'
6211+
'filetype'
6212+
'foldcolumn'
6213+
'foldenable'
6214+
'foldmethod'
6215+
'modifiable'
6216+
'readonly'
6217+
'rightleft'
6218+
'shiftwidth'
6219+
'smartindent'
6220+
'softtabstop'
6221+
'spell'
6222+
'spelllang'
6223+
'tabstop'
6224+
'textwidth'
6225+
'varsofttabstop'
6226+
'vartabstop'
6227+
6228+
Any other option set from a modeline will be silently ignored.
6229+
This option cannot be set from a |modeline| or in the |sandbox|, for
6230+
security reasons.
6231+
6232+
The behaviour of 'modeline', 'modelinestrict' and 'modelineexpr' is
6233+
as follows:
6234+
6235+
'modeline'| 'modelinestrict'| 'modelineexpr' | Meaning
6236+
----------+-----------------+-------------------+--------~
6237+
on | off | on | All options can be set
6238+
on | on | any | Only whitelisted
6239+
| | | options can be set
6240+
on | off | off | All options except for
6241+
| | | expr options can be set
6242+
off | any | any | No options can be set
6243+
61996244
*'modifiable'* *'ma'* *'nomodifiable'* *'noma'*
62006245
*E21*
62016246
'modifiable' 'ma' boolean (default on)
@@ -8620,10 +8665,62 @@ A jump table for the options with a short description can be found at |Q_op|.
86208665
applied to StatusLineNC for the statusline of non-current
86218666
windows.
86228667
The number N must be between 1 and 9. See |hl-User1..9|
8623-
*stl-%@*
8668+
*stl-%@*
86248669
@ - Inserts a newline. This only takes effect when the "maxheight"
86258670
value of 'statuslineopt' is greater than 1, or for |tabpanel|.
86268671

8672+
*stl-%[FuncName]*
8673+
%[ defines clickable regions in the statusline. When the user clicks
8674+
on a region with the mouse, the specified function is called. The
8675+
same syntax can also be used in 'tabline'.
8676+
8677+
%[FuncName] Start of a clickable region. "FuncName" is the name
8678+
of a Vim function to call when the region is clicked.
8679+
%[] End of the clickable region. If omitted, the region
8680+
extends to the end of the statusline or to the start
8681+
of the next clickable region.
8682+
8683+
A {minwid} value can be used to pass an identifier to the callback:
8684+
%3[FuncName] Starts a clickable region with minwid 3.
8685+
8686+
The function receives a single |Dictionary| argument with these
8687+
entries:
8688+
"minwid" The minwid value from %N[Func] (0 if not specified).
8689+
"nclicks" Number of clicks: 1, 2, or 3.
8690+
"button" Mouse button: "l" (left), "m" (middle), "r" (right).
8691+
"mods" Modifier keys: combination of "s" (shift), "c" (ctrl),
8692+
"a" (alt). Empty string if no modifiers.
8693+
"winid" |window-ID| of the window whose statusline was clicked,
8694+
or 0 when the click was in 'tabline'.
8695+
"area" "statusline" or "tabline". Indicates which option the
8696+
clicked region belongs to. Useful when a single
8697+
callback is shared between 'statusline' and 'tabline'.
8698+
8699+
If the function returns non-zero, the statusline is redrawn.
8700+
Dragging the statusline to resize the window still works even when
8701+
click handlers are defined. When used in 'tabline', clicks in
8702+
%[FuncName] regions are dispatched to the callback instead of the
8703+
default tab page selection behavior.
8704+
8705+
Example: >
8706+
func! ClickFile(info)
8707+
if a:info.button ==# 'l' && a:info.nclicks == 2
8708+
browse edit
8709+
endif
8710+
return 0
8711+
endfunc
8712+
set statusline=%[ClickFile]%f%[]\ %l:%c
8713+
< This makes the filename in the statusline clickable. Double-clicking
8714+
it opens the file browser.
8715+
8716+
Use `has('statusline_click')` to check if this feature is available.
8717+
This is useful for backward compatibility: >
8718+
if has('statusline_click')
8719+
set statusline=%[ClickFile]%f%[]\ %l:%c
8720+
else
8721+
set statusline=%f\ %l:%c
8722+
endif
8723+
<
86278724
When displaying a flag, Vim removes the leading comma, if any, when
86288725
that flag comes right after plaintext. This will make a nice display
86298726
when flags are used like in the examples below.

0 commit comments

Comments
 (0)