Yes. Use the Smart Tabs plugin.
This script allows you to use your normal tab settings for the beginning of the line, and have tabs expanded as spaces anywhere else. This effectively distinguishes 'indent' from 'alignment'.
<tab>
Uses editor tab settings to insert a tab at the beginning of the line (before the first non-space character), and inserts spaces otherwise.
<BS>
Uses editor tab settings to delete tabs or 'expanded' tabs ala smarttab
To make Vim line up function arguments, add
set cindent
set cinoptions=(0,u0,U0
to .vimrc
. The plugin will encode the whitespace as such:
int f(int x,
......int y) {
--->return g(x,
--->.........y);
}
This makes the alignment of "x
" and "y
" independent of the tab size (tabstop
).