On Mar 11, 11:16 am, "Gene Kwiecinski" <[email protected]> wrote:

>
> Ooh..  Quick example:  Why bother with a rather ghastly
>
>         <table class='caution'>
>                 <thead>
>                         <tr>
>                                 <th>Caution</th>
>                         </tr>
>                 </thead>
>                 <tbody>
>                         <tr>
>                                 <td>Coffee is hot!</td>
>                         </tr>
>                 </tbody>
>         </table>
>
> when a much more compact
>
>         <table class='caution'>
>         <thead><tr><th>Caution</th></tr></thead>
>         <tbody><tr><td>Coffee is hot!</td></tr></tbody>
>         </table>
>
> will do, *and* be more readable?
>
> The first would be generated with automatic indenting rules, and you'd
> have to expend *more* effort compacting it afterward, when you could
> much more easily just forego automatic indenting and just type what you
> *want* directly.
>

Actually, the first would only be generated with automatic indenting
rules if you inserted all the line endings yourself, in which case the
second would look even worse:

<table class='caution'>
<thead>
<tr>
<th>Caution</th>
</tr>
</thead>
<tbody>
<tr>
<td>Coffee is hot!</td>
</tr>
</tbody>
</table>

I find that automatic indentation rules, even if they aren't perfect,
usually get the indentation close enough that it takes minimal effort
to fix it. In the case given by the original poster, after typing the
code, a simple >> will fix the indent.

If find yourself constantly re-indenting code (manually or otherwise),
it might be worthwhile to hack together an indent script. If not, it's
probably just better to find settings that get you close, then correct
the indent as required.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to