spraff
spraff

Reputation: 33415

How do I tell vim to default to a particular dialect of SQL for syntax highlighting?

From vim's documentation

Vim currently supports the Oracle and Informix dialects of SQL. Vim assumes "*.sql" files are Oracle SQL by default.

I am writing for Informix. How do I tell vim to use that dialect for syntax highlighting?

Upvotes: 1

Views: 555

Answers (2)

Matt
Matt

Reputation: 15176

To change the global default you need

let g:sql_type_default = 'sqlinformix'

:SQLSetType is used to change dialect for an open buffer.

Upvotes: 1

phd
phd

Reputation: 94602

From the same vim docs:

For the people that work with many different databases, it is nice to be able to flip between the various vendors rules (indent, syntax) on a per buffer basis, at any time. The ftplugin/sql.vim file defines this function: SQLSetType

So run

:runtime ftplugin/sql.vim " If it's not already read
:SQLSetType sqlinformix

Upvotes: 1

Related Questions