On Tuesday, October 20, 2015 at 8:47:27 PM UTC+2, ZyX wrote:
> 2015-10-20 21:11 GMT+03:00 glts <[email protected]>:
> > In a plain Vim installation, if I have a personal ftplugin
> > ~/.vim/ftplugin/text.vim that contains the line
> >
> >         setlocal expandtab
> 
> This file is missing `b:undo_ftplugin` variable, see :h undo_ftplugin.
> Examples are in every or nearly every ftplugin file in default
> distribution.
> 
> >
> > then 'expandtab' will be on in Vim "help" files. It would be better not
> > to apply settings for "text" files to help files. Would this be an
> > acceptable fix? Alternatively, we could just try to detect help files
> > directly.
> >
> > Best,
> >
> >
> > --
> > David
> >
> >
> >
> > diff --git a/runtime/filetype.vim b/runtime/filetype.vim
> > index 4d2ffe8..460f6bf 100644
> > --- a/runtime/filetype.vim
> > +++ b/runtime/filetype.vim
> > @@ -2713,7 +2713,11 @@ au BufNewFile,BufRead zsh*,zlog*        call
> > s:StarSetf('zsh')
> >
> >  " Plain text files, needs to be far down to not override others.  This 
> > avoids
> >  " the "conf" type being used if there is a line starting with '#'.
> > -au BufNewFile,BufRead *.txt,*.text,README    setf text
> > +au BufNewFile,BufRead *.text,README        setf text
> > +au BufNewFile,BufRead *.txt
> > +    \ if !(expand('<amatch>:p:h:t') ==# 'doc' && getline(1) =~# '^\*.*\*')
> > +    \|  setf text
> > +    \|endif
> >
> >
> >  " Use the filetype detect plugins.  They may overrule any of the previously

Right, thanks. For some reason I didn't realise b:undo_ftplugin applies
to ftplugins in ~/.vim, too.

To make sure -- this really is the desired behaviour: every time I open
a help file, my "text" ftplugin is sourced, then the modeline sets
ft=help, so all settings, mappings, etc. from the "text" ftplugin are
undone (as well as possible), and only then the "help" ftplugin is
sourced.

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui