Is there a way to have hanging operators when indenting with tabs in Vim? For instance, if I have code:
class some_class
{
<tab>some_class();
<tab>~some_class();
};
I want it to look like this:
class some_class
{
some_class();
~some_class();
};
The question is about the appearance of whitespace, not its composition. So, abbreviations and indentation rules would not do.
I think he’s asking if the
~will move backwards one space if vim can detect that it’s an operator, thereby “hanging” the ~ to the left of thesome_class().The answer as far as I know is it might be possible, but won’t be easy. Insert-mode abbreviations are always patchy, and more complex solutions are…well more complex.
Unless you really need this behaviour, I don’t think it’s worth the effort.
EDIT:
I think I get what you’re saying. In which case I can say with reasonable certainty that what you’re asking is not possible. You cannot change how vim displays text that is indented by tabs and happens to start with an operator that you want hanging off the left margin. That simply will not work. Vim is set up to display text as-is, you can’t change it to suit a typographical style without changing the source code, which I doubt you’ll want to do.