Home Explore Blog CI



neovim

11th chunk of `runtime/doc/indent.txt`
09f373ea61d1fba399fb2d1167b77692b654e26972d0dfcd0000000100000fa0
 to 4.

The "g:idris2_indent_rewrite" variable controls the indentation after `rewrite`
expressions. Defaults to 8.

The "g:idris2_indent_where" variable controls the indentation of `where`
blocks. Defaults to 6.

The "g:idris2_indent_do" variable controls the indentation in `do` blocks.
Defaults to 3.

Example configuration: >

	let g:idris2_indent_if = 2
	let g:idris2_indent_case = 4
	let g:idris2_indent_let = 4
	let g:idris2_indent_rewrite = 8
	let g:idris2_indent_where = 6
	let g:idris2_indent_do = 3
<

MATLAB			*ft-matlab-indent* *matlab-indent* *matlab-indenting*

The setting Function indenting format in MATLAB Editor/Debugger Language
Preferences corresponds to: >
    :let g:MATLAB_function_indent = {0, 1 or 2 (default)}

Where 0 is for Classic, 1 for Indent nested functions and 2 for Indent all
functions.


PHP				*ft-php-indent* *php-indent* *php-indenting*

NOTE:	PHP files will be indented correctly only if PHP |syntax| is active.

If you are editing a file in Unix 'fileformat' and '\r' characters are present
before new lines, indentation won't proceed correctly ; you have to remove
those useless characters first with a command like: >

    :%s /\r$//g

Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the
script will silently remove them when Vim loads a PHP file (at each |BufRead|).

OPTIONS: ~

PHP indenting can be altered in several ways by modifying the values of some
global variables:

					*php-comment* *PHP_autoformatcomment*
To not enable auto-formatting of comments by default (if you want to use your
own 'formatoptions'): >
    :let g:PHP_autoformatcomment = 0

Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be
added, see |fo-table| for more information.


							*PHP_outdentSLComments*
To add extra indentation to single-line comments: >
    :let g:PHP_outdentSLComments = N

With N being the number of 'shiftwidth' to add.

Only single-line comments will be affected such as: >
    # Comment
    // Comment
    /* Comment */
<

							*PHP_default_indenting*
To add extra indentation to every PHP lines with N being the number of
'shiftwidth' to add: >
    :let g:PHP_default_indenting = N

For example, with N = 1, this will give:
>
    <?php
	if (!isset($History_lst_sel))
	    if (!isset($History_lst_sel))
		if (!isset($History_lst_sel)) {
		    $History_lst_sel=0;
		} else
		    $foo="bar";

	$command_hist = TRUE;
    ?>
(Notice the extra indentation between the PHP container markers and the code)

							*PHP_outdentphpescape*
To indent PHP escape tags as the surrounding non-PHP code (only affects the
PHP escape tags): >
    :let g:PHP_outdentphpescape = 0
<

							*PHP_removeCRwhenUnix*
To automatically remove '\r' characters when the 'fileformat' is set to Unix: >
    :let g:PHP_removeCRwhenUnix = 1
<

							*PHP_BracesAtCodeLevel*
To indent braces at the same level than the code they contain: >
    :let g:PHP_BracesAtCodeLevel = 1

This will give the following result: >
    if ($foo)
	{
	foo();
	}
Instead of: >
    if ($foo)
    {
	foo();
    }

NOTE:	Indenting will be a bit slower if this option is used because some
	optimizations won't be available.

					*PHP_vintage_case_default_indent*
To indent 'case:' and 'default:' statements in switch() blocks: >
    :let g:PHP_vintage_case_default_indent = 1

In PHP braces are not required inside 'case/default' blocks therefore 'case:'
and 'default:' are indented at the same level than the 'switch()' to avoid
meaningless indentation. You can use the above option to return to the
traditional way.

							*PHP_noArrowMatching*
By default the indent script will indent multi-line chained calls by matching
the position of the '->': >

    $user_name_very_long->name()
                        ->age()
                        ->info();
<
You can revert to the classic way of indenting by setting this option to 1: >
    :let g:PHP_noArrowMatching = 1
<
You will obtain the following result: >

    $user_name_very_long->name()
 

Title: Idris2, Matlab and PHP Indentation Options
Summary
This section details indentation options for Idris2, Matlab, and PHP in Vim. It covers Idris2 indentation control using variables such as 'idris2_indent_if', 'idris2_indent_case', 'idris2_indent_rewrite', 'idris2_indent_where' and 'idris2_indent_do'. It also mentions Matlab indentation settings through the 'MATLAB_function_indent' variable. The majority of the content pertains to PHP, describing how to handle Unix line endings, disable auto-formatting of comments, add extra indentation to single-line comments or every PHP line, manage indentation of PHP escape tags and braces, handle case/default statements, and control indentation of multi-line chained calls.