Wednesday, January 6, 2016

ftdetect for a new SQL dialect

I have defined my own PostgreSQL dialect and I would like to use it with
.pgsql files by default. Currently, I have this in my ftdetect/pgsql.vim:

au BufNewFile,BufRead *.pgsql setfiletype sql | SQLSetType pgsql

The problem with this is that it first loads the default syntax files and
then the PostgreSQL variant. So, for example, the default syntax file
(sqloracle.vim) links sqlKeyword to sqlSpecial, while I would want to link
it to a different highlight group (and, of course, still let the user
override the plugin's choice). I have tried to prefix my keyword groups
with `pgsql` instead of `sql`, but then they do not seem to be picked for
omnicompletion any longer, even after setting
g:omni_syntax_group_include_pgsql to 'pgsql\w\+' (admittedly, I have set
it inside the syntax script, which I don't think is what one should do).

Is there a way to have the dialect be loaded directly without requiring
the use to set g:sql_type_default?

Nicola





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