If all your loops are of do/enddo
type only in, say, .f90 files, then you should set a buffer flag with an
autocommand such as >
au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
to get do loops indented in .f90 files and left alone in Fortran files with
other extensions such as .for.
Program units ~
Indenting of program units (subroutines, functions, modules, and program
blocks) can be increased by setting the variable fortran_indent_more and can
be decreased by setting the variable fortran_indent_less. These variables
can be set for all fortran files in your vimrc as follows >
let fortran_indent_less=1
A finer level of control can be achieved by setting the corresponding
buffer-local variable as follows >
let b:fortran_indent_less=1
HTML *ft-html-indent* *html-indent* *html-indenting*
This is about variables you can set in your vimrc to customize HTML indenting.
You can set the indent for the first line after <script> and <style>
"blocktags" (default "zero"): >
:let g:html_indent_script1 = "inc"
:let g:html_indent_style1 = "inc"
<
VALUE MEANING ~
"zero" zero indent
"auto" auto indent (same indent as the blocktag)
"inc" auto indent + one indent step
You can set the indent for attributes after an open <tag line: >
:let g:html_indent_attribute = 1
<
VALUE MEANING ~
1 auto indent, one indent step more than <tag
2 auto indent, two indent steps (default)
> 2 auto indent, more indent steps
Many tags increase the indent for what follows per default (see "Add Indent
Tags" in the script). You can add further tags with: >
:let g:html_indent_inctags = "html,body,head,tbody"
You can also remove such tags with: >
:let g:html_indent_autotags = "th,td,tr,tfoot,thead"
Default value is empty for both variables. Note: the initial "inctags" are
only defined once per Vim session.
User variables are only read when the script is sourced. To enable your
changes during a session, without reloading the HTML file, you can manually
do: >
:call HtmlIndent_CheckUserSettings()
Detail:
Calculation of indent inside "blocktags" with "alien" content:
BLOCKTAG INDENT EXPR WHEN APPLICABLE ~
<script> : {customizable} if first line of block
: cindent(v:lnum) if attributes empty or contain "java"
: -1 else (vbscript, tcl, ...)
<style> : {customizable} if first line of block
: GetCSSIndent() else
<!-- --> : -1
IDRIS2 *ft-idris2-indent*
Idris 2 indentation can be configured with several variables that control the
indentation level for different language constructs:
The "g:idris2_indent_if" variable controls the indentation of `then` and `else`
blocks after `if` statements. Defaults to 3.
The "g:idris2_indent_case" variable controls the indentation of patterns in
`case` expressions. Defaults to 5.
The "g:idris2_indent_let" variable controls the indentation after `let`
bindings. Defaults 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'