Thursday, November 6, 2014

Re: Autocommand vs ftplugin

On Do, 06 Nov 2014, Gary Johnson wrote:
> 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'.

+1

That's how I do it and my csv plugin even expect it to do so,
because the ftplugin.vim file determines the regular expression to match
the CSV delimiter and this is then used in the syntax script.

Quoting from :h csv-syntax-error
,----
| 6.5 Syntax error when opening a CSV file csv-syntax-error
| ----------------------------------------
| This happens usually, when the syntax script is read before the filetype
| plugin, so the plugin did not have a chance to setup the column delimiter
| correctly.
|
| The easy way to fix it, is to reverse the order of the :syntax on (:syn-on)
| and :filetype plugin (:filetype-plugin-on) statements in your .vimrc
|
| Alternatively, you can simply call InitCSV and ignore the error.
|
`----

Best,
Christian
--

--
--
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