What database are you connecting to?

Vim out of the box supports many different syntax files for different
vendors databases.

C:\Vim\vim81\syntax>dir *sql*
09/02/2016  07:10 AM             2,094 esqlc.vim
09/02/2016  07:10 AM             2,390 msql.vim
09/02/2016  07:10 AM            17,609 mysql.vim
09/02/2016  07:10 AM            12,918 plsql.vim
09/02/2016  07:10 AM             1,120 sql.vim
09/02/2016  07:10 AM            41,929 sqlanywhere.vim
09/02/2016  07:10 AM             6,734 sqlforms.vim
09/02/2016  07:10 AM            11,027 sqlhana.vim
09/02/2016  07:10 AM             5,901 sqlinformix.vim
09/02/2016  07:10 AM             2,970 sqlj.vim
07/10/2018  11:10 AM             7,649 sqloracle.vim

For example, I use SQL Anywhere as my main database, not Oracle which is
the default syntax file for a SQL filetype.

If you try this:
:h ft_sql.txt

It will explain to you how Vim handles different types of databases.

For example, in my .vimrc I have this line:
let g:sql_type_default = 'sqlanywhere'

Which tells Vim to load the syntax/sqlanywhere.vim file instead of the
Oracle one for a .sql file.

You also can run:
:SQLSetType <hit the tab key to cycle through your options>
:SQLSetType sqlinformix.sql
:SQLSetType mysql.sql

So back to your initial question, if for example MySQL supports the # sign
as a comment marker, then the syntax/mysql.vim will most likely support and
set that up for you.
So, if you are 90% of the time connecting and using a MySQL database, you
should do this in your .vimrc:
let g:sql_type_default = 'mysql'

HTH,
David


On Sat, Feb 16, 2019 at 7:44 PM Frank Greico <[email protected]>
wrote:

> Currently when editing a .sql file with vim only C-Style comments get
> highlighted as a comment /* like this */ But not the one line style. # like
> this. Please added the same color of highlighting to the one line style.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/3983>
>
> --
> --
> You received this message from the "vim_dev" 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_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui