Wednesday, June 5, 2013

Re: I'm unable to override indentexpr

On Wed, 05 Jun 2013 13:26:59 +0200
Bram Moolenaar <Bram@moolenaar.net> wrote:

>
> Steve Litt wrote:
>
> > I'm using Vim 7.3 in Xubuntu 12.10. When editing my html files, this
> > happens when I set indentexpr?:
> >
> > indentexpr=HtmlIndentGet(v:lnum)
> >
> > That's no good because HtmlIndentGet(v:lnum) does a horrible job of
> > indenting: I'd rather have no indentation at all. No prob -- I'll
> > just set indentexpr=, thereby getting rid of Vim-furnished
> > indentation. So, in ~/.vim/after/ftplugin/html.vim, I put
> > indentexpr=. It changes nothing. verb set indentexpr? says:
>
> [...]
>
> Are other people thinking the same way? I quite often disable HTML
> indenting, especially because it re-indents when changing an existing
> line, which can be very annoying.
>
> Perhaps there is another HTML indenter that would be preferred?
> Or the defaults should be changed?

Hi Bram,

Almost any HTML indenter that works consistently would be preferable to
the current one, but, speaking for myself, I think I might choose none
at all over even the best of indenters. Here's why...

First, the default behavior, and for all I know the only behavior, of
the tidy HTML checker is to output non-indented HTML. I use tidy both
to check my HTML and to make it consistent, combined with an Awk script
that adds blank lines at strategic places. So between tidy and my Awk
script, my HTML is fairly navigable, which is the big need.

Additionally, my HTML is purposed to write text content. A lot of text.
Here's just one example:

http://www.troubleshooters.com/lpm/200212/200212.htm

With documents that full of text, you don't want to waste line length
with indentation. It would be much different if I were working with
something DOM rich and text poor, but my stuff is DOM poor and text
rich.

To summarize, the current HTML formatter is horrible and worse yet
inconsistent, certainly a better formatter would be an improvement, but
in my case I'll probably continue writing HTML that starts in the first
column and has tw=72.

Bram, while I have your attention, thanks very much for Vim. Vim
singlehandedly enabled me to move to Linux and still get my work done.
When there was no decent outliner in Linux, Vim came to the rescue. Now
that all the decent Linux WYSIWYG HTML editors are problematic, Vim
comes to the rescue. When I need to do a dangerous mass deletion,
instead of being a cowboy and piping find into grep into xargs rm, I
redirect the file list into a file, Vim the file, turn it into a
shellscript, check it twice, and run it. When I need a quick and
dirty text processing program, especially one intended to be used
one time, instead of using Awk, Perl, Python, or Lua, I'll often do it
in Vim, or maybe make an ex program enabling Vim to do the work. When my
LyX files go really bad and I can't fix them, I put them in Vim and am
able to diagnose the problem. Oh yeah, and I write code with Vim too :-)

Thanks for Vim!

SteveT

Steve Litt * http://www.troubleshooters.com/
Troubleshooting Training * Human Performance

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: