Home Explore Blog CI



neovim

13th chunk of `runtime/doc/indent.txt`
fdc0175adca644c95254c4ef62f23f96ccc243ade960c1c90000000100000ee0
 a larger timeout in msec: >
	let g:python_indent.searchpair_timeout = 500

If looking back for unclosed parenthesis is still too slow, especially during
a copy-paste operation, or if you don't need indenting inside multi-line
parentheses, you can completely disable this feature: >
	let g:python_indent.disable_parentheses_indenting = 1

For backward compatibility, these variables are also supported: >
	g:pyindent_open_paren
	g:pyindent_nested_paren
	g:pyindent_continue
	g:pyindent_searchpair_timeout
	g:pyindent_disable_parentheses_indenting


R								*ft-r-indent*

Function arguments are aligned if they span for multiple lines. If you prefer
do not have the arguments of functions aligned, put in your |vimrc|:
>
   let r_indent_align_args = 0
<
All lines beginning with a comment character, #, get the same indentation
level of the normal R code. Users of Emacs/ESS may be used to have lines
beginning with a single # indented in the 40th column, ## indented as R code,
and ### not indented. If you prefer that lines beginning with comment
characters are aligned as they are by Emacs/ESS, put in your |vimrc|:
>
   let r_indent_ess_comments = 1
<
If you prefer that lines beginning with a single # are aligned at a column
different from the 40th one, you should set a new value to the variable
r_indent_comment_column, as in the example below:
>
   let r_indent_comment_column = 30
<
Any code after a line that ends with "<-" is indented. Emacs/ESS does not
indent the code if it is a top-level function. If you prefer a behavior like
Emacs/ESS one in this regard, put in your |vimrc|:
>
   let r_indent_ess_compatible = 1
<
Below is an example of indentation with and without this option enabled:
>
   ### r_indent_ess_compatible = 1           ### r_indent_ess_compatible = 0
   foo <-                                    foo <-
       function(x)                               function(x)
   {                                             {
       paste(x)                                      paste(x)
   }                                             }
<
The code will be indented after lines that match the pattern
`'\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$'`. If you want indentation after
lines that match a different pattern, you should set the appropriate value of
`r_indent_op_pattern` in your |vimrc|.


SHELL							*ft-sh-indent*

The amount of indent applied under various circumstances in a shell file can
be configured by setting the following keys in the |Dictionary|
b:sh_indent_defaults to a specific amount or to a |Funcref| that references a
function that will return the amount desired:

b:sh_indent_options["default"]	Default amount of indent.

b:sh_indent_options["continuation-line"]
				Amount of indent to add to a continued line.

b:sh_indent_options["case-labels"]
				Amount of indent to add for case labels.
				(not actually implemented)

b:sh_indent_options["case-statements"]
				Amount of indent to add for case statements.

b:sh_indent_options["case-breaks"]
				Amount of indent to add (or more likely
				remove) for case breaks.

VERILOG							*ft-verilog-indent*

General block statements such as if, for, case, always, initial, function,
specify and begin, etc., are indented.  The module block statements (first
level blocks) are not indented by default.  you can turn on the indent with
setting a variable in the vimrc as follows: >

  let b:verilog_indent_modules = 1

then the module blocks will be indented.  To stop this, remove the variable: >

  :unlet b:verilog_indent_modules

To set the variable only for Verilog file.  The following statements can be
used: >

  au BufReadPost * if exists("b:current_syntax")
  au BufReadPost *   if b:current_syntax == "verilog"
  au BufReadPost *     let b:verilog_indent_modules = 1
  au BufReadPost *   endif
  au

Title: Python, R, Shell, and Verilog Indentation Configuration
Summary
This section describes configuration options for indentation in Python, R, Shell, and Verilog files within Vim. For Python, it covers disabling or adjusting the timeout for parenthesis indentation and mentions backward compatibility variables. The R section focuses on aligning function arguments, handling comments like Emacs/ESS, and controlling indentation after specific operators. Shell indentation is customized by setting values in the 'b:sh_indent_defaults' dictionary. Verilog indentation allows for indenting module block statements by setting and unsetting the 'b:verilog_indent_modules' variable.