|
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 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | 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|. |
4757 | 4757 | l:Search,m:MoreMsg,M:ModeMsg,n:LineNr, |
4758 | 4758 | a:LineNrAbove,b:LineNrBelow, |
4759 | 4759 | N:CursorLineNr,r:Question,s:StatusLine, |
4760 | | - S:StatusLineNC,c:VertSplit,t:Title, |
| 4760 | + S:StatusLineNC,c:VertSplit, |
| 4761 | + |:VertSplitNC,t:Title, |
4761 | 4762 | v:Visual,V:VisualNOS,w:WarningMsg, |
4762 | 4763 | W:WildMenu,f:Folded,F:FoldColumn, |
4763 | 4764 | 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|. |
4805 | 4806 | |hl-StatusLineNC| S status lines of not-current windows |
4806 | 4807 | |hl-Title| t Titles for output from ":set all", ":autocmd" etc. |
4807 | 4808 | |hl-VertSplit| c column used to separate vertically split windows |
| 4809 | + |hl-VertSplitNC| | column separating non-current vertically split |
| 4810 | + windows |
4808 | 4811 | |hl-Visual| v Visual mode |
4809 | 4812 | |hl-VisualNOS| V Visual mode when Vim is "Not Owning the |
4810 | 4813 | 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|. |
6196 | 6199 | NOTE: 'modeline' is set to the Vi default value when 'compatible' is |
6197 | 6200 | set and to the Vim default value when 'compatible' is reset. |
6198 | 6201 |
|
| 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 | + |
6199 | 6244 | *'modifiable'* *'ma'* *'nomodifiable'* *'noma'* |
6200 | 6245 | *E21* |
6201 | 6246 | '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|. |
8620 | 8665 | applied to StatusLineNC for the statusline of non-current |
8621 | 8666 | windows. |
8622 | 8667 | The number N must be between 1 and 9. See |hl-User1..9| |
8623 | | - *stl-%@* |
| 8668 | + *stl-%@* |
8624 | 8669 | @ - Inserts a newline. This only takes effect when the "maxheight" |
8625 | 8670 | value of 'statuslineopt' is greater than 1, or for |tabpanel|. |
8626 | 8671 |
|
| 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 | +< |
8627 | 8724 | When displaying a flag, Vim removes the leading comma, if any, when |
8628 | 8725 | that flag comes right after plaintext. This will make a nice display |
8629 | 8726 | when flags are used like in the examples below. |
|
0 commit comments