Using vim, I would like to effectively have expandtabs off if I’m to the left of any text on the line and on if I’m to the right of any non-whitespace character. (I would like to use tabs for indentation and spaces for alignment.)
Can this be done?
Yes. Use the Smart Tabs plugin.
To make Vim line up function arguments, add
to
.vimrc. The plugin will encode the whitespace as such:This makes the alignment of "
x" and "y" independent of the tab size (tabstop).