Hi all,
I've got a question about changing vim's indentation behavior for
c/c++:
Is it possible to get the editor to insert tabs to signify *indentation*
level, and to insert spaces to align text *after* the indentation? I've
been trying to find some sort of option that allows for this and haven't
found any sort of solution (short of creating my own c indentation file).
To explain a little bit better, the following code fragment (with tabs
replaced by '--->' and spaces replaced by backquote characters) is an
example of the indentation style that I want vim to produce:
/*
`* This is a comment note the spaces aligning the continuation lines
`*/
int main(int argc, char ** argv)
{
--->/*
--->`* note that the 2nd & 3rd parameters are aligned with spaces...
--->`* Vim indentation would insert more than a single tab on these
--->`* lines; causing a change in tab size to munge the code formatting.
--->`* This is the main thing that I want to change.
--->`*/
--->printf("This is a printout with a value(%d)\n",
--->```````25,
--->```````bl);
--->/* note the spaces inserted between the tabs and logic operators */
--->if ( (condition1 && condition2)
--->```|| ( condition3
--->``````&& condition4) )
--->{
--->--->doSomething();
--->}
--->switch (condition)
--->{
--->`case '1':
--->--->doSomething();
--->--->break;
--->`default:
--->--->break;
--->}
}
In essence, I want vim not to replace spaces by tabs, and insert spaces
instead of tabs in certain situations. Is this possible?
Thanks,
John