On Tuesday, February 10, 2015 at 3:57:57 PM UTC-6, v...@googlecode.com wrote:
> Comment #10 on issue 326 by fmerci...@gmail.com: filetype plugin not loaded  
> when file opened from within vim rather than from command line
> https://code.google.com/p/vim/issues/detail?id=326
> 
> Interestingly enough, if the first file I open is of a different type, the  
> plugins load correctly the first time I use :e (but not the second time)
> 
> $ vim test.html
> (I get HTML syntax and indent and stuff)
> 
> :e foo.py
> :verbose set ts? sta? sts? et? ft?
> 
>    tabstop=8
>          Last set from /usr/share/vim/vim74/ftplugin/python.vim
> nosmarttab
>    softtabstop=4
>          Last set from /usr/share/vim/vim74/ftplugin/python.vim
>    expandtab
>          Last set from /usr/share/vim/vim74/ftplugin/python.vim
>    filetype=python
>          Last set from /usr/share/vim/vim74/filetype.vim
> 
> :e bar.py
> :verbose set ts? sta? sts? et? ft?
> 
>    tabstop=4
> nosmarttab
>    softtabstop=0
> noexpandtab
>    filetype=python
>          Last set from /usr/share/vim/vim74/filetype.vim
> 
> 
> 
> So it's only when opening a second file of the same type that the plugins  
> don't get loaded. Actually, the same thing happens if I load a second HTML  
> file with :e after the first one, so it is not limited to the python plugin.
> 

That's really, really weird.

You are right, it certainly seems like ftplugins stop working after the first 
try. I know of very little that could cause that.

Is the 'eventignore' setting being set somewhere, somehow? I believe that could 
prevent FileType events (and thus filetype plugins) from working properly.

Or perhaps, you have some sort of autocmd that reloads files under some 
situations, and that autocmd is not nested?

If neither of those is the case, it is probably time to determine whether the 
problem lies in your plugins or .vimrc, and do a binary search.

For plugins (easiest with a plugin manager) just remove half the plugins. If 
the problem goes away, it's in the half you removed. Repeat until you find the 
correct plugin.

For .vimrc, place a "finish" command halfway through the .vimrc file. If that 
fixes the problem, it's in the second half. Otherwise, the first half. Remove 
the first "finish" and add a new one halfway through the bad half. Repeat until 
you find the bad option, autocmd, etc.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui