forked from statico/vim-javascript-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.vim
More file actions
24 lines (17 loc) · 797 Bytes
/
sql.vim
File metadata and controls
24 lines (17 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" Vim plugin
" Language: JavaScript
" Maintainer: Ian Langworth <ian@langworth.com>
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
exec 'syntax include @SQLSyntax syntax/' . g:javascript_sql_dialect . '.vim'
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax region sqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@SQLSyntax,jsTemplateExpression,jsSpecial extend
exec 'syntax match sqlTaggedTemplate +\<sql\>\s*\ze`+ nextgroup=sqlTemplateString'
exec 'syntax match sqlTaggedTemplate +\/\*\s*sql\s*\*\/\s*\ze`+ nextgroup=sqlTemplateString'
hi def link sqlTaggedTemplate jsTaggedTemplate
syn cluster jsExpression add=sqlTaggedTemplate
syn cluster sqlTaggedTemplate add=sqlTemplateString