On 08/06/09 05:04, Matt Wozniski wrote:
>
> On Sun, Jun 7, 2009 at 7:43 PM, Suresh Govindachar wrote:
>>
>> Which is the preferred way to diable runtime/indent/html.vim (instead
>> of just renaming the file)?
>
> 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

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to