This commit is contained in:
Adam Stankiewicz
2021-01-14 20:59:40 +01:00
parent 7bde552a46
commit 22040ce638
28 changed files with 273 additions and 430 deletions

View File

@@ -9,7 +9,7 @@ endif
" License: Vim license (see `:help license`)
" Based on PostgreSQL 13.1
" Automatically generated on 2020-12-30 at 10:21:40
" Automatically generated on 2021-01-13 at 20:54:21
if exists("b:current_syntax")
finish
@@ -2010,20 +2010,26 @@ else
\ contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlPlpgsqlKeyword,sqlPlpgsqlVariable,sqlPlpgsqlOperator,sqlNumber,sqlIsOperator,sqlString,sqlTodo
endif
" Folding
syn region sqlFold start='^\s*\zs\c\(create\|update\|alter\|select\|insert\|do\)\>' end=';$' transparent fold contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlIdentifier,sqlNumber,sqlOperator,sqlSpecial,sqlString,sqlTodo,plpgsql
let s:plgroups = 'plpgsql'
" PL/<any other language>
fun! s:add_syntax(s)
execute 'syn include @PL' . a:s . ' syntax/' . a:s . '.vim'
execute 'syn include @PL' .. a:s .. ' syntax/' .. a:s .. '.vim'
unlet b:current_syntax
execute 'syn region pgsqlpl' . a:s . ' matchgroup=sqlString start=+\$' . a:s . '\$+ end=+\$' . a:s . '\$+ keepend contains=@PL' . a:s
execute 'syn region pgsqlpl' .. a:s .. ' matchgroup=sqlString start=+\$' .. a:s .. '\$+ end=+\$' .. a:s .. '\$+ keepend contains=@PL' .. a:s
let s:plgroups .= ',pgsqlpl' .. a:s
endf
for pl in get(b:, 'pgsql_pl', get(g:, 'pgsql_pl', []))
call s:add_syntax(pl)
endfor
" Folding
execute "syn region sqlFold start='^\s*\zs\c\(create\|update\|alter\|select\|insert\|do\)\>' end=';$' transparent fold "
\ .. "contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlIdentifier,sqlNumber,sqlOperator,sqlSpecial,sqlString,sqlTodo," .. s:plgroups
unlet s:plgroups
" Default highlighting
hi def link sqlCatalog Constant
hi def link sqlComment Comment