annotate runtime/doc/indent.txt @ 31182:645c854bbf74 v9.0.0925

patch 9.0.0925: two conditions are always false Commit: https://github.com/vim/vim/commit/df3c0eb41e1f48596c85af88b42fed22e3cca328 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Nov 23 11:23:17 2022 +0000 patch 9.0.0925: two conditions are always false Problem: Two conditions are always false. Solution: Remove the conditions. Update return value types to make clear what could be returned. (closes #11593)
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Nov 2022 12:30:04 +0100
parents 3295247d97a5
children 88cad94caef9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
1 *indent.txt* For Vim version 9.0. Last change: 2022 Oct 10
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 This file is about indenting C programs and other files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
9 1. Indenting C style programs |C-indenting|
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 2. Indenting by expression |indent-expression|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 ==============================================================================
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
13 1. Indenting C style programs *C-indenting*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
15 The basics for C style indenting are explained in section |30.2| of the user
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
16 manual.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
18 Vim has options for automatically indenting C style program files. Many
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
19 programming languages including Java and C++ follow very closely the
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
20 formatting conventions established with C. These options affect only the
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
21 indent and do not perform other formatting. There are additional options that
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
22 affect other kinds of formatting as well as indenting, see |format-comments|,
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
23 |fo-table|, |gq| and |formatting| for the main ones.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
25 There are in fact four main methods available for indentation, each one
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
26 overrides the previous if it is enabled, or non-empty for 'indentexpr':
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 'autoindent' uses the indent from the previous line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 'smartindent' is like 'autoindent' but also recognizes some C syntax to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 increase/reduce the indent where appropriate.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 'cindent' Works more cleverly than the other two and is configurable to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 different indenting styles.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 'indentexpr' The most flexible of all: Evaluates an expression to compute
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 the indent of a line. When non-empty this method overrides
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 the other ones. See |indent-expression|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 The rest of this section describes the 'cindent' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 Note that 'cindent' indenting does not work for every code scenario. Vim
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
38 is not a C compiler: it does not recognize all syntax. One requirement is
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
39 that toplevel functions have a '{' in the first column. Otherwise they are
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
40 easily confused with declarations.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 27492
diff changeset
42 These five options control C program indenting:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 'cindent' Enables Vim to perform C program indenting automatically.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 'cinkeys' Specifies which keys trigger reindenting in insert mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 'cinoptions' Sets your preferred indent style.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 'cinwords' Defines keywords that start an extra indent in the next line.
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 27492
diff changeset
47 'cinscopedecls' Defines strings that are recognized as a C++ scope declaration.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 Vim's built-in algorithm rather than calling an external program.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 See |autocommand| for how to set the 'cindent' option automatically for C code
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 files and reset it for others.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 *cinkeys-format* *indentkeys-format*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 The 'cinkeys' option is a string that controls Vim's indenting in response to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 typing certain characters or commands in certain contexts. Note that this not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 only triggers C-indenting. When 'indentexpr' is not empty 'indentkeys' is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 used instead. The format of 'cinkeys' and 'indentkeys' is equal.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
15701
9cd11f6beb70 patch 8.1.0858: 'indentkeys' and 'cinkeys' defaults are different
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
61 The default is "0{,0},0),0],:,0#,!^F,o,O,e" which specifies that indenting
9cd11f6beb70 patch 8.1.0858: 'indentkeys' and 'cinkeys' defaults are different
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
62 occurs as follows:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 "0{" if you type '{' as the first character in a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 "0}" if you type '}' as the first character in a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 "0)" if you type ')' as the first character in a line
15701
9cd11f6beb70 patch 8.1.0858: 'indentkeys' and 'cinkeys' defaults are different
Bram Moolenaar <Bram@vim.org>
parents: 15033
diff changeset
67 "0]" if you type ']' as the first character in a line
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 ":" if you type ':' after a label or case statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 "0#" if you type '#' as the first character in a line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 "!^F" if you type CTRL-F (which is not inserted)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 "o" if you type a <CR> anywhere or use the "o" command (not in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 insert mode!)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 "O" if you use the "O" command (not in insert mode!)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 "e" if you type the second 'e' for an "else" at the start of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
818
1f929f3ca806 updated for version 7.0c03
vimboss
parents: 810
diff changeset
77 Characters that can precede each key: *i_CTRL-F*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 ! When a '!' precedes the key, Vim will not insert the key but will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 instead reindent the current line. This allows you to define a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 command key for reindenting the current line. CTRL-F is the default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 key for this. Be careful if you define CTRL-I for this because CTRL-I
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 is the ASCII code for <Tab>.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 * When a '*' precedes the key, Vim will reindent the line before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 inserting the key. If 'cinkeys' contains "*<Return>", Vim reindents
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 the current line before opening a new line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 0 When a zero precedes the key (but appears after '!' or '*') Vim will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 reindent the line only if the key is the first character you type in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 the line. When used before "=" Vim will only reindent the line if
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 there is only white space before the word.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 When neither '!' nor '*' precedes the key, Vim reindents the line after you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 type the key. So ';' sets the indentation of a line which includes the ';'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 Special key names:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 <> Angle brackets mean spelled-out names of keys. For example: "<Up>",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 "<Ins>" (see |key-notation|).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 ^ Letters preceded by a caret (^) are control characters. For example:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 "^F" is CTRL-F.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 o Reindent a line when you use the "o" command or when Vim opens a new
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 line below the current one (e.g., when you type <Enter> in insert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 mode).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 O Reindent a line when you use the "O" command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 e Reindent a line that starts with "else" when you type the second 'e'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 : Reindent a line when a ':' is typed which is after a label or case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 statement. Don't reindent for a ":" in "class::method" for C++. To
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 Reindent for any ":", use "<:>".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 =word Reindent when typing the last character of "word". "word" may
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 actually be part of another word. Thus "=end" would cause reindenting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 when typing the "d" in "endif" or "endwhile". But not when typing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 "bend". Also reindent when completion produces a word that starts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 with "word". "0=word" reindents when there is only white space before
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 the word.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 =~word Like =word, but ignore case.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 If you really want to reindent when you type 'o', 'O', 'e', '0', '<', '>',
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 '*', ':' or '!', use "<o>", "<O>", "<e>", "<0>", "<<>", "<>>", "<*>", "<:>" or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 "<!>", respectively, for those keys.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 For an emacs-style indent mode where lines aren't indented every time you
1247
ac4972c657bd updated for version 7.1
vimboss
parents: 1201
diff changeset
120 press <Enter> but only if you press <Tab>, I suggest:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 :set cinkeys=0{,0},:,0#,!<Tab>,!^F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 You might also want to switch off 'autoindent' then.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 Note: If you change the current line's indentation manually, Vim ignores the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 cindent settings for that line. This prevents vim from reindenting after you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 have changed the indent by typing <BS>, <Tab>, or <Space> in the indent or
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 used CTRL-T or CTRL-D.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 *cinoptions-values*
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
130 The 'cinoptions' option sets how Vim performs indentation. The value after
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
131 the option character can be one of these (N is any number):
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
132 N indent N spaces
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
133 -N indent N spaces to the left
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
134 Ns N times 'shiftwidth' spaces
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
135 -Ns N times 'shiftwidth' spaces to the left
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
136
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
137 In the list below,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 "N" represents a number of your choice (the number can be negative). When
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 "1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc. You can use a
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
141 decimal point, too: "-0.5s" is minus half a 'shiftwidth'.
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
142 The examples below assume a 'shiftwidth' of 4.
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
143 *cino->*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 >N Amount added for "normal" indent. Used after a line that should
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 increase the indent (lines starting with "if", an opening brace,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 etc.). (default 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 cino= cino=>2 cino=>2s >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 if (cond) if (cond) if (cond)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 foo; foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
154 *cino-e*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 eN Add N to the prevailing indent inside a set of braces if the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 opening brace at the End of the line (more precise: is not the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 first character in a line). This is useful if you want a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 different indent when the '{' is at the start of the line from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 when '{' is at the end of the line. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 cino= cino=e2 cino=e-2 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 if (cond) { if (cond) { if (cond) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 foo; foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 else else else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 bar; bar; bar;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
170 *cino-n*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 nN Add N to the prevailing indent for a statement after an "if",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 "while", etc., if it is NOT inside a set of braces. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 useful if you want a different indent when there is no '{'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 before the statement from when there is a '{' before it.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 cino= cino=n2 cino=n-2 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 if (cond) if (cond) if (cond)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 foo; foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 else else else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 bar; bar; bar;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
185 *cino-f*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 fN Place the first opening brace of a function or other block in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 column N. This applies only for an opening brace that is not
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 inside other braces and is at the start of the line. What comes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 after the brace is put relative to this brace. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 cino= cino=f.5s cino=f1s >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 func() func() func()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 int foo; int foo; int foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
196 *cino-{*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 {N Place opening braces N characters from the prevailing indent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 This applies only for opening braces that are inside other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 braces. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 cino= cino={.5s cino={1s >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 if (cond) if (cond) if (cond)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 foo; foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
206 *cino-}*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 }N Place closing braces N characters from the matching opening
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 brace. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 cino= cino={2,}-0.5s cino=}2 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 if (cond) if (cond) if (cond)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 foo; foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
216 *cino-^*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 ^N Add N to the prevailing indent inside a set of braces if the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 opening brace is in column 0. This can specify a different
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 indent for whole of a function (some may like to set it to a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 negative number). (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 cino= cino=^-2 cino=^-s >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 func() func() func()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 if (cond) if (cond) if (cond)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 { { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 a = b; a = b; a = b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 } } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
231 *cino-L*
2328
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
232 LN Controls placement of jump labels. If N is negative, the label
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
233 will be placed at column 1. If N is non-negative, the indent of
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
234 the label will be the prevailing indent minus N. (default -1).
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
235
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
236 cino= cino=L2 cino=Ls >
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
237 func() func() func()
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
238 { { {
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
239 { { {
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
240 stmt; stmt; stmt;
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
241 LABEL: LABEL: LABEL:
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
242 } } }
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
243 } } }
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
244 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
245 *cino-:*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 :N Place case labels N characters from the indent of the switch().
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 (default 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 cino= cino=:0 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 switch (x) switch(x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 case 1: case 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 a = b; a = b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 default: default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
257 *cino-=*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 =N Place statements occurring after a case label N characters from
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 the indent of the label. (default 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 cino= cino==10 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 case 11: case 11: a = a + 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 a = a + 1; b = b + 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
265 *cino-l*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 lN If N != 0 Vim will align with a case label instead of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 statement after it in the same line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 cino= cino=l1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 switch (a) { switch (a) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 case 1: { case 1: {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 break; break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
275 *cino-b*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 bN If N != 0 Vim will align a final "break" with the case label,
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
277 so that case..break looks like a sort of block. (default: 0).
2662
916c90b37ea9 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2577
diff changeset
278 When using 1, consider adding "0=break" to 'cinkeys'.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 cino= cino=b1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 switch (x) switch(x)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 case 1: case 1:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 a = b; a = b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 break; break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 default: default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 a = 0; a = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 break; break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
292 *cino-g*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 gN Place C++ scope declarations N characters from the indent of the
29290
dc4de65a7fb7 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 28956
diff changeset
294 block they are in. (default 'shiftwidth'). By default, a scope
28353
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 27492
diff changeset
295 declaration is "public:", "protected:" or "private:". This can
8bc8071928ed patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents: 27492
diff changeset
296 be adjusted with the 'cinscopedecls' option.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 cino= cino=g0 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 public: public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 a = b; a = b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 private: private:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 } }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
305 *cino-h*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 hN Place statements occurring after a C++ scope declaration N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 characters from the indent of the label. (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 cino= cino=h10 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 public: public: a = a + 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 a = a + 1; b = b + 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
314 *cino-N*
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
315 NN Indent inside C++ namespace N characters extra compared to a
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
316 normal block. (default 0).
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
317
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
318 cino= cino=N-s >
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
319 namespace { namespace {
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
320 void function(); void function();
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
321 } }
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
322
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
323 namespace my namespace my
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
324 { {
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
325 void function(); void function();
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
326 } }
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
327 <
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
328 *cino-E*
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
329 EN Indent inside C++ linkage specifications (extern "C" or
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
330 extern "C++") N characters extra compared to a normal block.
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
331 (default 0).
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
332
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
333 cino= cino=E-s >
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
334 extern "C" { extern "C" {
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
335 void function(); void function();
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
336 } }
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
337
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
338 extern "C" extern "C"
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
339 { {
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
340 void function(); void function();
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
341 } }
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
342 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
343 *cino-p*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 pN Parameter declarations for K&R-style function declarations will
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 be indented N characters from the margin. (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 cino= cino=p0 cino=p2s >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 func(a, b) func(a, b) func(a, b)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 int a; int a; int a;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 char b; char b; char b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
353 *cino-t*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 tN Indent a function return type declaration N characters from the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 margin. (default 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 cino= cino=t0 cino=t7 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 int int int
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 func() func() func()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
361 *cino-i*
843
9f279ebda751 updated for version 7.0f01
vimboss
parents: 842
diff changeset
362 iN Indent C++ base class declarations and constructor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 initializations, if they start in a new line (otherwise they
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 are aligned at the right side of the ':').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 (default 'shiftwidth').
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 cino= cino=i0 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 class MyClass : class MyClass :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 public BaseClass public BaseClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 {} {}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 MyClass::MyClass() : MyClass::MyClass() :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 BaseClass(3) BaseClass(3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 {} {}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
375 *cino-+*
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2698
diff changeset
376 +N Indent a continuation line (a line that spills onto the next)
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2698
diff changeset
377 inside a function N additional characters. (default
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2698
diff changeset
378 'shiftwidth').
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2698
diff changeset
379 Outside of a function, when the previous line ended in a
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2698
diff changeset
380 backslash, the 2 * N is used.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 cino= cino=+10 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 a = b + 9 * a = b + 9 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 c; c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
386 *cino-c*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 cN Indent comment lines after the comment opener, when there is no
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 other text with which to align, N characters from the comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 opener. (default 3). See also |format-comments|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 cino= cino=c5 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 /* /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 text. text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 */ */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
396 *cino-C*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 CN When N is non-zero, indent comment lines by the amount specified
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 with the c flag above even if there is other text behind the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 comment opener. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 cino=c0 cino=c0,C1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 /******** /********
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 text. text.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 ********/ ********/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 < (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
407 *cino-/*
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
408 /N Indent comment lines N characters extra. (default 0).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 cino= cino=/4 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 a = b; a = b;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 /* comment */ /* comment */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 c = d; c = d;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
414 *cino-(*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 (N When in unclosed parentheses, indent N characters from the line
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
416 with the unclosed parenthesis. Add a 'shiftwidth' for every
13589
1073225cb749 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
417 extra unclosed parentheses. When N is 0 or the unclosed
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
418 parenthesis is the first non-white character in its line, line
13589
1073225cb749 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
419 up with the next non-white character after the unclosed
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
420 parenthesis. (default 'shiftwidth' * 2).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 cino= cino=(0 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 if (c1 && (c2 || if (c1 && (c2 ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 c3)) c3))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 if (c1 && if (c1 &&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 (c2 || c3)) (c2 || c3))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 { {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
430 *cino-u*
13589
1073225cb749 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
431 uN Same as (N, but for one nesting level deeper.
1073225cb749 Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11087
diff changeset
432 (default 'shiftwidth').
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 cino= cino=u2 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 if (c123456789 if (c123456789
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 && (c22345 && (c22345
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 || c3)) || c3))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
439 *cino-U*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 UN When N is non-zero, do not ignore the indenting specified by
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
441 ( or u in case that the unclosed parenthesis is the first
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 non-white character in its line. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 cino= or cino=(s cino=(s,U1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 c = c1 && c = c1 &&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 ( (
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 c2 || c2 ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 c3 c3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 ) && c4; ) && c4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 <
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
451 *cino-w*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 wN When in unclosed parentheses and N is non-zero and either
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 using "(0" or "u0", respectively, or using "U0" and the unclosed
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
454 parenthesis is the first non-white character in its line, line
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
455 up with the character immediately after the unclosed parenthesis
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 rather than the first non-white character. (default 0).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 cino=(0 cino=(0,w1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 if ( c1 if ( c1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 && ( c2 && ( c2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 || c3)) || c3))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
464 *cino-W*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 WN When in unclosed parentheses and N is non-zero and either
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
466 using "(0" or "u0", respectively and the unclosed parenthesis is
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 the last non-white character in its line and it is not the
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
468 closing parenthesis, indent the following line N characters
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 relative to the outer context (i.e. start of the line or the
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
470 next unclosed parenthesis). (default: 0).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 cino=(0 cino=(0,W4 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 a_long_line( a_long_line(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 argument, argument,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 argument); argument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 a_short_line(argument, a_short_line(argument,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 argument); argument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 <
3454
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
479 *cino-k*
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
480 kN When in unclosed parentheses which follow "if", "for" or
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
481 "while" and N is non-zero, overrides the behaviour defined by
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
482 "(N": causes the indent to be N characters relative to the outer
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
483 context (i.e. the line where "if", "for" or "while" is). Has
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
484 no effect on deeper levels of nesting. Affects flags like "wN"
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
485 only for the "if", "for" and "while" conditions. If 0, defaults
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
486 to behaviour defined by the "(N" flag. (default: 0).
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
487
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
488 cino=(0 cino=(0,ks >
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
489 if (condition1 if (condition1
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
490 && condition2) && condition2)
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
491 action(); action();
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
492 function(argument1 function(argument1
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
493 && argument2); && argument2);
214c7ec1c8f9 updated for version 7.3.492
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
494 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
495 *cino-m*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 mN When N is non-zero, line up a line starting with a closing
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
497 parenthesis with the first character of the line with the
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
498 matching opening parenthesis. (default 0).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 cino=(s cino=(s,m1 >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 c = c1 && ( c = c1 && (
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 c2 || c2 ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 c3 c3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 ) && c4; ) && c4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 if ( if (
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 c1 && c2 c1 && c2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 ) )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 foo; foo;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
510 *cino-M*
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
511 MN When N is non-zero, line up a line starting with a closing
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
512 parenthesis with the first character of the previous line.
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
513 (default 0).
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
514
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
515 cino= cino=M1 >
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
516 if (cond1 && if (cond1 &&
856
8cd729851562 updated for version 7.0g
vimboss
parents: 843
diff changeset
517 cond2 cond2
8cd729851562 updated for version 7.0g
vimboss
parents: 843
diff changeset
518 ) )
829
dc8197342755 updated for version 7.0d04
vimboss
parents: 825
diff changeset
519 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
520 *java-cinoptions* *java-indenting* *cino-j*
2965
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
521 jN Indent Java anonymous classes correctly. Also works well for
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
522 Javascript. The value 'N' is currently unused but must be
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
523 non-zero (e.g. 'j1'). 'j1' will indent for example the
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
524 following code snippet correctly: >
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 object.add(new ChangeListener() {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 public void stateChanged(ChangeEvent e) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 do_something();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 });
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
532 *javascript-cinoptions* *javascript-indenting* *cino-J*
2297
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
533 JN Indent JavaScript object declarations correctly by not confusing
18831
6848b809a26e Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18343
diff changeset
534 them with labels. The value 'N' is currently unused but must be
2965
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
535 non-zero (e.g. 'J1'). If you enable this you probably also want
f2de38a019a2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2908
diff changeset
536 to set |cino-j|. >
2297
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
537
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
538 var bar = {
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
539 foo: {
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
540 that: this,
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
541 some: ok,
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
542 },
18831
6848b809a26e Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18343
diff changeset
543 "bar":{
2297
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
544 a : 2,
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
545 b: "123abc",
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
546 x: 4,
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
547 "y": 5
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
548 }
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
549 }
5ffe000a9ecf Improve Javascript indenting. Add "J" flag to 'cino'. (Hari Kumar G)
Bram Moolenaar <bram@vim.org>
parents: 2278
diff changeset
550 <
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
551 *cino-)*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 )N Vim searches for unclosed parentheses at most N lines away.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 This limits the time needed to search for parentheses. (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 20 lines).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
556 *cino-star*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 *N Vim searches for unclosed comments at most N lines away. This
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 limits the time needed to search for the start of a comment.
3830
04592728474a Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3454
diff changeset
559 If your /* */ comments stop indenting after N lines this is the
2788
0877b8d6370e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2725
diff changeset
560 value you will want to change.
2072
4a1bcdd9ea55 Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2033
diff changeset
561 (default 70 lines).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562
2857
f80e67bd6271 updated for version 7.3.202
Bram Moolenaar <bram@vim.org>
parents: 2788
diff changeset
563 *cino-#*
5438
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
564 #N When N is non-zero recognize shell/Perl comments starting with
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
565 '#', do not recognize preprocessor lines; allow right-shifting
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
566 lines that start with "#".
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
567 When N is zero (default): don't recognize '#' comments, do
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
568 recognize preprocessor lines; right-shifting lines that start
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
569 with "#" does not work.
1096
83eda510dbc0 updated for version 7.0-222
vimboss
parents: 874
diff changeset
570
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
571 *cino-P*
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
572 PN When N is non-zero recognize C pragmas, and indent them like any
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
573 other code; does not concern other preprocessor directives.
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
574 When N is zero (default): don't recognize C pragmas, treating
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
575 them like every other preprocessor directive.
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
576
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
577
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 The defaults, spelled out in full, are:
11087
242e0617aa51 patch 8.0.0431: 'cinoptions' cannot set indent for extern block
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
579 cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,N0,E0,ps,ts,is,+s,
20621
d30b16692ce0 patch 8.2.0864: pragmas are indented all the way to the left
Bram Moolenaar <Bram@vim.org>
parents: 18879
diff changeset
580 c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0,P0
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 Vim puts a line in column 1 if:
5438
878ed73c7070 updated for version 7.4.069
Bram Moolenaar <bram@vim.org>
parents: 5362
diff changeset
583 - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#0'.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 - It starts with a label (a keyword followed by ':', other than "case" and
2328
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
585 "default") and 'cinoptions' does not contain an 'L' entry with a positive
15379284e55a Add the 'L' item to 'cinoptions'. (Manuel Konig)
Bram Moolenaar <bram@vim.org>
parents: 2297
diff changeset
586 value.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 - Any combination of indentations causes the line to have less than 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 indentation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 2. Indenting by expression *indent-expression*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 The basics for using flexible indenting are explained in section |30.3| of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 user manual.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 If you want to write your own indent file, it must set the 'indentexpr'
14999
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14945
diff changeset
597 option. Setting the 'indentkeys' option is often useful.
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14945
diff changeset
598 See the $VIMRUNTIME/indent/README.txt file for hints.
2b30a2b4bde2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14945
diff changeset
599 See the $VIMRUNTIME/indent directory for examples.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 REMARKS ABOUT SPECIFIC INDENT FILES ~
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
605 CLOJURE *ft-clojure-indent* *clojure-indent*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
606
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
607 Clojure indentation differs somewhat from traditional Lisps, due in part to
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
608 the use of square and curly brackets, and otherwise by community convention.
5362
ab1508486b12 Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents: 5294
diff changeset
609 These conventions are not universally followed, so the Clojure indent script
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
610 offers a few configuration options.
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
611
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
612 (If the current Vim does not include |searchpairpos()|, the indent script falls
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
613 back to normal 'lisp' indenting, and the following options are ignored.)
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
614
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
615
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
616 *g:clojure_maxlines*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
617
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
618 Sets maximum scan distance of `searchpairpos()`. Larger values trade
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
619 performance for correctness when dealing with very long forms. A value of
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
620 0 will scan without limits. The default is 300.
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
621
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
622
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
623 *g:clojure_fuzzy_indent*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
624 *g:clojure_fuzzy_indent_patterns*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
625 *g:clojure_fuzzy_indent_blacklist*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
626
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
627 The 'lispwords' option is a list of comma-separated words that mark special
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
628 forms whose subforms should be indented with two spaces.
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
629
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
630 For example:
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
631 >
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
632 (defn bad []
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
633 "Incorrect indentation")
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
634
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
635 (defn good []
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
636 "Correct indentation")
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
637 <
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
638 If you would like to specify 'lispwords' with a |pattern| instead, you can use
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
639 the fuzzy indent feature:
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
640 >
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
641 " Default
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
642 let g:clojure_fuzzy_indent = 1
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
643 let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let']
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
644 let g:clojure_fuzzy_indent_blacklist =
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
645 \ ['-fn$', '\v^with-%(meta|out-str|loading-context)$']
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
646 <
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
647 |g:clojure_fuzzy_indent_patterns| and |g:clojure_fuzzy_indent_blacklist| are
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
648 lists of patterns that will be matched against the unqualified symbol at the
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
649 head of a list. This means that a pattern like `"^foo"` will match all these
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
650 candidates: `foobar`, `my.ns/foobar`, and `#'foobar`.
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
651
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
652 Each candidate word is tested for special treatment in this order:
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
653
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
654 1. Return true if word is literally in 'lispwords'
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
655 2. Return false if word matches a pattern in
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
656 |g:clojure_fuzzy_indent_blacklist|
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
657 3. Return true if word matches a pattern in
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
658 |g:clojure_fuzzy_indent_patterns|
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
659 4. Return false and indent normally otherwise
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
660
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
661
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
662 *g:clojure_special_indent_words*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
663
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
664 Some forms in Clojure are indented such that every subform is indented by only
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
665 two spaces, regardless of 'lispwords'. If you have a custom construct that
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
666 should be indented in this idiosyncratic fashion, you can add your symbols to
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
667 the default list below.
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
668 >
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
669 " Default
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
670 let g:clojure_special_indent_words =
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
671 \ 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn'
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
672 <
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
673
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
674 *g:clojure_align_multiline_strings*
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
675
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
676 Align subsequent lines in multi-line strings to the column after the opening
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
677 quote, instead of the same column.
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
678
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
679 For example:
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
680 >
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
681 (def default
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
682 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
683 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
684 enim ad minim veniam, quis nostrud exercitation ullamco laboris
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
685 nisi ut aliquip ex ea commodo consequat.")
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
686
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
687 (def aligned
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
688 "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
689 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
690 enim ad minim veniam, quis nostrud exercitation ullamco laboris
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
691 nisi ut aliquip ex ea commodo consequat.")
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
692 <
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
693
5577
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
694 *g:clojure_align_subforms*
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
695
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
696 By default, parenthesized compound forms that look like function calls and
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
697 whose head subform is on its own line have subsequent subforms indented by
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
698 two spaces relative to the opening paren:
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
699 >
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
700 (foo
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
701 bar
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
702 baz)
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
703 <
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
704 Setting this option to `1` changes this behaviour so that all subforms are
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
705 aligned to the same column, emulating the default behaviour of
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
706 clojure-mode.el:
5577
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
707 >
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
708 (foo
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
709 bar
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
710 baz)
de28b1568fc2 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5466
diff changeset
711 <
4098
058f26a834c4 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
712
501
ce2181d14aa0 updated for version 7.0139
vimboss
parents: 236
diff changeset
713 FORTRAN *ft-fortran-indent*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
715 Block if, select case, where, and forall constructs are indented. So are
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
716 type, interface, associate, block, and enum constructs. The indenting of
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
717 subroutines, functions, modules, and program blocks is optional. Comments,
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
718 labelled statements and continuation lines are indented if the Fortran is in
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
719 free source form, whereas they are not indented if the Fortran is in fixed
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
720 source form because of the left margin requirements. Hence manual indent
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
721 corrections will be necessary for labelled statements and continuation lines
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
722 when fixed source form is being used. For further discussion of the method
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
723 used for the detection of source format see |ft-fortran-syntax|.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 Do loops ~
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
726 All do loops are left unindented by default. Do loops can be unstructured in
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 Fortran with (possibly multiple) loops ending on a labelled executable
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
728 statement of almost arbitrary type. Correct indentation requires
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
729 compiler-quality parsing. Old code with do loops ending on labelled statements
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 of arbitrary type can be indented with elaborate programs such as Tidy
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
731 (http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 also left unindented because continue statements are also used for purposes
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
733 other than ending a do loop. Programs such as Tidy can convert structured
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
734 do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
735 be indented. If you use only structured loops of the do/enddo form, you should
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 declare this by setting the fortran_do_enddo variable in your .vimrc as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 follows >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 let fortran_do_enddo=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 170
diff changeset
741 in which case do loops will be indented. If all your loops are of do/enddo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 type only in, say, .f90 files, then you should set a buffer flag with an
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 autocommand such as >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 to get do loops indented in .f90 files and left alone in Fortran files with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 other extensions such as .for.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749
2908
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
750 Program units ~
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
751 The indenting of program units (subroutines, functions, modules, and program
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
752 blocks) is enabled by default but can be suppressed if a lighter, screen-width
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
753 preserving indent style is desired. To suppress the indenting of program
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
754 units for all fortran files set the global fortran_indent_less variable in
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
755 your .vimrc as follows >
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
756
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
757 let fortran_indent_less=1
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
758
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
759 A finer level of suppression can be achieved by setting the corresponding
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
760 buffer-local variable as follows >
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
761
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
762 let b:fortran_indent_less=1
fd09a9c8468e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2857
diff changeset
763
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
765 HTML *ft-html-indent* *html-indent* *html-indenting*
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
766
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
767 This is about variables you can set in your vimrc to customize HTML indenting.
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
768
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
769 You can set the indent for the first line after <script> and <style>
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
770 "blocktags" (default "zero"): >
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
771
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
772 :let g:html_indent_script1 = "inc"
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
773 :let g:html_indent_style1 = "inc"
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
774 <
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
775 VALUE MEANING ~
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
776 "zero" zero indent
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
777 "auto" auto indent (same indent as the blocktag)
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
778 "inc" auto indent + one indent step
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
779
27492
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
780 You can set the indent for attributes after an open <tag line: >
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
781
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
782 :let g:html_indent_attribute = 1
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
783 <
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
784 VALUE MEANING ~
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
785 1 auto indent, one indent step more than <tag
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
786 2 auto indent, two indent steps (default)
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
787 > 2 auto indent, more indent steps
4789f29c9595 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 27036
diff changeset
788
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
789 Many tags increase the indent for what follows per default (see "Add Indent
4911
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
790 Tags" in the script). You can add further tags with: >
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
791
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
792 :let g:html_indent_inctags = "html,body,head,tbody"
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
793
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
794 You can also remove such tags with: >
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
795
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
796 :let g:html_indent_autotags = "th,td,tr,tfoot,thead"
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
797
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
798 Default value is empty for both variables. Note: the initial "inctags" are
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
799 only defined once per Vim session.
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
800
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
801 User variables are only read when the script is sourced. To enable your
4911
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
802 changes during a session, without reloading the HTML file, you can manually
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
803 do: >
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
804
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
805 :call HtmlIndent_CheckUserSettings()
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
806
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
807 Detail:
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
808 Calculation of indent inside "blocktags" with "alien" content:
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
809 BLOCKTAG INDENT EXPR WHEN APPLICABLE ~
4911
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
810 <script> : {customizable} if first line of block
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
811 : cindent(v:lnum) if attributes empty or contain "java"
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
812 : -1 else (vbscript, tcl, ...)
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
813 <style> : {customizable} if first line of block
78c318784090 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4869
diff changeset
814 : GetCSSIndent() else
4869
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
815 <!-- --> : -1
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
816
a5352e73dc00 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
817
18848
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
818 MATLAB *ft-matlab-indent* *matlab-indent* *matlab-indenting*
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
819
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
820 The setting Function indenting format in MATLAB Editor/Debugger Language
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
821 Preferences corresponds to: >
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
822 :let g:MATLAB_function_indent = {0, 1 or 2 (default)}
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
823
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
824 Where 0 is for Classic, 1 for Indent nested functions and 2 for Indent all
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
825 functions.
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
826
a0e0f0256d0b Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18831
diff changeset
827
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
828 PHP *ft-php-indent* *php-indent* *php-indenting*
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
829
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
830 NOTE: PHP files will be indented correctly only if PHP |syntax| is active.
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
831
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
832 If you are editing a file in Unix 'fileformat' and '\r' characters are present
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
833 before new lines, indentation won't proceed correctly ; you have to remove
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
834 those useless characters first with a command like: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
835
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
836 :%s /\r$//g
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
837
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
838 Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
839 script will silently remove them when Vim loads a PHP file (at each |BufRead|).
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
840
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
841 OPTIONS: ~
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
842
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
843 PHP indenting can be altered in several ways by modifying the values of some
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
844 global variables:
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
845
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
846 *php-comment* *PHP_autoformatcomment*
17667
95c23e180022 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17571
diff changeset
847 To not enable auto-formatting of comments by default (if you want to use your
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
848 own 'formatoptions'): >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
849 :let g:PHP_autoformatcomment = 0
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
850
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
851 Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
852 added, see |fo-table| for more information.
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
853 -------------
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
854
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
855 *PHP_outdentSLComments*
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
856 To add extra indentation to single-line comments: >
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
857 :let g:PHP_outdentSLComments = N
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
858
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
859 With N being the number of 'shiftwidth' to add.
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
860
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
861 Only single-line comments will be affected such as: >
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
862 # Comment
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
863 // Comment
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
864 /* Comment */
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
865 -------------
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
866
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
867 *PHP_default_indenting*
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
868 To add extra indentation to every PHP lines with N being the number of
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
869 'shiftwidth' to add: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
870 :let g:PHP_default_indenting = N
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
871
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
872 For example, with N = 1, this will give:
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
873 >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
874 <?php
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
875 if (!isset($History_lst_sel))
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
876 if (!isset($History_lst_sel))
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
877 if (!isset($History_lst_sel)) {
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
878 $History_lst_sel=0;
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
879 } else
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
880 $foo="bar";
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
881
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
882 $command_hist = TRUE;
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
883 ?>
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
884 (Notice the extra indentation between the PHP container markers and the code)
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
885 -------------
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
886
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
887 *PHP_outdentphpescape*
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
888 To indent PHP escape tags as the surrounding non-PHP code (only affects the
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
889 PHP escape tags): >
27036
3e661b0cf500 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 26100
diff changeset
890 :let g:PHP_outdentphpescape = 0
2442
14f01499dd16 More updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2413
diff changeset
891 -------------
14f01499dd16 More updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2413
diff changeset
892
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
893 *PHP_removeCRwhenUnix*
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
894 To automatically remove '\r' characters when the 'fileformat' is set to Unix: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
895 :let g:PHP_removeCRwhenUnix = 1
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
896 -------------
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
897
5862
306caa30d83b Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents: 5763
diff changeset
898 *PHP_BracesAtCodeLevel*
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
899 To indent braces at the same level than the code they contain: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
900 :let g:PHP_BracesAtCodeLevel = 1
18831
6848b809a26e Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18343
diff changeset
901
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
902 This will give the following result: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
903 if ($foo)
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
904 {
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
905 foo();
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
906 }
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
907 Instead of: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
908 if ($foo)
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
909 {
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
910 foo();
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
911 }
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
912
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
913 NOTE: Indenting will be a bit slower if this option is used because some
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
914 optimizations won't be available.
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
915 -------------
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
916
17571
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
917 *PHP_vintage_case_default_indent*
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
918 To indent 'case:' and 'default:' statements in switch() blocks: >
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
919 :let g:PHP_vintage_case_default_indent = 1
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
920
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
921 In PHP braces are not required inside 'case/default' blocks therefore 'case:'
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
922 and 'default:' are indented at the same level than the 'switch()' to avoid
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
923 meaningless indentation. You can use the above option to return to the
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 4098
diff changeset
924 traditional way.
14006
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
925 -------------
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
926
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
927 *PHP_noArrowMatching*
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
928 By default the indent script will indent multi-line chained calls by matching
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
929 the position of the '->': >
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
930
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
931 $user_name_very_long->name()
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
932 ->age()
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
933 ->info();
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
934
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
935 You can revert to the classic way of indenting by setting this option to 1: >
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
936 :let g:PHP_noArrowMatching = 1
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
937
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
938 You will obtain the following result: >
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
939
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
940 $user_name_very_long->name()
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
941 ->age()
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
942 ->info();
665fe1f419b0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
943
17571
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
944 -------------
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
945
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
946 *PHP_IndentFunctionCallParameters*
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
947 Extra indentation levels to add to parameters in multi-line function calls. >
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
948 let g:PHP_IndentFunctionCallParameters = 1
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
949
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
950 Function call arguments will indent 1 extra level. For two-space indentation: >
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
951
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
952 function call_the_thing(
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
953 $with_this,
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
954 $and_that
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
955 ) {
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
956 $this->do_the_thing(
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
957 $with_this,
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
958 $and_that
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
959 );
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
960 }
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
961
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
962 -------------
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
963
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
964 *PHP_IndentFunctionDeclarationParameters*
18343
375a7ecdb351 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17667
diff changeset
965 Extra indentation levels to add to arguments in multi-line function
375a7ecdb351 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17667
diff changeset
966 definitions. >
17571
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
967 let g:PHP_IndentFunctionDeclarationParameters = 1
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
968
18343
375a7ecdb351 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17667
diff changeset
969 Function arguments in declarations will indent 1 extra level. For two-space
375a7ecdb351 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 17667
diff changeset
970 indentation: >
17571
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
971
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
972 function call_the_thing(
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
973 $with_this,
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
974 $and_that
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
975 ) {
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
976 $this->do_the_thing(
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
977 $with_this,
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
978 $and_that
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
979 );
2704c4e3e20a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15932
diff changeset
980 }
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
981
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1620
diff changeset
982
501
ce2181d14aa0 updated for version 7.0139
vimboss
parents: 236
diff changeset
983 PYTHON *ft-python-indent*
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
984
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
985 The amount of indent can be set with the `g:python_indent` |Dictionary|, which
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
986 needs to be created before adding the items: >
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
987 let g:python_indent = {}
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
988 The examples given are the defaults. Note that the dictionary values are set
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
989 to an expression, so that you can change the value of 'shiftwidth' later
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30547
diff changeset
990 without having to update these values.
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
991
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
992 Indent after an open paren: >
29840
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
993 let g:python_indent.open_paren = 'shiftwidth() * 2'
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
994 Indent after a nested paren: >
29840
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
995 let g:python_indent.nested_paren = 'shiftwidth()'
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
996 Indent for a continuation line: >
29840
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
997 let g:python_indent.continue = 'shiftwidth() * 2'
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
998
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
999 By default, the closing paren on a multiline construct lines up under the first
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1000 non-whitespace character of the previous line.
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1001 If you prefer that it's lined up under the first character of the line that
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1002 starts the multiline construct, reset this key: >
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1003 let g:python_indent.closed_paren_align_last_line = v:false
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
1004
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20621
diff changeset
1005 The method uses |searchpair()| to look back for unclosed parentheses. This
15033
f8b0f1e42f2c Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 14999
diff changeset
1006 can sometimes be slow, thus it timeouts after 150 msec. If you notice the
14945
4ee65b4150fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
1007 indenting isn't correct, you can set a larger timeout in msec: >
29840
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1008 let g:python_indent.searchpair_timeout = 500
14945
4ee65b4150fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
1009
15932
c3c1abe7aff2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
1010 If looking back for unclosed parenthesis is still too slow, especially during
c3c1abe7aff2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
1011 a copy-paste operation, or if you don't need indenting inside multi-line
c3c1abe7aff2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
1012 parentheses, you can completely disable this feature: >
29840
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1013 let g:python_indent.disable_parentheses_indenting = 1
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1014
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1015 For backward compatibility, these variables are also supported: >
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1016 g:pyindent_open_paren
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1017 g:pyindent_nested_paren
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1018 g:pyindent_continue
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1019 g:pyindent_searchpair_timeout
b15334beeaa4 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
1020 g:pyindent_disable_parentheses_indenting
15932
c3c1abe7aff2 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
1021
170
8c60f65311fa updated for version 7.0052
vimboss
parents: 22
diff changeset
1022
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1023 R *ft-r-indent*
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1024
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1025 Function arguments are aligned if they span for multiple lines. If you prefer
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1026 do not have the arguments of functions aligned, put in your |vimrc|:
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1027 >
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1028 let r_indent_align_args = 0
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1029 <
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1030 All lines beginning with a comment character, #, get the same indentation
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1031 level of the normal R code. Users of Emacs/ESS may be used to have lines
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1032 beginning with a single # indented in the 40th column, ## indented as R code,
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1033 and ### not indented. If you prefer that lines beginning with comment
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1034 characters are aligned as they are by Emacs/ESS, put in your |vimrc|:
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1035 >
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1036 let r_indent_ess_comments = 1
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1037 <
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1038 If you prefer that lines beginning with a single # are aligned at a column
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1039 different from the 40th one, you should set a new value to the variable
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1040 r_indent_comment_column, as in the example below:
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1041 >
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1042 let r_indent_comment_column = 30
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1043 <
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1044 Any code after a line that ends with "<-" is indented. Emacs/ESS does not
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1045 indent the code if it is a top level function. If you prefer that the
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1046 Vim-R-plugin behaves like Emacs/ESS in this regard, put in your |vimrc|:
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1047 >
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1048 let r_indent_ess_compatible = 1
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1049 <
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1050 Below is an example of indentation with and without this option enabled:
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1051 >
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1052 ### r_indent_ess_compatible = 1 ### r_indent_ess_compatible = 0
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1053 foo <- foo <-
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1054 function(x) function(x)
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1055 { {
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1056 paste(x) paste(x)
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1057 } }
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1058 <
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
1059 The code will be indented after lines that match the pattern
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
1060 `'\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$'`. If you want indentation after
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
1061 lines that match a different pattern, you should set the appropriate value of
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
1062 `r_indent_op_pattern` in your |vimrc|.
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14421
diff changeset
1063
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2965
diff changeset
1064
1201
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1065 SHELL *ft-sh-indent*
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1066
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1067 The amount of indent applied under various circumstances in a shell file can
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1068 be configured by setting the following keys in the |Dictionary|
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1069 b:sh_indent_defaults to a specific amount or to a |Funcref| that references a
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1070 function that will return the amount desired:
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1071
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1072 b:sh_indent_options['default'] Default amount of indent.
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1073
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1074 b:sh_indent_options['continuation-line']
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1075 Amount of indent to add to a continued line.
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1076
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1077 b:sh_indent_options['case-labels']
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1078 Amount of indent to add for case labels.
2033
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
1079 (not actually implemented)
1201
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1080
2033
de5a43c5eedc Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
1081 b:sh_indent_options['case-statements']
1201
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1082 Amount of indent to add for case statements.
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1083
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1084 b:sh_indent_options['case-breaks']
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1085 Amount of indent to add (or more likely
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1086 remove) for case breaks.
4d2585cf5950 updated for version 7.1b
vimboss
parents: 1141
diff changeset
1087
501
ce2181d14aa0 updated for version 7.0139
vimboss
parents: 236
diff changeset
1088 VERILOG *ft-verilog-indent*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1089
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1090 General block statements such as if, for, case, always, initial, function,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1091 specify and begin, etc., are indented. The module block statements (first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1092 level blocks) are not indented by default. you can turn on the indent with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1093 setting a variable in the .vimrc as follows: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1094
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1095 let b:verilog_indent_modules = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1096
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1097 then the module blocks will be indented. To stop this, remove the variable: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1098
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1099 :unlet b:verilog_indent_modules
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1101 To set the variable only for Verilog file. The following statements can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1102 used: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1104 au BufReadPost * if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1105 au BufReadPost * if b:current_syntax == "verilog"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1106 au BufReadPost * let b:verilog_indent_modules = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1107 au BufReadPost * endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1108 au BufReadPost * endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1110 Furthermore, setting the variable b:verilog_indent_width to change the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1111 indenting width (default is 'shiftwidth'): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1113 let b:verilog_indent_width = 4
15033
f8b0f1e42f2c Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 14999
diff changeset
1114 let b:verilog_indent_width = shiftwidth() * 2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1116 In addition, you can turn the verbose mode for debug issue: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1118 let b:verilog_indent_verbose = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1120 Make sure to do ":set cmdheight=2" first to allow the display of the message.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1121
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 15
diff changeset
1122
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1123 VHDL *ft-vhdl-indent*
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1124
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1125 Alignment of generic/port mapping statements are performed by default. This
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1126 causes the following alignment example: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1127
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1128 ENTITY sync IS
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1129 PORT (
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1130 clk : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1131 reset_n : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1132 data_input : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1133 data_out : OUT STD_LOGIC
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1134 );
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1135 END ENTITY sync;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1136
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1137 To turn this off, add >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1138
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1139 let g:vhdl_indent_genportmap = 0
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1140
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1141 to the .vimrc file, which causes the previous alignment example to change: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1142
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1143 ENTITY sync IS
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1144 PORT (
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1145 clk : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1146 reset_n : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1147 data_input : IN STD_LOGIC;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1148 data_out : OUT STD_LOGIC
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1149 );
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1150 END ENTITY sync;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1151
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1152 ----------------------------------------
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1153
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1154 Alignment of right-hand side assignment "<=" statements are performed by
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1155 default. This causes the following alignment example: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1156
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1157 sig_out <= (bus_a(1) AND
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1158 (sig_b OR sig_c)) OR
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1159 (bus_a(0) AND sig_d);
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1160
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1161 To turn this off, add >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1162
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1163 let g:vhdl_indent_rhsassign = 0
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1164
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1165 to the .vimrc file, which causes the previous alignment example to change: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1166
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1167 sig_out <= (bus_a(1) AND
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1168 (sig_b OR sig_c)) OR
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1169 (bus_a(0) AND sig_d);
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1170
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1171 ----------------------------------------
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1172
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1173 Full-line comments (lines that begin with "--") are indented to be aligned with
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1174 the very previous line's comment, PROVIDED that a whitespace follows after
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1175 "--".
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1176
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1177 For example: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1178
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1179 sig_a <= sig_b; -- start of a comment
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1180 -- continuation of the comment
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1181 -- more of the same comment
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1182
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1183 While in Insert mode, after typing "-- " (note the space " "), hitting CTRL-F
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1184 will align the current "-- " with the previous line's "--".
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1185
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1186 If the very previous line does not contain "--", THEN the full-line comment
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1187 will be aligned with the start of the next non-blank line that is NOT a
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1188 full-line comment.
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1189
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1190 Indenting the following code: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1191
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1192 sig_c <= sig_d; -- comment 0
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1193 -- comment 1
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1194 -- comment 2
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1195 --debug_code:
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1196 --PROCESS(debug_in)
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1197 --BEGIN
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1198 -- FOR i IN 15 DOWNTO 0 LOOP
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1199 -- debug_out(8*i+7 DOWNTO 8*i) <= debug_in(15-i);
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1200 -- END LOOP;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1201 --END PROCESS debug_code;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1202
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1203 -- comment 3
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1204 sig_e <= sig_f; -- comment 4
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1205 -- comment 5
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1206
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1207 results in: >
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1208
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1209 sig_c <= sig_d; -- comment 0
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1210 -- comment 1
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1211 -- comment 2
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1212 --debug_code:
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1213 --PROCESS(debug_in)
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1214 --BEGIN
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1215 -- FOR i IN 15 DOWNTO 0 LOOP
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1216 -- debug_out(8*i+7 DOWNTO 8*i) <= debug_in(15-i);
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1217 -- END LOOP;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1218 --END PROCESS debug_code;
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1219
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1220 -- comment 3
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1221 sig_e <= sig_f; -- comment 4
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1222 -- comment 5
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1223
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1224 Notice that "--debug_code:" does not align with "-- comment 2"
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1225 because there is no whitespace that follows after "--" in "--debug_code:".
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1226
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1227 Given the dynamic nature of indenting comments, indenting should be done TWICE.
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1228 On the first pass, code will be indented. On the second pass, full-line
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1229 comments will be indented according to the correctly indented code.
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1230
73fe8baea242 updated for version 7.2a
vimboss
parents: 1247
diff changeset
1231
501
ce2181d14aa0 updated for version 7.0139
vimboss
parents: 236
diff changeset
1232 VIM *ft-vim-indent*
30547
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1233 *g:vim_indent*
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1234 Vim scripts indentation can be configured with the `g:vim_indent` dictionary
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1235 variable. It supports 3 keys, `line_continuation`, `more_in_bracket_block`,
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1236 and `searchpair_timeout`.
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1237 `line_continuation` expects a number which will be added to the indent level of
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1238 a continuation line starting with a backslash, and defaults to
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1239 `shiftwidth() * 3`. It also accepts a string, which is evaluated at runtime.
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1240 `more_in_bracket_block` expects a boolean value; when on, an extra
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1241 `shiftwidth()` is added inside blocks surrounded with brackets. It defaults to
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1242 `v:false`.
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1243 `searchpair_timeout` expects a number which will be passed to `searchpair()` as
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1244 a timeout. Increasing the value might give more accurate results, but also
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1245 causes the indentation to take more time. It defaults to 100 (milliseconds).
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 15
diff changeset
1246
30547
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1247 Example of configuration:
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 15
diff changeset
1248
30547
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1249 let g:vim_indent = #{
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1250 \ line_continuation: shiftwidth() * 3,
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1251 \ more_in_bracket_block: v:false,
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1252 \ searchpair_timeout: 100,
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1253 \ }
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1254
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1255 *g:vim_indent_cont*
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1256 This variable is equivalent to `g:vim_indent.line_continuation`.
1e91e26ceebf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29840
diff changeset
1257 It's supported for backward compatibility.
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 15
diff changeset
1258
cc049b00ee70 updated for version 7.0014
vimboss
parents: 15
diff changeset
1259
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 14006
diff changeset
1260 vim:tw=78:ts=8:noet:ft=help:norl: