I am currently thrown into a new project where the indentation style is a bit special. The basic rule is to use 'keyword+blank' spaces to indent the next line.
For example:
if () {
// indent 3 spaces here
}
while () {
// indent 6 spaces here
}
There are some (or a lot) of exeptions:
- else if: use same number of spaces as if (3)
- case in switch/case (2 spaces)
- ...
1) Is there already a plugin available that can do it for me? According to one of the developers this is called 'smart identation'. Unfortunately VIM's smartindent does something different.
2) If the answer to 1 is no. Is there an easy way to configure vim to respect these rules?