On Wed, Dec 24, 2008 at 6:25 AM, Antony Scriven wrote:
>
> On Wed, Dec 24, 2008 at 12:17 AM, Matt Wozniski wrote:
>
>> On Tue, Dec 23, 2008 at 11:26 PM, Tony Mechelynck wrote:
>>
>>> However, as others have repeatedly said, with ":set
>>> autoindent copyindent" (and maybe 'preserveindent' but
>>> I'm less sure what it does), when you hit Enter after
>>> "c == d &&", the third line will get the exact same
>>> mixture of tabs and spaces as the second one.
>>
>> Which is still a far cry away from properly using tabs
>> for indenting blocks and spaces for aligning code
>> automatically.  Like I said before, vim just isn't
>> capable of doing the right thing here, and changing that
>> would require making a way for indentexpr's to specify
>> "number of spaces of indent" and "number of spaces for
>> alignment" independently.
>
> This is verging on the autistic. The main problem with
> complicated indentation schemes is getting all programmers
> in a group to follow them.

In my case, that is not a problem at all - I follow the
established coding standards for any project I'm on, but
I would like to be able to use this indentation scheme for
any project that I write myself.  Such projects usually have
few other people touching the code, so the convenience of
having them display properly aligned regardless of the value
of &tabstop that people prefer far outweighs the necessity
of having every committer using the same coding style.

> Complicated suggestion: write
> a (simple) map to insert the correct number of spaces for
> you.

Still wouldn't help for, eg, gg=G.  Yes, I realize that
I can code with my preferred style manually.  But coding in
*any* coding style manually is more frustrating than it's
worth.

> Simple suggestion: just use two extra levels of
> indentation for continuation lines, like many people.

I'd prefer to use noexpandtab instead.  Using two levels of
indentation means that I can't make code line up for
readability, and using spaces instead of tabs means that
other people might think my code is too narrow or too wide
and have no way of automatically fixing it.  Right now
I need to err on the side of what looks prettier to me, but
I wish I didn't have to - I'm sure many people think that my
code, with shiftwidth=2, is far too narrow, and if vim
supported using tabs for indent level followed by spaces for
alignment, I wouldn't need to choose between making things
look more readable for me and making things look more
readable for others.

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to