From 829ab22723ae8349b79a7928d7cc8e531b410b42 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 28 Dec 2015 14:58:35 +0100 Subject: Add cql support, closes #98 --- README.md | 1 + build | 1 + ftdetect/polyglot.vim | 6 +++ syntax/cql.vim | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 syntax/cql.vim diff --git a/README.md b/README.md index 1a91752b..089f56ce 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo - [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin) - [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect) +- [cql](https://github.com/elubow/cql-vim) (syntax, ftdetect) - [css](https://github.com/JulesWang/css.vim) (syntax) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) - [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect) diff --git a/build b/build index 474a1f08..0e3b8f7e 100755 --- a/build +++ b/build @@ -104,6 +104,7 @@ PACKS=" cjsx:mtscout6/vim-cjsx clojure:guns/vim-clojure-static coffee-script:kchmck/vim-coffee-script + cql:elubow/cql-vim css:JulesWang/css.vim cucumber:tpope/vim-cucumber dart:dart-lang/dart-vim-plugin diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index ee6cd63a..80938e78 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -45,6 +45,12 @@ function! s:DetectCoffee() endfunction autocmd BufNewFile,BufRead * call s:DetectCoffee() endif +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1 + +if has("autocmd") + au BufNewFile,BufRead *.cql set filetype=cql +endif +endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1 autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber diff --git a/syntax/cql.vim b/syntax/cql.vim new file mode 100644 index 00000000..616f7af3 --- /dev/null +++ b/syntax/cql.vim @@ -0,0 +1,134 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1 + +" Vim syntax file +" Language: cql +" Maintainer: Eric Lubow " +syn match cqlNumber "-\=\<[0-9]*\.[0-9]*\>" +syn match cqlNumber "-\=\<[0-9][0-9]*e[+-]\=[0-9]*\>" +syn match cqlNumber "-\=\<[0-9]*\.[0-9]*e[+-]\=[0-9]*\>" +syn match cqlNumber "\<0x[abcdefABCDEF0-9]*\>" + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_cql_syn_inits") + if version < 508 + let did_cql_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink cqlKeyword Statement + HiLink cqlSpecial Special + HiLink cqlString String + HiLink cqlNumber Number + HiLink cqlVariable Identifier + HiLink cqlComment Comment + HiLink cqlType Type + HiLink cqlOperator Statement + HiLink cqlConsistency Statement + HiLink cqlColType Type + HiLink cqlPStrategy Type + + delcommand HiLink +endif + +let b:current_syntax = "cql" + + +endif -- cgit v1.2.3