R's Workshop

Vim C Indention

Customize C Indenting Style

set cinoptions+=(2s,:0s,t0

(2s: indent 2 shiftwidth from the line with the unclosed parenthesis

if (c1 && (c2 ||
		c3))
    foo;
```C

if (c1 && (c2 || c3))


`:0s`: Place case labels 0 characters from the indent of the switch()

```C
switch(x)
{
case 1:
	a = b;
default:
	c = a
}

t0: Indent a function return type declaration 0 characters from the margin

int
func()

Reference

BayaoBay.jpg