I am trying to make vim auto indent with tabs, and align with whitespaces, but actually, vim indent with tabs and fill the alignment with tabs + white spaces.
Vim does it :
(each block is a tab)
{
>--long a = 1,
>-->--..b = 2,
>-->--..c = 3;
}
May do it :
{
>--long a = 1,
>--.....b = 2,
>--.....c = 3;
}
So, I think there is a lot of questions about the subject of tabs and spaces, but none of them provide some Just Works solution:
- https://stackoverflow.com/questions/8493705/vim-use-tabs-for-indentation-spaces-for-alignment-with-c-source-files
- https://stackoverflow.com/questions/29208431/vim-indent-with-tabs-align-with-spaces
- https://stackoverflow.com/questions/6504507/vim-indenting-and-alignment-combining-spaces-and-tabs
Actually I am using:
set ai
set cindent
set cinoptions=(0,:0,u0,U0,g0)
I tried the Smart Tab plugin, which seems to work well, but when I try gg=G
I get some weird errors :
Error detected while processing function CtabRedoIndent..<SNR>12_CheckAlign:
line 11:
E108: No such variable: "b:ctab_lastalign"
Press ENTER or type command to continue
Error detected while processing function CtabRedoIndent:
line 10:
E170: Missing :endwhile
This discussion seems to be prety old, so now, 2015, there is a official solution to deal with it ?