Sunday, January 10, 2016

Re: ftdetect for a new SQL dialect

On 2016-01-09 10:24:08 +0000, Nicola said:

>> Is there a way to have the dialect be loaded directly without requiring
>> the use to set g:sql_type_default?
>
>> Is pgsql not a good choice as a default for you?
>
> Yes, for me it is. But, in the perspective of making my plugin available
> to a general audience, I can imagine a situation where a user would want
> to use it only for files with a .pgsql extension and not for .sql files.
> Besides, the issue described above may exist with other dialects.
>
> How about introducing a buffer local b:sql_type_default? Your plugin
> might check whether such a variable exists and, if it does, load the
> corresponding file. In a dialect plugin one would then define:
>
> au BufNewFile,BufRead *.pgsql let b:sql_type_default='pgsql' | setfiletype sql

Never mind. I have found that what I need is already there (though apparently
undocumented):

au BufNewFile,BufRead *.pgsql let b:sql_type_override='pgsql' | setfiletype sql

Anyway, given the way highlight groups are (re)defined, for best consistency
I have decided to use the same highlight groups as in sqloracle.vim. They may
always be changed in one's vimrc if necessary.

On a side note: I'd like to see a PostgreSQL syntax in Vim; how may I
contribute?

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: