A well-behaved indent script has a check at the top of it to see whether
the buffer already has some sort of script-based indenting enabled, and
if so does nothing. For example, indent/html.vim has this:
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
So, to disable it, you can just make a ~/.vim/indent/html.vim (or
~/vimfiles/indent/html.vim on Windows) and put in it the single line
let b:did_indent = 1
It will be loaded before the system-wide one (because the runtime files
in $HOME take precedence) and stop the system-wide one from doing
anything (because the system-wide one checks that variable).
~Matt
<pedantic>
Note that if you have a naughty distro that puts "filetype plugin
indent on" in the systemwide vimrc, that won't be enough - you'll need
to instead do
filetype off
filetype plugin on
</pedantic>
~Matt
That won't be enough, because ":filetype off" remembers your settings
for later: it is not the same as ":filetype plugin indent off".
Rather than the two commands above, you should use
filetype indent off
The same applies if you source the vimrc_example.vim (which has a
"filetype plugin indent on" somewhere in it): just unset
filetype-dependent indenting just after sourcing the vimrc_example.vim then.
See ":help :filetype-overview"
Best regards,
Tony.
--
He hadn't a single redeeming vice.
-- Oscar Wilde
Yes, Suresh, this is the right way to disable filetype-specific
indenting for a single filetype.
Renaming the $VIMRUNTIME/indent/html.vim, or editing it in-place, won't
work, because as soon as you bring your runtime files up-to-date
(something which you should do often), you'll get a fresh copy of the
original script, with all your changes removed, and all that without a
warning message to you.
Best regards,
Tony.
--
Decisions of the judges will be final unless shouted down by a really
overwhelming majority of the crowd present. Abusive and obscene
language may not be used by contestants when addressing members of the
judging panel, or, conversely, by members of the judging panel when
addressing contestants (unless struck by a boomerang).
-- Mudgeeraba Creek Emu-Riding and Boomerang-Throwing
Assoc.