diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-27 17:30:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-27 17:30:34 +0100 |
commit | 9fbdbb814f4ad67a14979aba4a6a49800c2f1a99 (patch) | |
tree | cbf6e2990b41ad67092e529497df96bd9199e353 /runtime/doc/indent.txt | |
parent | 26f09ea54b2c60abf21df42c60bdfc60eca17b0d (diff) |
Update runtime files
Diffstat (limited to 'runtime/doc/indent.txt')
-rw-r--r-- | runtime/doc/indent.txt | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 2ebbadbf8a..38c173bce2 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1227,13 +1227,31 @@ comments will be indented according to the correctly indented code. VIM *ft-vim-indent* - *g:vim_indent_cont* -For indenting Vim scripts there is one variable that specifies the amount of -indent for a continuation line, a line that starts with a backslash: > - - :let g:vim_indent_cont = shiftwidth() * 3 + *g:vim_indent* +Vim scripts indentation can be configured with the `g:vim_indent` dictionary +variable. It supports 3 keys, `line_continuation`, `more_in_bracket_block`, +and `searchpair_timeout`. +`line_continuation` expects a number which will be added to the indent level of +a continuation line starting with a backslash, and defaults to +`shiftwidth() * 3`. It also accepts a string, which is evaluated at runtime. +`more_in_bracket_block` expects a boolean value; when on, an extra +`shiftwidth()` is added inside blocks surrounded with brackets. It defaults to +`v:false`. +`searchpair_timeout` expects a number which will be passed to `searchpair()` as +a timeout. Increasing the value might give more accurate results, but also +causes the indentation to take more time. It defaults to 100 (milliseconds). + +Example of configuration: + + let g:vim_indent = #{ + \ line_continuation: shiftwidth() * 3, + \ more_in_bracket_block: v:false, + \ searchpair_timeout: 100, + \ } -Three times shiftwidth is the default value. + *g:vim_indent_cont* +This variable is equivalent to `g:vim_indent.line_continuation`. +It's supported for backward compatibility. vim:tw=78:ts=8:noet:ft=help:norl: |