Tuesday, June 4, 2013

I'm unable to override indentexpr

Hi all,

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:

indentexpr=HtmlIndentGet(v:lnum)
Last set from /usr/share/vim/vim73/indent/html.vim

I put a set indentexpr? and a 2sleep in ~/.vim/after/ftplugin/html.vim
after setting indentexpr to nothing, and I indeed got it to stop when
loading an html file, and show me indentexpr wasn't set.

I did the same thing with tw, setting it to 43 in
~/.vim/after/ftplugin/html.vim and 99
in /usr/share/vim/vim73/indent/html.vim, and in the editing session it
was set to 99.

I did a :set rtp?, and here's what I got:

runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

The preceding might wrap, but suffice it to say that ~/.vim/after is
the last thing on it.

The only thing I could find to make indentexpr go away was to comment
it out of /usr/share/vim/vim73/indent/html.vim, but that's not a good
solution.

I've obviously skipped a step. I've proven that ~/.vim/after is the
last thing on the runtime path. I've proven that
~/.vim/after/ftplugin/html.vim actually gets run, and that before it
exits indentexpr is unset. I've proven that the thing setting
indentexpr is indeed /usr/share/vim/vim73/indent/html.vim, and nothing
else is setting it.

I feel like I'm staring into a black box and there's some dark corner
I'm not seeing. How can I narrow this down just one more time?

By the way, thank you to all the people on the #vim IRC channel who
have already helped me with this problem so I could get as far as I
have.

Thanks,

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:

Post a Comment