Thursday, November 6, 2014

Re: Autocommand vs ftplugin

On 2014-11-06, Cesar Romani wrote:
> On 05/11/2014 06:47 p.m., Gary Johnson wrote:
> > On 2014-11-05, Matteo Riva wrote:
> >> On Wed, Nov 5, 2014 at 7:54 PM, Christian Brabandt wrote:
> >>
> >>> Do you actually have a line :filetype on or similar in your .vimrc?
> >>
> >> Yes I do, and I could verify that the ftplugin file is executed (I set
> >> a custom variable and it shows when opening the file)
> >
> > The php_folding variable controls the behavior of the syntax/php.vim
> > file, not the ftplugin/php.vim file. Also, if you have
> >
> > syntax on
> >
> > in your ~/.vimrc before
> >
> > filetype plugin on
> >
> > then syntax/php.vim will be sourced before ftplugin/php.vim or
> > after/ftplugin/php.vim.
>
> I'm using vim 7.4.507 on Windows and on $VIMRUNTIME/vimrc_example.vim,
> which is sourced on _vimrc, 'syntax on' comes before 'filetype plugin
> indent on.' Should I also swap both lines?

Good question. I'm not sure.

My first thought is that if it ain't broke, don't fix it. If you're
not having problems like Matteo had, there is no reason to swap
those lines.

On the other hand, it makes more sense to me to execute :filetype
before :syntax, which is what I do in my own ~/.vimrc. That allows
me to make syntax-setting decisions based on 'filetype'.

I don't know why $VIMRUNTIME/vimrc_example.vim has those commands in
the order it does or if any plugins depend on that order.

Regards,
Gary

--
--
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/d/optout.

No comments:

Post a Comment