>>>It's hard for Vim to guess that in
>>>
>>> if (a == b &&
>>> c == d &&
>>> e == f)
>>>
>>>you want c aligned with a (and not, let's say, one
>>>level of indent further than the "if").
>This is verging on the autistic. The main problem with
>complicated indentation schemes is getting all programmers
>in a group to follow them. Complicated suggestion: write
>a (simple) map to insert the correct number of spaces for
>you. Simple suggestion: just use two extra levels of
>indentation for continuation lines, like many people. --Antony
It's even worse, because people have their own styles, which they take
personally, and will fight you to the end before changing them.
Eg, me personally, and this is just personal preference and not judging
"right" or "wrong", but I'd personally put the joining operators in the
left margin, because the right margin would be too ragged to see what
joins what, especially when mixing ands and ors. So I'd have
if( a == b
&& c == d
&& e == f )
or to mix it up with different conditionals
if( ( ( a == b )
&& ( c == d ) )
|| ( e == f ) )
which is already starting to look rather lispy, but it aligns the
equations and lets you know "up front" (ie, in the left margin) what's
anded and what's ored. And if you were to say it aloud, how would your
inflection describe it? Typically:
*If*
<pause>
ay equalequal bee andand cee equalequal dee
<pause>
*oror* ee equalequal eff
<pause>
*then* ..."
Ie, you wouldn't use the "andand"s and "oror"s at the *end* of the
test-equality clause (vs assignment, where it'd be "equal" vs
"equalequal"), but at the beginning to introduce the clause.
Anyhoo, try getting 'vim' or *any* editor to autogenerate *that*...
You'd have to compile 'vim' with '+lex +yacc'...
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---