:help cinoptions-values
indent.txt
323 +N Indent a continuation line (a line that spills onto the next)
N
324 additional characters. (default 'shiftwidth').
325 When the previous line ended in a backslash it's doubled.
326
327 cino= cino=+10 >
328 a = b + 9 * a = b + 9 *
329 c; c;
> When the previous line ended in a backslash it's doubled.
I think that this sentence is not correct.
See the following example.
With this settings.
$ vim -u NONE --cmd "set shiftwidth=2 cinoptions=+3 cindent"
Case 1.
1234567890
+----------
1|a\
2| c;
Second line is indented with "+N" amount * 2;
This is the behavior as described.
Case 2.
1234567890
+----------
1|a = b + \
2| c;
When '=' operator is used, second line is aligned with the first rhs
character in the previous line.
(without backslach, no indent)
1234567890
+----------
1|a = b +
2|c;
Case 3.
1234567890
+----------
1|a b \
2| c;
3|a b \
4| c;
1234567890
+----------
1|a \
2| c;
3|a \
4| c;
When previous line has space, second line is indented with the position
of the second non-whitespace character in the previous line + "+N" amount.
Case 4.
1234567890
+----------
1|int main()
2|{
3| a = b + \
4| c;
5|}
Second line is aligned with first rhs character in the previous line.
Same as case 2.
(without backslach, previous line's indent + "+N" amount)
1234567890
+----------
1|int main()
2|{
3| a = b +
4| c;
5|}
Case 5.
1234567890
+----------
1|int main()
2|{
3| a\
4| c;
5|}
1234567890
+----------
1|int main()
2|{
3| a b \
4| c;
5| a b \
6| c;
7|}
1234567890
+----------
1|int main()
2|{
3| a \
4| c;
5| a \
6| c;
7|}
1234567890
+----------
1|int main()
2|{
3| a b
4| c;
5| a
6| c;
7|}
When previous line has indent, second line is indented with previous
line's indent + "+N" amount (with or without backslash).
Different with case 3.
--
Yukihiro Nakadaira - [email protected]
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php