diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-01 16:02:38 +0200 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-01 16:02:38 +0200 | 
| commit | 45c1923f43f2bb2e626fe910654d4395a0e50a04 (patch) | |
| tree | 1312bed0819c740f8fe053558da8ee44b7e969f6 | |
| parent | 8dd0474feb60a4b9f50ee2b8decead0146623966 (diff) | |
| download | vim-polyglot-45c1923f43f2bb2e626fe910654d4395a0e50a04.tar.gz vim-polyglot-45c1923f43f2bb2e626fe910654d4395a0e50a04.zip | |
Add sql support for javascriptv4.7.0
Diffstat (limited to '')
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | after/syntax/javascript/sql.vim | 26 | ||||
| -rw-r--r-- | ftdetect/polyglot.vim | 6 | ||||
| -rw-r--r-- | packages.yaml | 5 | ||||
| -rwxr-xr-x | scripts/build | 3 | 
5 files changed, 42 insertions, 1 deletions
| @@ -7,7 +7,7 @@ A collection of language packs for Vim.  > One to rule them all, one to find them, one to bring them all and in the darkness bind them.  - It **won't affect your startup time**, as scripts are loaded only on demand\*. -- It **installs and updates 120+ times faster** than the <!--Package Count-->189<!--/Package Count--> packages it consists of. +- It **installs and updates 120+ times faster** than the <!--Package Count-->190<!--/Package Count--> packages it consists of.  - It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect).  - Solid syntax and indentation support (other features skipped). Only the best language packs.  - All unnecessary files are ignored (like enormous documentation from php support). @@ -132,6 +132,7 @@ If you need full functionality of any plugin, please use it directly with your p  - [icalendar](https://github.com/chutzpah/icalendar.vim)  - [idris](https://github.com/idris-hackers/idris-vim)  - [ion](https://github.com/vmchale/ion-vim) +- [javascript-sql](https://github.com/statico/vim-javascript-sql)  - [javascript](https://github.com/pangloss/vim-javascript)  - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)  - [jinja](https://github.com/lepture/vim-jinja) diff --git a/after/syntax/javascript/sql.vim b/after/syntax/javascript/sql.vim new file mode 100644 index 00000000..8b45203c --- /dev/null +++ b/after/syntax/javascript/sql.vim @@ -0,0 +1,26 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript-sql') == -1 + +" 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\)\%(`\)\@=+ nextgroup=sqlTemplateString' + +hi def link sqlTemplateString jsTemplateString +hi def link sqlTaggedTemplate jsTaggedTemplate + +syn cluster jsExpression add=sqlTaggedTemplate +syn cluster sqlTaggedTemplate add=sqlTemplateString + +endif diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 5f4ed809..974aa924 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -28,6 +28,9 @@ call s:SetDefault('g:markdown_enable_mappings', 0)  " Enable jsx syntax by default  call s:SetDefault('g:jsx_ext_required', 0) +" Needed for sql highlighting +call s:SetDefault('g:javascript_sql_dialect', 'sql') +  " Make csv loading faster  call s:SetDefault('g:csv_start', 1)  call s:SetDefault('g:csv_end', 2) @@ -573,6 +576,9 @@ if !has_key(s:disabled_packages, 'ion')    au BufNewFile,BufRead ~/.config/ion/initrc setf ion  endif +if !has_key(s:disabled_packages, 'javascript-sql') +endif +  if !has_key(s:disabled_packages, 'javascript')    au BufNewFile,BufRead *._js setf javascript    au BufNewFile,BufRead *.bones setf javascript diff --git a/packages.yaml b/packages.yaml index 35c01503..23489187 100644 --- a/packages.yaml +++ b/packages.yaml @@ -773,6 +773,11 @@ filetypes:    extensions:    - flow  --- +name: javascript-sql +remote: statico/vim-javascript-sql +after: javascript +filetypes: [] +---  name: jenkins  remote: martinda/Jenkinsfile-vim-syntax  filetypes: diff --git a/scripts/build b/scripts/build index 2e596d52..384c8423 100755 --- a/scripts/build +++ b/scripts/build @@ -391,6 +391,9 @@ def generate_ftdetect(packages, heuristics)      " Enable jsx syntax by default      call s:SetDefault('g:jsx_ext_required', 0) +    " Needed for sql highlighting +    call s:SetDefault('g:javascript_sql_dialect', 'sql') +      " Make csv loading faster      call s:SetDefault('g:csv_start', 1)      call s:SetDefault('g:csv_end', 2) | 
