mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d3b20bc68 | ||
|
|
a6b0efd530 | ||
|
|
0de043adbc |
@@ -40,10 +40,12 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
|
||||||
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
||||||
|
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
|
||||||
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
|
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
|
||||||
- [haskell](https://github.com/raichoo/haskell-vim) (syntax, indent, ftplugin, ftdetect)
|
- [haskell](https://github.com/raichoo/haskell-vim) ()
|
||||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
||||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
||||||
@@ -53,6 +55,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [json](https://github.com/sheerun/vim-json) (syntax, indent, ftdetect)
|
- [json](https://github.com/sheerun/vim-json) (syntax, indent, ftdetect)
|
||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||||
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
||||||
|
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftdetect)
|
||||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
|
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
|
||||||
setlocal formatoptions-=cro formatoptions+=j
|
|
||||||
setlocal iskeyword+=-,.,*
|
|
||||||
setlocal commentstring=--\ %s
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
|
||||||
setlocal formatoptions-=cro formatoptions+=j
|
|
||||||
setlocal iskeyword+='
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -12,6 +12,19 @@ syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
|
|||||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||||
\ containedin=htmlHead
|
\ containedin=htmlHead
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||||
|
|
||||||
|
" Language: OpenGL Shading Language
|
||||||
|
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||||
|
|
||||||
|
syn include @GLSL syntax/glsl.vim
|
||||||
|
syn region ShaderScript
|
||||||
|
\ start="<script [^>]*type=\('\|\"\)x-shader/x-\(vertex\|fragment\)\('\|\"\)[^>]*>"
|
||||||
|
\ keepend
|
||||||
|
\ end="</script>"me=s-1
|
||||||
|
\ contains=@GLSL,htmlScriptTag,@htmlPreproc
|
||||||
|
|
||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||||
|
|
||||||
|
|||||||
3
build
3
build
@@ -111,7 +111,9 @@ PACKS="
|
|||||||
emblem:heartsentwined/vim-emblem
|
emblem:heartsentwined/vim-emblem
|
||||||
erlang:hcs42/vim-erlang-runtime
|
erlang:hcs42/vim-erlang-runtime
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
|
glsl:tikhomirov/vim-glsl
|
||||||
go:fatih/vim-go:_BASIC
|
go:fatih/vim-go:_BASIC
|
||||||
|
groovy:vim-scripts/groovy.vim
|
||||||
haml:tpope/vim-haml
|
haml:tpope/vim-haml
|
||||||
handlebars:mustache/vim-mustache-handlebars
|
handlebars:mustache/vim-mustache-handlebars
|
||||||
haskell:raichoo/haskell-vim
|
haskell:raichoo/haskell-vim
|
||||||
@@ -124,6 +126,7 @@ PACKS="
|
|||||||
json:sheerun/vim-json
|
json:sheerun/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
jsx:mxw/vim-jsx:_ALL
|
jsx:mxw/vim-jsx:_ALL
|
||||||
|
kotlin:udalov/kotlin-vim
|
||||||
latex:LaTeX-Box-Team/LaTeX-Box
|
latex:LaTeX-Box-Team/LaTeX-Box
|
||||||
less:groenewege/vim-less
|
less:groenewege/vim-less
|
||||||
liquid:tpope/vim-liquid
|
liquid:tpope/vim-liquid
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
|||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||||
@@ -85,6 +85,10 @@ autocmd BufNewFile,BufRead *
|
|||||||
\ set filetype=gitsendemail |
|
\ set filetype=gitsendemail |
|
||||||
\ endif
|
\ endif
|
||||||
endif
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||||
|
|
||||||
|
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
|
||||||
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
|
|
||||||
let s:current_fileformats = ''
|
let s:current_fileformats = ''
|
||||||
@@ -99,7 +103,7 @@ function! s:gofiletype_post()
|
|||||||
let &g:fileformats = s:current_fileformats
|
let &g:fileformats = s:current_fileformats
|
||||||
let &g:fileencodings = s:current_fileencodings
|
let &g:fileencodings = s:current_fileencodings
|
||||||
endfunction
|
endfunction
|
||||||
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
||||||
au BufRead *.go call s:gofiletype_pre()
|
au BufRead *.go call s:gofiletype_pre()
|
||||||
au BufReadPost *.go call s:gofiletype_post()
|
au BufReadPost *.go call s:gofiletype_post()
|
||||||
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
||||||
@@ -110,10 +114,6 @@ autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
|||||||
autocmd BufNewFile,BufRead *.sass setf sass
|
autocmd BufNewFile,BufRead *.sass setf sass
|
||||||
autocmd BufNewFile,BufRead *.scss setf scss
|
autocmd BufNewFile,BufRead *.scss setf scss
|
||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
au BufRead,BufNewFile *.hsc set filetype=haskell
|
|
||||||
endif
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.hx setf haxe
|
autocmd BufNewFile,BufRead *.hx setf haxe
|
||||||
@@ -144,6 +144,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
|||||||
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
||||||
au BufRead,BufNewFile *.jl set filetype=julia
|
au BufRead,BufNewFile *.jl set filetype=julia
|
||||||
endif
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
|
|
||||||
|
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
||||||
|
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
||||||
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.less setf less
|
autocmd BufNewFile,BufRead *.less setf less
|
||||||
@@ -273,6 +278,8 @@ au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
|||||||
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
||||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||||
|
au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
||||||
|
au BufNewFile,BufRead .simplecov set filetype=ruby
|
||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
|
|
||||||
@@ -346,7 +353,7 @@ autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
|||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
if exists("g:loaded_haskellvim_cabal")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let g:loaded_haskellvim_cabal = 1
|
|
||||||
|
|
||||||
function! s:makeSection(content)
|
|
||||||
return "\n" . join(a:content, "\n")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:exeTmpl(name, src)
|
|
||||||
let l:exetmpl = [ 'executable ' . a:name,
|
|
||||||
\ '-- ghc-options:',
|
|
||||||
\ 'main-is: ' . a:src,
|
|
||||||
\ '-- other-modules:',
|
|
||||||
\ '-- other-extensions:',
|
|
||||||
\ 'build-depends: base',
|
|
||||||
\ '-- hs-source-dirs:',
|
|
||||||
\ 'default-language: Haskell2010'
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
return s:makeSection(l:exetmpl)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:libTmpl()
|
|
||||||
let l:libtmpl = [ 'library',
|
|
||||||
\ '-- ghc-options:',
|
|
||||||
\ '-- other-modules:',
|
|
||||||
\ '-- other-extensions:',
|
|
||||||
\ 'build-depends: base',
|
|
||||||
\ '-- hs-source-dirs:',
|
|
||||||
\ 'default-language: Haskell2010'
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
return s:makeSection(l:libtmpl)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:flagTmpl(name)
|
|
||||||
let l:flagtmpl = [ 'flag ' . a:name,
|
|
||||||
\ 'description:',
|
|
||||||
\ 'default: False',
|
|
||||||
\ 'manual: True',
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
return s:makeSection(l:flagtmpl)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! cabal#addExecutable()
|
|
||||||
let l:name = input("Enter executable name: ")
|
|
||||||
let l:src = input("Enter source file: ")
|
|
||||||
exe "normal Go" . s:exeTmpl(l:name, l:src)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! cabal#addLibrary()
|
|
||||||
exe "normal Go" . s:libTmpl()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! cabal#addFlag()
|
|
||||||
let l:name = input("Enter flag name: ")
|
|
||||||
exe "normal Go" . s:flagTmpl(l:name)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
command! -buffer CabalAddExecutable call cabal#addExecutable()
|
|
||||||
command! -buffer CabalAddLibrary call cabal#addLibrary()
|
|
||||||
command! -buffer CabalAddFlag call cabal#addFlag()
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
if exists("g:loaded_haskellvim_haskell")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let g:loaded_haskellvim_haskell = 1
|
|
||||||
|
|
||||||
function! haskell#makeModuleCommentBlock()
|
|
||||||
let l:commenttmpl = [ '{-|',
|
|
||||||
\ 'Module : ',
|
|
||||||
\ 'Description : ',
|
|
||||||
\ 'Copyright : ',
|
|
||||||
\ 'License : ',
|
|
||||||
\ 'Maintainer : ',
|
|
||||||
\ 'Stability : ',
|
|
||||||
\ 'Portability : ',
|
|
||||||
\ '-}']
|
|
||||||
|
|
||||||
exe "normal ggO" . join(l:commenttmpl, "\n")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
command! -buffer -nargs=0 HaskellAddModuleComment call haskell#makeModuleCommentBlock()
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -21,7 +21,7 @@ setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
|||||||
setlocal omnifunc=csscomplete#CompleteCSS
|
setlocal omnifunc=csscomplete#CompleteCSS
|
||||||
setlocal suffixesadd=.less
|
setlocal suffixesadd=.less
|
||||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
|
||||||
setlocal fo=jcroql
|
setlocal fo=croql
|
||||||
|
|
||||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ setlocal define=[^A-Za-z_]
|
|||||||
" after/ftplugin/perl6.vim file that contains
|
" after/ftplugin/perl6.vim file that contains
|
||||||
" set isfname-=:
|
" set isfname-=:
|
||||||
set isfname+=:
|
set isfname+=:
|
||||||
setlocal iskeyword=@,48-57,_,192-255,:,-,'
|
setlocal iskeyword=@,48-57,_,192-255,-
|
||||||
|
|
||||||
" Set this once, globally.
|
" Set this once, globally.
|
||||||
if !exists("perlpath")
|
if !exists("perlpath")
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ endfunction
|
|||||||
|
|
||||||
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
||||||
let s:version_file = findfile('.ruby-version', '.;')
|
let s:version_file = findfile('.ruby-version', '.;')
|
||||||
if !empty(s:version_file)
|
if !empty(s:version_file) && filereadable(s:version_file)
|
||||||
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
||||||
if !has_key(g:ruby_version_paths, b:ruby_version)
|
if !has_key(g:ruby_version_paths, b:ruby_version)
|
||||||
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
||||||
@@ -209,16 +209,16 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
||||||
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||||
|
|
||||||
nmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? 'zv' : ''
|
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
|
||||||
call s:map('n', '<silent>', '<C-]> <SID>c:tag <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', 'g<C-]> <SID>:tjump <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', 'g] <SID>:tselect <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>] <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W><C-]> <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:stjump <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>g] <SID>:stselect <Plug><cword><CR><SID>tagzv')
|
call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>} <SID>c:ptag <Plug><cword><CR>')
|
call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>g} <SID>:ptjump <Plug><cword><CR>')
|
call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><cword>"<CR>')
|
||||||
|
|
||||||
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
||||||
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
" indentation for cabal
|
|
||||||
"
|
|
||||||
" author: raichoo (raichoo@googlemail.com)
|
|
||||||
"
|
|
||||||
if exists('b:did_indent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
if !exists('g:cabal_indent_section')
|
|
||||||
"executable name
|
|
||||||
">>main-is: Main.hs
|
|
||||||
">>hs-source-dirs: src
|
|
||||||
let g:cabal_indent_section = 2
|
|
||||||
elseif exists('g:cabal_indent_section') && g:cabal_indent_section > 4
|
|
||||||
let g:cabal_indent_section = 4
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal indentexpr=GetCabalIndent()
|
|
||||||
setlocal indentkeys=!^F,o,O,<CR>
|
|
||||||
|
|
||||||
function! GetCabalIndent()
|
|
||||||
let l:prevline = getline(v:lnum - 1)
|
|
||||||
|
|
||||||
if l:prevline =~ '\C^\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)'
|
|
||||||
return g:cabal_indent_section
|
|
||||||
else
|
|
||||||
return match(l:prevline, '\S')
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
endif
|
|
||||||
14
indent/glsl.vim
Normal file
14
indent/glsl.vim
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||||
|
|
||||||
|
" Language: OpenGL Shading Language
|
||||||
|
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal autoindent cindent
|
||||||
|
|
||||||
|
" vim:set sts=2 sw=2 :
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
" indentation for haskell
|
|
||||||
"
|
|
||||||
" Based on idris indentation
|
|
||||||
"
|
|
||||||
" author: raichoo (raichoo@googlemail.com)
|
|
||||||
"
|
|
||||||
" Modify g:haskell_indent_if and g:haskell_indent_case to
|
|
||||||
" change indentation for `if'(default 3) and `case'(default 5).
|
|
||||||
" Example (in .vimrc):
|
|
||||||
" > let g:haskell_indent_if = 2
|
|
||||||
|
|
||||||
if exists('b:did_indent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_if')
|
|
||||||
" if bool
|
|
||||||
" >>>then ...
|
|
||||||
" >>>else ...
|
|
||||||
let g:haskell_indent_if = 3
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_case')
|
|
||||||
" case xs of
|
|
||||||
" >>[] -> ...
|
|
||||||
" >>(y:ys) -> ...
|
|
||||||
let g:haskell_indent_case = 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_let')
|
|
||||||
" let x = 0 in
|
|
||||||
" >>>>x
|
|
||||||
let g:haskell_indent_let = 4
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_where')
|
|
||||||
" where f :: Int -> Int
|
|
||||||
" >>>>>>f x = x
|
|
||||||
let g:haskell_indent_where = 6
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_do')
|
|
||||||
" do x <- a
|
|
||||||
" >>>y <- b
|
|
||||||
let g:haskell_indent_do = 3
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_in')
|
|
||||||
" let x = 1
|
|
||||||
" >in x
|
|
||||||
let g:haskell_indent_in = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal indentexpr=GetHaskellIndent()
|
|
||||||
setlocal indentkeys=!^F,o,O,0\|,0=where,0=in,0=let,0=deriving,0=->,0=\=>,<CR>,0}
|
|
||||||
|
|
||||||
function! GetHaskellIndent()
|
|
||||||
let l:prevline = getline(v:lnum - 1)
|
|
||||||
|
|
||||||
if l:prevline =~ '^\s*--'
|
|
||||||
return match(l:prevline, '\S')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '^\s*$'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:line = getline(v:lnum)
|
|
||||||
|
|
||||||
if l:line =~ '\C^\s*\<where\>'
|
|
||||||
let l:s = match(l:prevline, '\S')
|
|
||||||
return l:s + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:line =~ '\C^\s*\<deriving\>'
|
|
||||||
let l:s = match(l:prevline, '\C\<\(newtype\|data\)\>')
|
|
||||||
if l:s >= 0
|
|
||||||
return l:s + &shiftwidth
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:line =~ '\C^\s*\<let\>'
|
|
||||||
let l:s = match(l:prevline, '\C\<let\>')
|
|
||||||
if l:s != 0
|
|
||||||
return l:s
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:line =~ '\C^\s*\<in\>'
|
|
||||||
let l:s = match(l:prevline, '\C\<let\>')
|
|
||||||
if l:s >= 0
|
|
||||||
return l:s + g:haskell_indent_in
|
|
||||||
elseif match(l:prevline, '=') > 0
|
|
||||||
let l:s = match(l:prevline, '\S')
|
|
||||||
return l:s - (4 - g:haskell_indent_in)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:line =~ '^\s*|'
|
|
||||||
if match(l:prevline, '^\s*data') < 0
|
|
||||||
if match(l:prevline, '^\s*|\s') >= 0
|
|
||||||
return match(l:prevline, '|')
|
|
||||||
else
|
|
||||||
return &shiftwidth
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:line =~ '^\s*[=-]>'
|
|
||||||
let l:s = match(l:prevline, ' :: ')
|
|
||||||
if l:s >= 0
|
|
||||||
return l:s + 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\s\+[!#$%&*+./<>?@\\^|~-]\+\s*$'
|
|
||||||
let l:s = match(l:prevline, '\S')
|
|
||||||
if l:s > 0
|
|
||||||
return l:s + &shiftwidth
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '[{([][^})\]]\+$'
|
|
||||||
return match(l:prevline, '[{([]')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\<let\>\s\+[^=]\+=\s*$'
|
|
||||||
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\<let\>\s\+.\+\(\<in\>\)\?\s*$'
|
|
||||||
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline !~ '\C\<else\>'
|
|
||||||
let l:s = match(l:prevline, '\C\<if\>.*\&.*\zs\<then\>')
|
|
||||||
if l:s > 0
|
|
||||||
return l:s
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:s = match(l:prevline, '\C\<if\>')
|
|
||||||
if l:s > 0
|
|
||||||
return l:s + g:haskell_indent_if
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
|
|
||||||
return match(l:prevline, '\S') + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\<where\>\s\+\S\+.*$'
|
|
||||||
return match(l:prevline, '\C\<where\>') + g:haskell_indent_where
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\<do\>\s\+\S\+.*$'
|
|
||||||
return match(l:prevline, '\C\<do\>') + g:haskell_indent_do
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C^\s*\<data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
|
|
||||||
if l:line =~ '^\s*|'
|
|
||||||
return match(l:prevline, '=')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C\<case\>\s\+.\+\<of\>\s*$'
|
|
||||||
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
|
|
||||||
endif
|
|
||||||
|
|
||||||
if l:prevline =~ '\C^\s*\<\data\>\s\+\S\+\s*$'
|
|
||||||
return match(l:prevline, '\C\<data\>') + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
return match(l:prevline, '\S')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
endif
|
|
||||||
54
indent/kotlin.vim
Normal file
54
indent/kotlin.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language: Kotlin
|
||||||
|
" Maintainer: Alexander Udalov
|
||||||
|
" Latest Revision: 27 June 2015
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal indentexpr=GetKotlinIndent()
|
||||||
|
setlocal indentkeys=0},0),!^F,o,O,e,<CR>
|
||||||
|
setlocal autoindent " TODO ?
|
||||||
|
|
||||||
|
" TODO teach it to count bracket balance, etc.
|
||||||
|
function! GetKotlinIndent()
|
||||||
|
if v:lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prev_num = prevnonblank(v:lnum - 1)
|
||||||
|
let prev = getline(prev_num)
|
||||||
|
let prev_indent = indent(prev_num)
|
||||||
|
let cur = getline(v:lnum)
|
||||||
|
|
||||||
|
let prev_open_paren = prev =~ '^.*(\s*$'
|
||||||
|
let cur_close_paren = cur =~ '^\s*).*$'
|
||||||
|
|
||||||
|
if prev_open_paren && !cur_close_paren
|
||||||
|
return prev_indent + 2 * &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cur_close_paren && !prev_open_paren
|
||||||
|
return prev_indent - 2 * &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
let prev_open_brace = prev =~ '^.*\({\|->\)\s*$'
|
||||||
|
let cur_close_brace = cur =~ '^\s*}.*$'
|
||||||
|
|
||||||
|
if prev_open_brace && !cur_close_brace
|
||||||
|
return prev_indent + &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cur_close_brace && !prev_open_brace
|
||||||
|
return prev_indent - &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
return prev_indent
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -60,9 +60,21 @@ function GetTypescriptIndent()
|
|||||||
return indent(prev)
|
return indent(prev)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If a variable was declared and the semicolon omitted, do not indent
|
" If the previous line starts with '@', we should have the same indent as
|
||||||
" the next line
|
" the previous one
|
||||||
if getline(prev) =~ '^\s*var\s\+\w\+'
|
if getline(prev) =~ '^\s*@\S\+\s*$'
|
||||||
|
return indent(prev)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If a var, let, or const was declared and the semicolon omitted, do not
|
||||||
|
" indent the next line
|
||||||
|
if getline(prev) =~ '^\s*\(var\|let\|const\)\s\+\w\+'
|
||||||
|
return indent(prev)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the line ended with a ',', we should have the same indent as
|
||||||
|
" the previous one
|
||||||
|
if getline(prev) =~ ',\s*$'
|
||||||
return indent(prev)
|
return indent(prev)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
" syntax highlighting for cabal
|
|
||||||
"
|
|
||||||
" author: raichoo (raichoo@googlemail.com)
|
|
||||||
|
|
||||||
if version < 600
|
|
||||||
syn clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match cabalLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell
|
|
||||||
syn match cabalIdentifier "[A-Za-z\-]*" contained
|
|
||||||
syn match cabalOperator "[<=>&|!]"
|
|
||||||
syn match cabalColon ":" contained
|
|
||||||
syn match cabalNumber "\<[0-9][0-9\.*]*\>"
|
|
||||||
syn match cabalDelimiter "[,()]"
|
|
||||||
syn keyword cabalBool True False
|
|
||||||
syn keyword cabalConditional if else
|
|
||||||
syn match cabalCompilerFlag "\s\+-[^ -][^ ]*"
|
|
||||||
syn match cabalDocBulletPoint "^\s\+\*"
|
|
||||||
syn match cabalDocHeadline "^\s\+=.*$"
|
|
||||||
syn match cabalDocCode "^\s\+>.*$"
|
|
||||||
syn match cabalDocNewline "^\s\+\.\s*$"
|
|
||||||
syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)"
|
|
||||||
syn match cabalEntry "^\s*[A-Za-z][a-zA-Z\-]*:" contains=cabalIdentifier,cabalColon
|
|
||||||
|
|
||||||
syn region cabalDescription start="^\s*[dD]escription:" end="^\<" keepend
|
|
||||||
\ contains=
|
|
||||||
\ cabalEntry,
|
|
||||||
\ cabalLineComment,
|
|
||||||
\ cabalDocBulletPoint,
|
|
||||||
\ cabalDocHeadline,
|
|
||||||
\ cabalDocNewline,
|
|
||||||
\ cabalDocCode
|
|
||||||
|
|
||||||
highlight def link cabalIdentifier Identifier
|
|
||||||
highlight def link cabalLineComment Comment
|
|
||||||
highlight def link cabalOperator Operator
|
|
||||||
highlight def link cabalColon Operator
|
|
||||||
highlight def link cabalNumber Number
|
|
||||||
highlight def link cabalSection Structure
|
|
||||||
highlight def link cabalDelimiter Delimiter
|
|
||||||
highlight def link cabalBool Boolean
|
|
||||||
highlight def link cabalCompilerFlag Macro
|
|
||||||
highlight def link cabalConditional Conditional
|
|
||||||
highlight def link cabalDocBulletPoint Structure
|
|
||||||
highlight def link cabalDocHeadline Include
|
|
||||||
highlight def link cabalDocNewline Operator
|
|
||||||
highlight def link cabalDocCode Macro
|
|
||||||
|
|
||||||
let b:current_syntax = "cabal"
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -73,7 +73,7 @@ syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\
|
|||||||
|
|
||||||
syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained
|
syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained
|
||||||
|
|
||||||
syntax region clojureString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape,@Spell
|
syntax region clojureString matchgroup=clojureStringDelimiter start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape,@Spell
|
||||||
|
|
||||||
syntax match clojureCharacter "\\."
|
syntax match clojureCharacter "\\."
|
||||||
syntax match clojureCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)"
|
syntax match clojureCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)"
|
||||||
@@ -156,9 +156,9 @@ syntax match clojureComment "#!.*$"
|
|||||||
" Generated from https://github.com/guns/vim-clojure-static/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
|
" Generated from https://github.com/guns/vim-clojure-static/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
|
||||||
syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector
|
syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector
|
||||||
|
|
||||||
syntax region clojureSexp matchgroup=clojureParen start="(" matchgroup=clojureParen end=")" contains=@clojureTop fold
|
syntax region clojureSexp matchgroup=clojureParen start="(" end=")" contains=@clojureTop fold
|
||||||
syntax region clojureVector matchgroup=clojureParen start="\[" matchgroup=clojureParen end="]" contains=@clojureTop fold
|
syntax region clojureVector matchgroup=clojureParen start="\[" end="]" contains=@clojureTop fold
|
||||||
syntax region clojureMap matchgroup=clojureParen start="{" matchgroup=clojureParen end="}" contains=@clojureTop fold
|
syntax region clojureMap matchgroup=clojureParen start="{" end="}" contains=@clojureTop fold
|
||||||
|
|
||||||
" Highlight superfluous closing parens, brackets and braces.
|
" Highlight superfluous closing parens, brackets and braces.
|
||||||
syntax match clojureError "]\|}\|)"
|
syntax match clojureError "]\|}\|)"
|
||||||
@@ -171,6 +171,7 @@ highlight default link clojureCharacter Character
|
|||||||
highlight default link clojureKeyword Keyword
|
highlight default link clojureKeyword Keyword
|
||||||
highlight default link clojureNumber Number
|
highlight default link clojureNumber Number
|
||||||
highlight default link clojureString String
|
highlight default link clojureString String
|
||||||
|
highlight default link clojureStringDelimiter String
|
||||||
highlight default link clojureStringEscape Character
|
highlight default link clojureStringEscape Character
|
||||||
|
|
||||||
highlight default link clojureRegexp Constant
|
highlight default link clojureRegexp Constant
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
|
|||||||
" Language: C++
|
" Language: C++
|
||||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||||
" Last Change: 2015 Mar 1
|
" Last Change: 2015 Sep 23
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
@@ -51,6 +51,11 @@ if !exists("cpp_no_cpp11")
|
|||||||
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" C++ 14 extensions
|
||||||
|
if !exists("cpp_no_cpp14")
|
||||||
|
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
endif
|
||||||
|
|
||||||
" The minimum and maximum operators in GNU C++
|
" The minimum and maximum operators in GNU C++
|
||||||
syn match cppMinMax "[<>]?"
|
syn match cppMinMax "[<>]?"
|
||||||
|
|
||||||
@@ -74,6 +79,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
|||||||
HiLink cppConstant Constant
|
HiLink cppConstant Constant
|
||||||
HiLink cppRawStringDelimiter Delimiter
|
HiLink cppRawStringDelimiter Delimiter
|
||||||
HiLink cppRawString String
|
HiLink cppRawString String
|
||||||
|
HiLink cppNumber Number
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'css') == -1
|
|||||||
" Nikolai Weibull (Add CSS2 support)
|
" Nikolai Weibull (Add CSS2 support)
|
||||||
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
||||||
" URL: https://github.com/JulesWang/css.vim
|
" URL: https://github.com/JulesWang/css.vim
|
||||||
" Last Change: 2015 Apr.17
|
" Last Change: 2015 Aug.25
|
||||||
|
|
||||||
" For version 5.x: Clear all syntax items
|
" For version 5.x: Clear all syntax items
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
@@ -166,8 +166,8 @@ syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajow
|
|||||||
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
||||||
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
|
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
|
||||||
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
||||||
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
|
syn keyword cssColor contained rosybrown royalblue rebeccapurple saddlebrown salmon
|
||||||
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
|
syn keyword cssColor contained sandybrown seagreen seashell sienna skyblue slateblue
|
||||||
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
|
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
|
||||||
syn keyword cssColor contained thistle tomato turquoise violet wheat
|
syn keyword cssColor contained thistle tomato turquoise violet wheat
|
||||||
syn keyword cssColor contained whitesmoke yellowgreen
|
syn keyword cssColor contained whitesmoke yellowgreen
|
||||||
|
|||||||
660
syntax/glsl.vim
Normal file
660
syntax/glsl.vim
Normal file
@@ -0,0 +1,660 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||||
|
|
||||||
|
" Language: OpenGL Shading Language
|
||||||
|
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||||
|
|
||||||
|
if exists("b:current_syntax") && b:current_syntax == "glsl"
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Statements
|
||||||
|
syn keyword glslConditional if else
|
||||||
|
syn keyword glslRepeat for while do
|
||||||
|
syn keyword glslStatement discard return break continue
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn keyword glslTodo contained TODO FIXME XXX
|
||||||
|
syn region glslCommentL start="//" skip="\\$" end="$" keepend contains=glslTodo,@Spell
|
||||||
|
syn region glslComment matchgroup=glslCommentStart start="/\*" end="\*/" extend contains=glslTodo,@Spell
|
||||||
|
|
||||||
|
" Preprocessor
|
||||||
|
syn region glslPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|else\|elif\|endif\)" skip="\\$" end="$" keepend
|
||||||
|
syn region glslDefine start="^\s*#\s*\(define\|undef\)" skip="\\$" end="$" keepend
|
||||||
|
syn keyword glslTokenConcat ##
|
||||||
|
syn keyword glslPredefinedMacro __LINE__ __FILE__ __VERSION__ GL_ES
|
||||||
|
syn region glslPreProc start="^\s*#\s*\(error\|pragma\|extension\|version\|line\)" skip="\\$" end="$" keepend
|
||||||
|
|
||||||
|
" Boolean Constants
|
||||||
|
syn keyword glslBoolean true false
|
||||||
|
|
||||||
|
" Integer Numbers
|
||||||
|
syn match glslDecimalInt display "\(0\|[1-9]\d*\)"
|
||||||
|
syn match glslOctalInt display "0\o\+"
|
||||||
|
syn match glslHexInt display "0[xX]\x\+"
|
||||||
|
|
||||||
|
" Float Numbers
|
||||||
|
syn match glslFloat display "\d\+\.\([eE][+-]\=\d\+\)\="
|
||||||
|
syn match glslFloat display "\.\d\+\([eE][+-]\=\d\+\)\="
|
||||||
|
syn match glslFloat display "\d\+[eE][+-]\=\d\+"
|
||||||
|
syn match glslFloat display "\d\+\.\d\+\([eE][+-]\=\d\+\)\="
|
||||||
|
|
||||||
|
" Swizzles
|
||||||
|
syn match glslSwizzle display /\.[xyzw]\{1,4\}\>/
|
||||||
|
syn match glslSwizzle display /\.[rgba]\{1,4\}\>/
|
||||||
|
syn match glslSwizzle display /\.[stpq]\{1,4\}\>/
|
||||||
|
|
||||||
|
" Structure
|
||||||
|
syn keyword glslStructure struct
|
||||||
|
|
||||||
|
" This prevents numbers at ends of identifies from being highlighted as numbers
|
||||||
|
syn match glslIdentifier display "\I\i*"
|
||||||
|
|
||||||
|
" Types
|
||||||
|
syn keyword glslType atomic_uint
|
||||||
|
syn keyword glslType bool
|
||||||
|
syn keyword glslType bvec2
|
||||||
|
syn keyword glslType bvec3
|
||||||
|
syn keyword glslType bvec4
|
||||||
|
syn keyword glslType dmat2
|
||||||
|
syn keyword glslType dmat2x2
|
||||||
|
syn keyword glslType dmat2x3
|
||||||
|
syn keyword glslType dmat2x4
|
||||||
|
syn keyword glslType dmat3
|
||||||
|
syn keyword glslType dmat3x2
|
||||||
|
syn keyword glslType dmat3x3
|
||||||
|
syn keyword glslType dmat3x4
|
||||||
|
syn keyword glslType dmat4
|
||||||
|
syn keyword glslType dmat4x2
|
||||||
|
syn keyword glslType dmat4x3
|
||||||
|
syn keyword glslType dmat4x4
|
||||||
|
syn keyword glslType double
|
||||||
|
syn keyword glslType dvec2
|
||||||
|
syn keyword glslType dvec3
|
||||||
|
syn keyword glslType dvec4
|
||||||
|
syn keyword glslType float
|
||||||
|
syn keyword glslType iimage1D
|
||||||
|
syn keyword glslType iimage1DArray
|
||||||
|
syn keyword glslType iimage2D
|
||||||
|
syn keyword glslType iimage2DArray
|
||||||
|
syn keyword glslType iimage2DMS
|
||||||
|
syn keyword glslType iimage2DMSArray
|
||||||
|
syn keyword glslType iimage2DRect
|
||||||
|
syn keyword glslType iimage3D
|
||||||
|
syn keyword glslType iimageBuffer
|
||||||
|
syn keyword glslType iimageCube
|
||||||
|
syn keyword glslType iimageCubeArray
|
||||||
|
syn keyword glslType image1D
|
||||||
|
syn keyword glslType image1DArray
|
||||||
|
syn keyword glslType image2D
|
||||||
|
syn keyword glslType image2DArray
|
||||||
|
syn keyword glslType image2DMS
|
||||||
|
syn keyword glslType image2DMSArray
|
||||||
|
syn keyword glslType image2DRect
|
||||||
|
syn keyword glslType image3D
|
||||||
|
syn keyword glslType imageBuffer
|
||||||
|
syn keyword glslType imageCube
|
||||||
|
syn keyword glslType imageCubeArray
|
||||||
|
syn keyword glslType int
|
||||||
|
syn keyword glslType isampler1D
|
||||||
|
syn keyword glslType isampler1DArray
|
||||||
|
syn keyword glslType isampler2D
|
||||||
|
syn keyword glslType isampler2DArray
|
||||||
|
syn keyword glslType isampler2DMS
|
||||||
|
syn keyword glslType isampler2DMSArray
|
||||||
|
syn keyword glslType isampler2DRect
|
||||||
|
syn keyword glslType isampler3D
|
||||||
|
syn keyword glslType isamplerBuffer
|
||||||
|
syn keyword glslType isamplerCube
|
||||||
|
syn keyword glslType isamplerCubeArray
|
||||||
|
syn keyword glslType ivec2
|
||||||
|
syn keyword glslType ivec3
|
||||||
|
syn keyword glslType ivec4
|
||||||
|
syn keyword glslType mat2
|
||||||
|
syn keyword glslType mat2x2
|
||||||
|
syn keyword glslType mat2x3
|
||||||
|
syn keyword glslType mat2x4
|
||||||
|
syn keyword glslType mat3
|
||||||
|
syn keyword glslType mat3x2
|
||||||
|
syn keyword glslType mat3x3
|
||||||
|
syn keyword glslType mat3x4
|
||||||
|
syn keyword glslType mat4
|
||||||
|
syn keyword glslType mat4x2
|
||||||
|
syn keyword glslType mat4x3
|
||||||
|
syn keyword glslType mat4x4
|
||||||
|
syn keyword glslType sampler1D
|
||||||
|
syn keyword glslType sampler1DArray
|
||||||
|
syn keyword glslType sampler1DArrayShadow
|
||||||
|
syn keyword glslType sampler1DShadow
|
||||||
|
syn keyword glslType sampler2D
|
||||||
|
syn keyword glslType sampler2DArray
|
||||||
|
syn keyword glslType sampler2DArrayShadow
|
||||||
|
syn keyword glslType sampler2DMS
|
||||||
|
syn keyword glslType sampler2DMSArray
|
||||||
|
syn keyword glslType sampler2DRect
|
||||||
|
syn keyword glslType sampler2DRectShadow
|
||||||
|
syn keyword glslType sampler2DShadow
|
||||||
|
syn keyword glslType sampler3D
|
||||||
|
syn keyword glslType samplerBuffer
|
||||||
|
syn keyword glslType samplerCube
|
||||||
|
syn keyword glslType samplerCubeArray
|
||||||
|
syn keyword glslType samplerCubeArrayShadow
|
||||||
|
syn keyword glslType samplerCubeShadow
|
||||||
|
syn keyword glslType uimage1D
|
||||||
|
syn keyword glslType uimage1DArray
|
||||||
|
syn keyword glslType uimage2D
|
||||||
|
syn keyword glslType uimage2DArray
|
||||||
|
syn keyword glslType uimage2DMS
|
||||||
|
syn keyword glslType uimage2DMSArray
|
||||||
|
syn keyword glslType uimage2DRect
|
||||||
|
syn keyword glslType uimage3D
|
||||||
|
syn keyword glslType uimageBuffer
|
||||||
|
syn keyword glslType uimageCube
|
||||||
|
syn keyword glslType uimageCubeArray
|
||||||
|
syn keyword glslType uint
|
||||||
|
syn keyword glslType usampler1D
|
||||||
|
syn keyword glslType usampler1DArray
|
||||||
|
syn keyword glslType usampler2D
|
||||||
|
syn keyword glslType usampler2DArray
|
||||||
|
syn keyword glslType usampler2DMS
|
||||||
|
syn keyword glslType usampler2DMSArray
|
||||||
|
syn keyword glslType usampler2DRect
|
||||||
|
syn keyword glslType usampler3D
|
||||||
|
syn keyword glslType usamplerBuffer
|
||||||
|
syn keyword glslType usamplerCube
|
||||||
|
syn keyword glslType usamplerCubeArray
|
||||||
|
syn keyword glslType uvec2
|
||||||
|
syn keyword glslType uvec3
|
||||||
|
syn keyword glslType uvec4
|
||||||
|
syn keyword glslType vec2
|
||||||
|
syn keyword glslType vec3
|
||||||
|
syn keyword glslType vec4
|
||||||
|
syn keyword glslType void
|
||||||
|
|
||||||
|
" Qualifiers
|
||||||
|
syn keyword glslQualifier attribute
|
||||||
|
syn keyword glslQualifier binding
|
||||||
|
syn keyword glslQualifier buffer
|
||||||
|
syn keyword glslQualifier ccw
|
||||||
|
syn keyword glslQualifier centroid
|
||||||
|
syn keyword glslQualifier centroid varying
|
||||||
|
syn keyword glslQualifier coherent
|
||||||
|
syn keyword glslQualifier column_major
|
||||||
|
syn keyword glslQualifier const
|
||||||
|
syn keyword glslQualifier cw
|
||||||
|
syn keyword glslQualifier depth_any
|
||||||
|
syn keyword glslQualifier depth_greater
|
||||||
|
syn keyword glslQualifier depth_less
|
||||||
|
syn keyword glslQualifier depth_unchanged
|
||||||
|
syn keyword glslQualifier early_fragment_tests
|
||||||
|
syn keyword glslQualifier equal_spacing
|
||||||
|
syn keyword glslQualifier flat
|
||||||
|
syn keyword glslQualifier fractional_even_spacing
|
||||||
|
syn keyword glslQualifier fractional_odd_spacing
|
||||||
|
syn keyword glslQualifier highp
|
||||||
|
syn keyword glslQualifier in
|
||||||
|
syn keyword glslQualifier index
|
||||||
|
syn keyword glslQualifier inout
|
||||||
|
syn keyword glslQualifier invariant
|
||||||
|
syn keyword glslQualifier invocations
|
||||||
|
syn keyword glslQualifier isolines
|
||||||
|
syn keyword glslQualifier layout
|
||||||
|
syn keyword glslQualifier line_strip
|
||||||
|
syn keyword glslQualifier lines
|
||||||
|
syn keyword glslQualifier lines_adjacency
|
||||||
|
syn keyword glslQualifier local_size_x
|
||||||
|
syn keyword glslQualifier local_size_y
|
||||||
|
syn keyword glslQualifier local_size_z
|
||||||
|
syn keyword glslQualifier location
|
||||||
|
syn keyword glslQualifier lowp
|
||||||
|
syn keyword glslQualifier max_vertices
|
||||||
|
syn keyword glslQualifier mediump
|
||||||
|
syn keyword glslQualifier noperspective
|
||||||
|
syn keyword glslQualifier offset
|
||||||
|
syn keyword glslQualifier origin_upper_left
|
||||||
|
syn keyword glslQualifier out
|
||||||
|
syn keyword glslQualifier packed
|
||||||
|
syn keyword glslQualifier patch
|
||||||
|
syn keyword glslQualifier pixel_center_integer
|
||||||
|
syn keyword glslQualifier point_mode
|
||||||
|
syn keyword glslQualifier points
|
||||||
|
syn keyword glslQualifier precise
|
||||||
|
syn keyword glslQualifier precision
|
||||||
|
syn keyword glslQualifier quads
|
||||||
|
syn keyword glslQualifier r11f_g11f_b10f
|
||||||
|
syn keyword glslQualifier r16
|
||||||
|
syn keyword glslQualifier r16_snorm
|
||||||
|
syn keyword glslQualifier r16f
|
||||||
|
syn keyword glslQualifier r16i
|
||||||
|
syn keyword glslQualifier r16ui
|
||||||
|
syn keyword glslQualifier r32f
|
||||||
|
syn keyword glslQualifier r32i
|
||||||
|
syn keyword glslQualifier r32ui
|
||||||
|
syn keyword glslQualifier r8
|
||||||
|
syn keyword glslQualifier r8_snorm
|
||||||
|
syn keyword glslQualifier r8i
|
||||||
|
syn keyword glslQualifier r8ui
|
||||||
|
syn keyword glslQualifier readonly
|
||||||
|
syn keyword glslQualifier restrict
|
||||||
|
syn keyword glslQualifier rg16
|
||||||
|
syn keyword glslQualifier rg16_snorm
|
||||||
|
syn keyword glslQualifier rg16f
|
||||||
|
syn keyword glslQualifier rg16i
|
||||||
|
syn keyword glslQualifier rg16ui
|
||||||
|
syn keyword glslQualifier rg32f
|
||||||
|
syn keyword glslQualifier rg32i
|
||||||
|
syn keyword glslQualifier rg32ui
|
||||||
|
syn keyword glslQualifier rg8
|
||||||
|
syn keyword glslQualifier rg8_snorm
|
||||||
|
syn keyword glslQualifier rg8i
|
||||||
|
syn keyword glslQualifier rg8ui
|
||||||
|
syn keyword glslQualifier rgb10_a2
|
||||||
|
syn keyword glslQualifier rgb10_a2ui
|
||||||
|
syn keyword glslQualifier rgba16
|
||||||
|
syn keyword glslQualifier rgba16_snorm
|
||||||
|
syn keyword glslQualifier rgba16f
|
||||||
|
syn keyword glslQualifier rgba16i
|
||||||
|
syn keyword glslQualifier rgba16ui
|
||||||
|
syn keyword glslQualifier rgba32f
|
||||||
|
syn keyword glslQualifier rgba32i
|
||||||
|
syn keyword glslQualifier rgba32ui
|
||||||
|
syn keyword glslQualifier rgba8
|
||||||
|
syn keyword glslQualifier rgba8_snorm
|
||||||
|
syn keyword glslQualifier rgba8i
|
||||||
|
syn keyword glslQualifier rgba8ui
|
||||||
|
syn keyword glslQualifier row_major
|
||||||
|
syn keyword glslQualifier sample
|
||||||
|
syn keyword glslQualifier shared
|
||||||
|
syn keyword glslQualifier smooth
|
||||||
|
syn keyword glslQualifier std140
|
||||||
|
syn keyword glslQualifier std430
|
||||||
|
syn keyword glslQualifier stream
|
||||||
|
syn keyword glslQualifier triangle_strip
|
||||||
|
syn keyword glslQualifier triangles
|
||||||
|
syn keyword glslQualifier triangles_adjacency
|
||||||
|
syn keyword glslQualifier uniform
|
||||||
|
syn keyword glslQualifier varying
|
||||||
|
syn keyword glslQualifier vertices
|
||||||
|
syn keyword glslQualifier volatile
|
||||||
|
syn keyword glslQualifier writeonly
|
||||||
|
|
||||||
|
" Built-in Constants
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxAtomicCounterBindings
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxAtomicCounterBufferSize
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxClipDistances
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxClipPlanes
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxCombinedAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxCombinedAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxCombinedImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxCombinedImageUnitsAndFragmentOutputs
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxCombinedTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeWorkGroupCount
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxComputeWorkGroupSize
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxDrawBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentInputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentInputVectors
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxFragmentUniformVectors
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryInputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryOutputVertices
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryTotalOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxGeometryVaryingComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxImageSamples
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxLights
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxPatchVertices
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxProgramTexelOffset
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlInputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlTotalOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessControlUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationInputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessEvaluationUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessGenLevel
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTessPatchComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTextureCoords
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxTextureUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVaryingComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVaryingFloats
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVaryingVectors
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexAtomicCounterBuffers
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexAtomicCounters
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexAttribs
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexImageUniforms
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexOutputComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexOutputVectors
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexTextureImageUnits
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexUniformComponents
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxVertexUniformVectors
|
||||||
|
syn keyword glslBuiltinConstant gl_MaxViewports
|
||||||
|
syn keyword glslBuiltinConstant gl_MinProgramTexelOffset
|
||||||
|
|
||||||
|
" Built-in Variables
|
||||||
|
syn keyword glslBuiltinVariable gl_BackColor
|
||||||
|
syn keyword glslBuiltinVariable gl_BackLightModelProduct
|
||||||
|
syn keyword glslBuiltinVariable gl_BackLightProduct
|
||||||
|
syn keyword glslBuiltinVariable gl_BackLightProduct
|
||||||
|
syn keyword glslBuiltinVariable gl_BackMaterial
|
||||||
|
syn keyword glslBuiltinVariable gl_BackSecondaryColor
|
||||||
|
syn keyword glslBuiltinVariable gl_ClipDistance
|
||||||
|
syn keyword glslBuiltinVariable gl_ClipPlane
|
||||||
|
syn keyword glslBuiltinVariable gl_ClipVertex
|
||||||
|
syn keyword glslBuiltinVariable gl_Color
|
||||||
|
syn keyword glslBuiltinVariable gl_DepthRange
|
||||||
|
syn keyword glslBuiltinVariable gl_EyePlaneQ
|
||||||
|
syn keyword glslBuiltinVariable gl_EyePlaneR
|
||||||
|
syn keyword glslBuiltinVariable gl_EyePlaneS
|
||||||
|
syn keyword glslBuiltinVariable gl_EyePlaneT
|
||||||
|
syn keyword glslBuiltinVariable gl_Fog
|
||||||
|
syn keyword glslBuiltinVariable gl_FogCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_FogFragCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_FragColor
|
||||||
|
syn keyword glslBuiltinVariable gl_FragCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_FragData
|
||||||
|
syn keyword glslBuiltinVariable gl_FragDepth
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontColor
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontFacing
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontLightModelProduct
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontLightProduct
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontMaterial
|
||||||
|
syn keyword glslBuiltinVariable gl_FrontSecondaryColor
|
||||||
|
syn keyword glslBuiltinVariable gl_GlobalInvocationID
|
||||||
|
syn keyword glslBuiltinVariable gl_InstanceID
|
||||||
|
syn keyword glslBuiltinVariable gl_InvocationID
|
||||||
|
syn keyword glslBuiltinVariable gl_Layer
|
||||||
|
syn keyword glslBuiltinVariable gl_LightModel
|
||||||
|
syn keyword glslBuiltinVariable gl_LightSource
|
||||||
|
syn keyword glslBuiltinVariable gl_LocalInvocationID
|
||||||
|
syn keyword glslBuiltinVariable gl_LocalInvocationIndex
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewMatrix
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewMatrixInverse
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewMatrixInverseTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewMatrixTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrix
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixInverse
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixInverseTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord0
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord1
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord2
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord3
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord4
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord5
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord6
|
||||||
|
syn keyword glslBuiltinVariable gl_MultiTexCoord7
|
||||||
|
syn keyword glslBuiltinVariable gl_Normal
|
||||||
|
syn keyword glslBuiltinVariable gl_NormalMatrix
|
||||||
|
syn keyword glslBuiltinVariable gl_NormalScale
|
||||||
|
syn keyword glslBuiltinVariable gl_NumSamples
|
||||||
|
syn keyword glslBuiltinVariable gl_NumWorkGroups
|
||||||
|
syn keyword glslBuiltinVariable gl_ObjectPlaneQ
|
||||||
|
syn keyword glslBuiltinVariable gl_ObjectPlaneR
|
||||||
|
syn keyword glslBuiltinVariable gl_ObjectPlaneS
|
||||||
|
syn keyword glslBuiltinVariable gl_ObjectPlaneT
|
||||||
|
syn keyword glslBuiltinVariable gl_PatchVerticesIn
|
||||||
|
syn keyword glslBuiltinVariable gl_Point
|
||||||
|
syn keyword glslBuiltinVariable gl_PointCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_PointSize
|
||||||
|
syn keyword glslBuiltinVariable gl_Position
|
||||||
|
syn keyword glslBuiltinVariable gl_PrimitiveID
|
||||||
|
syn keyword glslBuiltinVariable gl_PrimitiveIDIn
|
||||||
|
syn keyword glslBuiltinVariable gl_ProjectionMatrix
|
||||||
|
syn keyword glslBuiltinVariable gl_ProjectionMatrixInverse
|
||||||
|
syn keyword glslBuiltinVariable gl_ProjectionMatrixInverseTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_ProjectionMatrixTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_SampleID
|
||||||
|
syn keyword glslBuiltinVariable gl_SampleMask
|
||||||
|
syn keyword glslBuiltinVariable gl_SampleMaskIn
|
||||||
|
syn keyword glslBuiltinVariable gl_SamplePosition
|
||||||
|
syn keyword glslBuiltinVariable gl_SecondaryColor
|
||||||
|
syn keyword glslBuiltinVariable gl_TessCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_TessLevelInner
|
||||||
|
syn keyword glslBuiltinVariable gl_TessLevelOuter
|
||||||
|
syn keyword glslBuiltinVariable gl_TexCoord
|
||||||
|
syn keyword glslBuiltinVariable gl_TextureEnvColor
|
||||||
|
syn keyword glslBuiltinVariable gl_TextureMatrix
|
||||||
|
syn keyword glslBuiltinVariable gl_TextureMatrixInverse
|
||||||
|
syn keyword glslBuiltinVariable gl_TextureMatrixInverseTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_TextureMatrixTranspose
|
||||||
|
syn keyword glslBuiltinVariable gl_Vertex
|
||||||
|
syn keyword glslBuiltinVariable gl_VertexID
|
||||||
|
syn keyword glslBuiltinVariable gl_ViewportIndex
|
||||||
|
syn keyword glslBuiltinVariable gl_WorkGroupID
|
||||||
|
syn keyword glslBuiltinVariable gl_WorkGroupSize
|
||||||
|
syn keyword glslBuiltinVariable gl_in
|
||||||
|
syn keyword glslBuiltinVariable gl_out
|
||||||
|
|
||||||
|
" Built-in Functions
|
||||||
|
syn keyword glslBuiltinFunction EmitStreamVertex
|
||||||
|
syn keyword glslBuiltinFunction EmitVertex
|
||||||
|
syn keyword glslBuiltinFunction EndPrimitive
|
||||||
|
syn keyword glslBuiltinFunction EndStreamPrimitive
|
||||||
|
syn keyword glslBuiltinFunction abs
|
||||||
|
syn keyword glslBuiltinFunction acos
|
||||||
|
syn keyword glslBuiltinFunction acosh
|
||||||
|
syn keyword glslBuiltinFunction all
|
||||||
|
syn keyword glslBuiltinFunction any
|
||||||
|
syn keyword glslBuiltinFunction asin
|
||||||
|
syn keyword glslBuiltinFunction asinh
|
||||||
|
syn keyword glslBuiltinFunction atan
|
||||||
|
syn keyword glslBuiltinFunction atanh
|
||||||
|
syn keyword glslBuiltinFunction atomicAdd
|
||||||
|
syn keyword glslBuiltinFunction atomicAnd
|
||||||
|
syn keyword glslBuiltinFunction atomicCompSwap
|
||||||
|
syn keyword glslBuiltinFunction atomicCounter
|
||||||
|
syn keyword glslBuiltinFunction atomicCounterDecrement
|
||||||
|
syn keyword glslBuiltinFunction atomicCounterIncrement
|
||||||
|
syn keyword glslBuiltinFunction atomicExchange
|
||||||
|
syn keyword glslBuiltinFunction atomicMax
|
||||||
|
syn keyword glslBuiltinFunction atomicMin
|
||||||
|
syn keyword glslBuiltinFunction atomicOr
|
||||||
|
syn keyword glslBuiltinFunction atomicXor
|
||||||
|
syn keyword glslBuiltinFunction barrier
|
||||||
|
syn keyword glslBuiltinFunction bitCount
|
||||||
|
syn keyword glslBuiltinFunction bitfieldExtract
|
||||||
|
syn keyword glslBuiltinFunction bitfieldInsert
|
||||||
|
syn keyword glslBuiltinFunction bitfieldReverse
|
||||||
|
syn keyword glslBuiltinFunction ceil
|
||||||
|
syn keyword glslBuiltinFunction clamp
|
||||||
|
syn keyword glslBuiltinFunction cos
|
||||||
|
syn keyword glslBuiltinFunction cosh
|
||||||
|
syn keyword glslBuiltinFunction cross
|
||||||
|
syn keyword glslBuiltinFunction dFdx
|
||||||
|
syn keyword glslBuiltinFunction dFdy
|
||||||
|
syn keyword glslBuiltinFunction degrees
|
||||||
|
syn keyword glslBuiltinFunction determinant
|
||||||
|
syn keyword glslBuiltinFunction distance
|
||||||
|
syn keyword glslBuiltinFunction dot
|
||||||
|
syn keyword glslBuiltinFunction equal
|
||||||
|
syn keyword glslBuiltinFunction exp
|
||||||
|
syn keyword glslBuiltinFunction exp2
|
||||||
|
syn keyword glslBuiltinFunction faceforward
|
||||||
|
syn keyword glslBuiltinFunction findLSB
|
||||||
|
syn keyword glslBuiltinFunction findMSB
|
||||||
|
syn keyword glslBuiltinFunction floatBitsToInt
|
||||||
|
syn keyword glslBuiltinFunction floatBitsToUint
|
||||||
|
syn keyword glslBuiltinFunction floor
|
||||||
|
syn keyword glslBuiltinFunction fma
|
||||||
|
syn keyword glslBuiltinFunction fract
|
||||||
|
syn keyword glslBuiltinFunction frexp
|
||||||
|
syn keyword glslBuiltinFunction ftransform
|
||||||
|
syn keyword glslBuiltinFunction fwidth
|
||||||
|
syn keyword glslBuiltinFunction greaterThan
|
||||||
|
syn keyword glslBuiltinFunction greaterThanEqual
|
||||||
|
syn keyword glslBuiltinFunction groupMemoryBarrier
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicAdd
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicAnd
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicCompSwap
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicExchange
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicMax
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicMin
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicOr
|
||||||
|
syn keyword glslBuiltinFunction imageAtomicXor
|
||||||
|
syn keyword glslBuiltinFunction imageLoad
|
||||||
|
syn keyword glslBuiltinFunction imageSize
|
||||||
|
syn keyword glslBuiltinFunction imageStore
|
||||||
|
syn keyword glslBuiltinFunction imulExtended
|
||||||
|
syn keyword glslBuiltinFunction intBitsToFloat
|
||||||
|
syn keyword glslBuiltinFunction interpolateAtCentroid
|
||||||
|
syn keyword glslBuiltinFunction interpolateAtOffset
|
||||||
|
syn keyword glslBuiltinFunction interpolateAtSample
|
||||||
|
syn keyword glslBuiltinFunction inverse
|
||||||
|
syn keyword glslBuiltinFunction inversesqrt
|
||||||
|
syn keyword glslBuiltinFunction isinf
|
||||||
|
syn keyword glslBuiltinFunction isnan
|
||||||
|
syn keyword glslBuiltinFunction ldexp
|
||||||
|
syn keyword glslBuiltinFunction length
|
||||||
|
syn keyword glslBuiltinFunction lessThan
|
||||||
|
syn keyword glslBuiltinFunction lessThanEqual
|
||||||
|
syn keyword glslBuiltinFunction log
|
||||||
|
syn keyword glslBuiltinFunction log2
|
||||||
|
syn keyword glslBuiltinFunction matrixCompMult
|
||||||
|
syn keyword glslBuiltinFunction max
|
||||||
|
syn keyword glslBuiltinFunction memoryBarrier
|
||||||
|
syn keyword glslBuiltinFunction memoryBarrierAtomicCounter
|
||||||
|
syn keyword glslBuiltinFunction memoryBarrierBuffer
|
||||||
|
syn keyword glslBuiltinFunction memoryBarrierImage
|
||||||
|
syn keyword glslBuiltinFunction memoryBarrierShared
|
||||||
|
syn keyword glslBuiltinFunction min
|
||||||
|
syn keyword glslBuiltinFunction mix
|
||||||
|
syn keyword glslBuiltinFunction mod
|
||||||
|
syn keyword glslBuiltinFunction modf
|
||||||
|
syn keyword glslBuiltinFunction noise1
|
||||||
|
syn keyword glslBuiltinFunction noise2
|
||||||
|
syn keyword glslBuiltinFunction noise3
|
||||||
|
syn keyword glslBuiltinFunction noise4
|
||||||
|
syn keyword glslBuiltinFunction normalize
|
||||||
|
syn keyword glslBuiltinFunction not
|
||||||
|
syn keyword glslBuiltinFunction notEqual
|
||||||
|
syn keyword glslBuiltinFunction outerProduct
|
||||||
|
syn keyword glslBuiltinFunction packDouble2x32
|
||||||
|
syn keyword glslBuiltinFunction packHalf2x16
|
||||||
|
syn keyword glslBuiltinFunction packSnorm2x16
|
||||||
|
syn keyword glslBuiltinFunction packSnorm4x8
|
||||||
|
syn keyword glslBuiltinFunction packUnorm2x16
|
||||||
|
syn keyword glslBuiltinFunction packUnorm4x8
|
||||||
|
syn keyword glslBuiltinFunction pow
|
||||||
|
syn keyword glslBuiltinFunction radians
|
||||||
|
syn keyword glslBuiltinFunction reflect
|
||||||
|
syn keyword glslBuiltinFunction refract
|
||||||
|
syn keyword glslBuiltinFunction round
|
||||||
|
syn keyword glslBuiltinFunction roundEven
|
||||||
|
syn keyword glslBuiltinFunction shadow1D
|
||||||
|
syn keyword glslBuiltinFunction shadow1DLod
|
||||||
|
syn keyword glslBuiltinFunction shadow1DProj
|
||||||
|
syn keyword glslBuiltinFunction shadow1DProjLod
|
||||||
|
syn keyword glslBuiltinFunction shadow2D
|
||||||
|
syn keyword glslBuiltinFunction shadow2DLod
|
||||||
|
syn keyword glslBuiltinFunction shadow2DProj
|
||||||
|
syn keyword glslBuiltinFunction shadow2DProjLod
|
||||||
|
syn keyword glslBuiltinFunction sign
|
||||||
|
syn keyword glslBuiltinFunction sin
|
||||||
|
syn keyword glslBuiltinFunction sinh
|
||||||
|
syn keyword glslBuiltinFunction smoothstep
|
||||||
|
syn keyword glslBuiltinFunction sqrt
|
||||||
|
syn keyword glslBuiltinFunction step
|
||||||
|
syn keyword glslBuiltinFunction tan
|
||||||
|
syn keyword glslBuiltinFunction tanh
|
||||||
|
syn keyword glslBuiltinFunction texelFetch
|
||||||
|
syn keyword glslBuiltinFunction texelFetchOffset
|
||||||
|
syn keyword glslBuiltinFunction texture
|
||||||
|
syn keyword glslBuiltinFunction texture1D
|
||||||
|
syn keyword glslBuiltinFunction texture1DLod
|
||||||
|
syn keyword glslBuiltinFunction texture1DProj
|
||||||
|
syn keyword glslBuiltinFunction texture1DProjLod
|
||||||
|
syn keyword glslBuiltinFunction texture2D
|
||||||
|
syn keyword glslBuiltinFunction texture2DLod
|
||||||
|
syn keyword glslBuiltinFunction texture2DProj
|
||||||
|
syn keyword glslBuiltinFunction texture2DProjLod
|
||||||
|
syn keyword glslBuiltinFunction texture3D
|
||||||
|
syn keyword glslBuiltinFunction texture3DLod
|
||||||
|
syn keyword glslBuiltinFunction texture3DProj
|
||||||
|
syn keyword glslBuiltinFunction texture3DProjLod
|
||||||
|
syn keyword glslBuiltinFunction textureCube
|
||||||
|
syn keyword glslBuiltinFunction textureCubeLod
|
||||||
|
syn keyword glslBuiltinFunction textureGather
|
||||||
|
syn keyword glslBuiltinFunction textureGatherOffset
|
||||||
|
syn keyword glslBuiltinFunction textureGatherOffsets
|
||||||
|
syn keyword glslBuiltinFunction textureGrad
|
||||||
|
syn keyword glslBuiltinFunction textureGradOffset
|
||||||
|
syn keyword glslBuiltinFunction textureLod
|
||||||
|
syn keyword glslBuiltinFunction textureLodOffset
|
||||||
|
syn keyword glslBuiltinFunction textureOffset
|
||||||
|
syn keyword glslBuiltinFunction textureProj
|
||||||
|
syn keyword glslBuiltinFunction textureProjGrad
|
||||||
|
syn keyword glslBuiltinFunction textureProjGradOffset
|
||||||
|
syn keyword glslBuiltinFunction textureProjLod
|
||||||
|
syn keyword glslBuiltinFunction textureProjLodOffset
|
||||||
|
syn keyword glslBuiltinFunction textureProjOffset
|
||||||
|
syn keyword glslBuiltinFunction textureQueryLevels
|
||||||
|
syn keyword glslBuiltinFunction textureQueryLod
|
||||||
|
syn keyword glslBuiltinFunction textureSize
|
||||||
|
syn keyword glslBuiltinFunction transpose
|
||||||
|
syn keyword glslBuiltinFunction trunc
|
||||||
|
syn keyword glslBuiltinFunction uaddCarry
|
||||||
|
syn keyword glslBuiltinFunction uintBitsToFloat
|
||||||
|
syn keyword glslBuiltinFunction umulExtended
|
||||||
|
syn keyword glslBuiltinFunction unpackDouble2x32
|
||||||
|
syn keyword glslBuiltinFunction unpackHalf2x16
|
||||||
|
syn keyword glslBuiltinFunction unpackSnorm2x16
|
||||||
|
syn keyword glslBuiltinFunction unpackSnorm4x8
|
||||||
|
syn keyword glslBuiltinFunction unpackUnorm2x16
|
||||||
|
syn keyword glslBuiltinFunction unpackUnorm4x8
|
||||||
|
syn keyword glslBuiltinFunction usubBorrow
|
||||||
|
|
||||||
|
hi def link glslConditional Conditional
|
||||||
|
hi def link glslRepeat Repeat
|
||||||
|
hi def link glslStatement Statement
|
||||||
|
hi def link glslTodo Todo
|
||||||
|
hi def link glslCommentL glslComment
|
||||||
|
hi def link glslCommentStart glslComment
|
||||||
|
hi def link glslComment Comment
|
||||||
|
hi def link glslPreCondit PreCondit
|
||||||
|
hi def link glslDefine Define
|
||||||
|
hi def link glslTokenConcat glslPreProc
|
||||||
|
hi def link glslPredefinedMacro Macro
|
||||||
|
hi def link glslPreProc PreProc
|
||||||
|
hi def link glslBoolean Boolean
|
||||||
|
hi def link glslDecimalInt glslInteger
|
||||||
|
hi def link glslOctalInt glslInteger
|
||||||
|
hi def link glslHexInt glslInteger
|
||||||
|
hi def link glslInteger Number
|
||||||
|
hi def link glslFloat Float
|
||||||
|
hi def link glslStructure Structure
|
||||||
|
hi def link glslType Type
|
||||||
|
hi def link glslQualifier StorageClass
|
||||||
|
hi def link glslBuiltinConstant Constant
|
||||||
|
hi def link glslBuiltinFunction Function
|
||||||
|
hi def link glslBuiltinVariable Identifier
|
||||||
|
hi def link glslSwizzle SpecialChar
|
||||||
|
|
||||||
|
if !exists("b:current_syntax")
|
||||||
|
let b:current_syntax = "glsl"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" vim:set sts=2 sw=2 :
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -27,6 +27,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
|||||||
" Highlights instances of tabs following spaces.
|
" Highlights instances of tabs following spaces.
|
||||||
" - go_highlight_trailing_whitespace_error
|
" - go_highlight_trailing_whitespace_error
|
||||||
" Highlights trailing white space.
|
" Highlights trailing white space.
|
||||||
|
" - go_highlight_string_spellcheck
|
||||||
|
" Specifies that strings should be spell checked
|
||||||
|
|
||||||
" Quit when a (custom) syntax file was already loaded
|
" Quit when a (custom) syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
@@ -73,6 +75,10 @@ if !exists("g:go_highlight_build_constraints")
|
|||||||
let g:go_highlight_build_constraints = 0
|
let g:go_highlight_build_constraints = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("g:go_highlight_string_spellcheck")
|
||||||
|
let g:go_highlight_string_spellcheck = 1
|
||||||
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword goDirective package import
|
syn keyword goDirective package import
|
||||||
@@ -147,8 +153,13 @@ hi def link goEscapeError Error
|
|||||||
|
|
||||||
" Strings and their contents
|
" Strings and their contents
|
||||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||||
|
if g:go_highlight_string_spellcheck != 0
|
||||||
|
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
|
||||||
|
syn region goRawString start=+`+ end=+`+ contains=@Spell
|
||||||
|
else
|
||||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||||
syn region goRawString start=+`+ end=+`+
|
syn region goRawString start=+`+ end=+`+
|
||||||
|
endif
|
||||||
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||||
|
|
||||||
hi def link goString String
|
hi def link goString String
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goIn
|
|||||||
syn keyword gotplControl contained if else end range with template
|
syn keyword gotplControl contained if else end range with template
|
||||||
syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge
|
syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge
|
||||||
syn match gotplVariable contained /\$[^ ]*\>/
|
syn match gotplVariable contained /\$[^ ]*\>/
|
||||||
syn match goTplIdentifier contained /\.[^ ]*\>/
|
syn match goTplIdentifier contained /\.[^\s}]*\>/
|
||||||
|
|
||||||
hi def link gotplControl Keyword
|
hi def link gotplControl Keyword
|
||||||
hi def link gotplFunctions Function
|
hi def link gotplFunctions Function
|
||||||
|
|||||||
454
syntax/groovy.vim
Normal file
454
syntax/groovy.vim
Normal file
@@ -0,0 +1,454 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Groovy
|
||||||
|
" Maintainer: Alessio Pace <billy.corgan@tiscali.it>
|
||||||
|
" Version: 0.1.9b
|
||||||
|
" URL: http://www.vim.org/scripts/script.php?script_id=945
|
||||||
|
" Last Change: 6/4/2004
|
||||||
|
|
||||||
|
" This is my very first vim script, I hope to have
|
||||||
|
" done it the right way.
|
||||||
|
"
|
||||||
|
" I must directly or indirectly thank the author of java.vim and ruby.vim:
|
||||||
|
" I copied from them most of the stuff :-)
|
||||||
|
"
|
||||||
|
" Relies on html.vim
|
||||||
|
|
||||||
|
" For version 5.x: Clear all syntax items
|
||||||
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
|
"
|
||||||
|
" HOWTO USE IT (INSTALL):
|
||||||
|
" [groovy is still not recognized by vim! :-( ]
|
||||||
|
"
|
||||||
|
" 1) copy the file in the (global or user's $HOME/.vim/syntax/) syntax folder
|
||||||
|
"
|
||||||
|
" 2) add this line to recognize groovy files by filename extension:
|
||||||
|
"
|
||||||
|
" au BufNewFile,BufRead *.groovy setf groovy
|
||||||
|
" in the global vim filetype.vim file or inside $HOME/.vim/filetype.vim
|
||||||
|
"
|
||||||
|
" 3) add this part to recognize by content groovy script (no extension needed :-)
|
||||||
|
"
|
||||||
|
" if did_filetype()
|
||||||
|
" finish
|
||||||
|
" endif
|
||||||
|
" if getline(1) =~ '^#!.*[/\\]groovy\>'
|
||||||
|
" setf groovy
|
||||||
|
" endif
|
||||||
|
"
|
||||||
|
" in the global scripts.vim file or in $HOME/.vim/scripts.vim
|
||||||
|
"
|
||||||
|
" 4) open/write a .groovy file or a groovy script :-)
|
||||||
|
"
|
||||||
|
" Let me know if you like it or send me patches, so that I can improve it
|
||||||
|
" when I have time
|
||||||
|
|
||||||
|
" Quit when a syntax file was already loaded
|
||||||
|
if !exists("main_syntax")
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
" we define it here so that included files can test for it
|
||||||
|
let main_syntax='groovy'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" don't use standard HiLink, it will not work with included syntax files
|
||||||
|
if version < 508
|
||||||
|
command! -nargs=+ GroovyHiLink hi link <args>
|
||||||
|
else
|
||||||
|
command! -nargs=+ GroovyHiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ##########################
|
||||||
|
" Java stuff taken from java.vim
|
||||||
|
" some characters that cannot be in a groovy program (outside a string)
|
||||||
|
" syn match groovyError "[\\@`]"
|
||||||
|
"syn match groovyError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
|
||||||
|
"syn match groovyOK "\.\.\."
|
||||||
|
|
||||||
|
" keyword definitions
|
||||||
|
syn keyword groovyExternal native package
|
||||||
|
syn match groovyExternal "\<import\(\s\+static\>\)\?"
|
||||||
|
syn keyword groovyError goto const
|
||||||
|
syn keyword groovyConditional if else switch
|
||||||
|
syn keyword groovyRepeat while for do
|
||||||
|
syn keyword groovyBoolean true false
|
||||||
|
syn keyword groovyConstant null
|
||||||
|
syn keyword groovyTypedef this super
|
||||||
|
syn keyword groovyOperator new instanceof
|
||||||
|
syn keyword groovyType boolean char byte short int long float double
|
||||||
|
syn keyword groovyType void
|
||||||
|
syn keyword groovyType Integer Double Date Boolean Float String Array Vector List
|
||||||
|
syn keyword groovyStatement return
|
||||||
|
syn keyword groovyStorageClass static synchronized transient volatile final strictfp serializable
|
||||||
|
syn keyword groovyExceptions throw try catch finally
|
||||||
|
syn keyword groovyAssert assert
|
||||||
|
syn keyword groovyMethodDecl synchronized throws
|
||||||
|
syn keyword groovyClassDecl extends implements interface
|
||||||
|
" to differentiate the keyword class from MyClass.class we use a match here
|
||||||
|
syn match groovyTypedef "\.\s*\<class\>"ms=s+1
|
||||||
|
syn keyword groovyClassDecl enum
|
||||||
|
syn match groovyClassDecl "^class\>"
|
||||||
|
syn match groovyClassDecl "[^.]\s*\<class\>"ms=s+1
|
||||||
|
syn keyword groovyBranch break continue nextgroup=groovyUserLabelRef skipwhite
|
||||||
|
syn match groovyUserLabelRef "\k\+" contained
|
||||||
|
syn keyword groovyScopeDecl public protected private abstract
|
||||||
|
|
||||||
|
|
||||||
|
if exists("groovy_highlight_groovy_lang_ids") || exists("groovy_highlight_groovy_lang") || exists("groovy_highlight_all")
|
||||||
|
" groovy.lang.*
|
||||||
|
syn keyword groovyLangClass Closure MetaMethod GroovyObject
|
||||||
|
|
||||||
|
syn match groovyJavaLangClass "\<System\>"
|
||||||
|
syn keyword groovyJavaLangClass Cloneable Comparable Runnable Serializable Boolean Byte Class Object
|
||||||
|
syn keyword groovyJavaLangClass Character CharSequence ClassLoader Compiler
|
||||||
|
" syn keyword groovyJavaLangClass Integer Double Float Long
|
||||||
|
syn keyword groovyJavaLangClass InheritableThreadLocal Math Number Object Package Process
|
||||||
|
syn keyword groovyJavaLangClass Runtime RuntimePermission InheritableThreadLocal
|
||||||
|
syn keyword groovyJavaLangClass SecurityManager Short StrictMath StackTraceElement
|
||||||
|
syn keyword groovyJavaLangClass StringBuffer Thread ThreadGroup
|
||||||
|
syn keyword groovyJavaLangClass ThreadLocal Throwable Void ArithmeticException
|
||||||
|
syn keyword groovyJavaLangClass ArrayIndexOutOfBoundsException AssertionError
|
||||||
|
syn keyword groovyJavaLangClass ArrayStoreException ClassCastException
|
||||||
|
syn keyword groovyJavaLangClass ClassNotFoundException
|
||||||
|
syn keyword groovyJavaLangClass CloneNotSupportedException Exception
|
||||||
|
syn keyword groovyJavaLangClass IllegalAccessException
|
||||||
|
syn keyword groovyJavaLangClass IllegalArgumentException
|
||||||
|
syn keyword groovyJavaLangClass IllegalMonitorStateException
|
||||||
|
syn keyword groovyJavaLangClass IllegalStateException
|
||||||
|
syn keyword groovyJavaLangClass IllegalThreadStateException
|
||||||
|
syn keyword groovyJavaLangClass IndexOutOfBoundsException
|
||||||
|
syn keyword groovyJavaLangClass InstantiationException InterruptedException
|
||||||
|
syn keyword groovyJavaLangClass NegativeArraySizeException NoSuchFieldException
|
||||||
|
syn keyword groovyJavaLangClass NoSuchMethodException NullPointerException
|
||||||
|
syn keyword groovyJavaLangClass NumberFormatException RuntimeException
|
||||||
|
syn keyword groovyJavaLangClass SecurityException StringIndexOutOfBoundsException
|
||||||
|
syn keyword groovyJavaLangClass UnsupportedOperationException
|
||||||
|
syn keyword groovyJavaLangClass AbstractMethodError ClassCircularityError
|
||||||
|
syn keyword groovyJavaLangClass ClassFormatError Error ExceptionInInitializerError
|
||||||
|
syn keyword groovyJavaLangClass IllegalAccessError InstantiationError
|
||||||
|
syn keyword groovyJavaLangClass IncompatibleClassChangeError InternalError
|
||||||
|
syn keyword groovyJavaLangClass LinkageError NoClassDefFoundError
|
||||||
|
syn keyword groovyJavaLangClass NoSuchFieldError NoSuchMethodError
|
||||||
|
syn keyword groovyJavaLangClass OutOfMemoryError StackOverflowError
|
||||||
|
syn keyword groovyJavaLangClass ThreadDeath UnknownError UnsatisfiedLinkError
|
||||||
|
syn keyword groovyJavaLangClass UnsupportedClassVersionError VerifyError
|
||||||
|
syn keyword groovyJavaLangClass VirtualMachineError
|
||||||
|
|
||||||
|
syn keyword groovyJavaLangObject clone equals finalize getClass hashCode
|
||||||
|
syn keyword groovyJavaLangObject notify notifyAll toString wait
|
||||||
|
|
||||||
|
GroovyHiLink groovyLangClass groovyConstant
|
||||||
|
GroovyHiLink groovyJavaLangClass groovyExternal
|
||||||
|
GroovyHiLink groovyJavaLangObject groovyConstant
|
||||||
|
syn cluster groovyTop add=groovyJavaLangObject,groovyJavaLangClass,groovyLangClass
|
||||||
|
syn cluster groovyClasses add=groovyJavaLangClass,groovyLangClass
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Groovy stuff
|
||||||
|
syn match groovyOperator "\.\."
|
||||||
|
syn match groovyOperator "<\{2,3}"
|
||||||
|
syn match groovyOperator ">\{2,3}"
|
||||||
|
syn match groovyOperator "->"
|
||||||
|
syn match groovyExternal '^#!.*[/\\]groovy\>'
|
||||||
|
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
|
||||||
|
|
||||||
|
" Groovy JDK stuff
|
||||||
|
syn keyword groovyJDKBuiltin as def in
|
||||||
|
syn keyword groovyJDKOperOverl div minus plus abs round power multiply
|
||||||
|
syn keyword groovyJDKMethods each call inject sort print println
|
||||||
|
syn keyword groovyJDKMethods getAt putAt size push pop toList getText writeLine eachLine readLines
|
||||||
|
syn keyword groovyJDKMethods withReader withStream withWriter withPrintWriter write read leftShift
|
||||||
|
syn keyword groovyJDKMethods withWriterAppend readBytes splitEachLine
|
||||||
|
syn keyword groovyJDKMethods newInputStream newOutputStream newPrintWriter newReader newWriter
|
||||||
|
syn keyword groovyJDKMethods compareTo next previous isCase
|
||||||
|
syn keyword groovyJDKMethods times step toInteger upto any collect dump every find findAll grep
|
||||||
|
syn keyword groovyJDKMethods inspect invokeMethods join
|
||||||
|
syn keyword groovyJDKMethods getErr getIn getOut waitForOrKill
|
||||||
|
syn keyword groovyJDKMethods count tokenize asList flatten immutable intersect reverse reverseEach
|
||||||
|
syn keyword groovyJDKMethods subMap append asWritable eachByte eachLine eachFile
|
||||||
|
syn cluster groovyTop add=groovyJDKBuiltin,groovyJDKOperOverl,groovyJDKMethods
|
||||||
|
|
||||||
|
" no useful I think, so I comment it..
|
||||||
|
"if filereadable(expand("<sfile>:p:h")."/groovyid.vim")
|
||||||
|
" source <sfile>:p:h/groovyid.vim
|
||||||
|
"endif
|
||||||
|
|
||||||
|
if exists("groovy_space_errors")
|
||||||
|
if !exists("groovy_no_trail_space_error")
|
||||||
|
syn match groovySpaceError "\s\+$"
|
||||||
|
endif
|
||||||
|
if !exists("groovy_no_tab_space_error")
|
||||||
|
syn match groovySpaceError " \+\t"me=e-1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" it is a better case construct than java.vim to match groovy syntax
|
||||||
|
syn region groovyLabelRegion transparent matchgroup=groovyLabel start="\<case\>" matchgroup=NONE end=":\|$" contains=groovyNumber,groovyString,groovyLangClass,groovyJavaLangClass
|
||||||
|
syn match groovyUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=groovyLabel
|
||||||
|
syn keyword groovyLabel default
|
||||||
|
|
||||||
|
if !exists("groovy_allow_cpp_keywords")
|
||||||
|
syn keyword groovyError auto delete extern friend inline redeclared
|
||||||
|
syn keyword groovyError register signed sizeof struct template typedef union
|
||||||
|
syn keyword groovyError unsigned operator
|
||||||
|
endif
|
||||||
|
|
||||||
|
" The following cluster contains all groovy groups except the contained ones
|
||||||
|
syn cluster groovyTop add=groovyExternal,groovyError,groovyError,groovyBranch,groovyLabelRegion,groovyLabel,groovyConditional,groovyRepeat,groovyBoolean,groovyConstant,groovyTypedef,groovyOperator,groovyType,groovyType,groovyStatement,groovyStorageClass,groovyAssert,groovyExceptions,groovyMethodDecl,groovyClassDecl,groovyClassDecl,groovyClassDecl,groovyScopeDecl,groovyError,groovyError2,groovyUserLabel,groovyLangObject
|
||||||
|
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn keyword groovyTodo contained TODO FIXME XXX
|
||||||
|
if exists("groovy_comment_strings")
|
||||||
|
syn region groovyCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=groovySpecial,groovyCommentStar,groovySpecialChar,@Spell
|
||||||
|
syn region groovyComment2String contained start=+"+ end=+$\|"+ contains=groovySpecial,groovySpecialChar,@Spell
|
||||||
|
syn match groovyCommentCharacter contained "'\\[^']\{1,6\}'" contains=groovySpecialChar
|
||||||
|
syn match groovyCommentCharacter contained "'\\''" contains=groovySpecialChar
|
||||||
|
syn match groovyCommentCharacter contained "'[^\\]'"
|
||||||
|
syn cluster groovyCommentSpecial add=groovyCommentString,groovyCommentCharacter,groovyNumber
|
||||||
|
syn cluster groovyCommentSpecial2 add=groovyComment2String,groovyCommentCharacter,groovyNumber
|
||||||
|
endif
|
||||||
|
syn region groovyComment start="/\*" end="\*/" contains=@groovyCommentSpecial,groovyTodo,@Spell
|
||||||
|
syn match groovyCommentStar contained "^\s*\*[^/]"me=e-1
|
||||||
|
syn match groovyCommentStar contained "^\s*\*$"
|
||||||
|
syn match groovyLineComment "//.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
|
||||||
|
syn match groovyLineComment "#.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
|
||||||
|
GroovyHiLink groovyCommentString groovyString
|
||||||
|
GroovyHiLink groovyComment2String groovyString
|
||||||
|
GroovyHiLink groovyCommentCharacter groovyCharacter
|
||||||
|
|
||||||
|
syn cluster groovyTop add=groovyComment,groovyLineComment
|
||||||
|
|
||||||
|
if !exists("groovy_ignore_groovydoc") && main_syntax != 'jsp'
|
||||||
|
syntax case ignore
|
||||||
|
" syntax coloring for groovydoc comments (HTML)
|
||||||
|
" syntax include @groovyHtml <sfile>:p:h/html.vim
|
||||||
|
syntax include @groovyHtml runtime! syntax/html.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
syn region groovyDocComment start="/\*\*" end="\*/" keepend contains=groovyCommentTitle,@groovyHtml,groovyDocTags,groovyTodo,@Spell
|
||||||
|
syn region groovyCommentTitle contained matchgroup=groovyDocComment start="/\*\*" matchgroup=groovyCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@groovyHtml,groovyCommentStar,groovyTodo,@Spell,groovyDocTags
|
||||||
|
|
||||||
|
syn region groovyDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
|
||||||
|
syn match groovyDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=groovyDocParam
|
||||||
|
syn match groovyDocParam contained "\s\S\+"
|
||||||
|
syn match groovyDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
|
||||||
|
syntax case match
|
||||||
|
endif
|
||||||
|
|
||||||
|
" match the special comment /**/
|
||||||
|
syn match groovyComment "/\*\*/"
|
||||||
|
|
||||||
|
" Strings and constants
|
||||||
|
syn match groovySpecialError contained "\\."
|
||||||
|
syn match groovySpecialCharError contained "[^']"
|
||||||
|
syn match groovySpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
|
||||||
|
syn region groovyString start=+"+ end=+"+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
|
||||||
|
syn region groovyString start=+'+ end=+'+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
|
||||||
|
" syn region groovyELExpr start=+${+ end=+}+ keepend contained
|
||||||
|
syn match groovyELExpr /\${.\{-}}/ contained
|
||||||
|
GroovyHiLink groovyELExpr Identifier
|
||||||
|
|
||||||
|
" TODO: better matching. I am waiting to understand how it really works in groovy
|
||||||
|
" syn region groovyClosureParamsBraces start=+|+ end=+|+ contains=groovyClosureParams
|
||||||
|
" syn match groovyClosureParams "[ a-zA-Z0-9_*]\+" contained
|
||||||
|
" GroovyHiLink groovyClosureParams Identifier
|
||||||
|
|
||||||
|
" next line disabled, it can cause a crash for a long line
|
||||||
|
"syn match groovyStringError +"\([^"\\]\|\\.\)*$+
|
||||||
|
|
||||||
|
" disabled: in groovy strings or characters are written the same
|
||||||
|
" syn match groovyCharacter "'[^']*'" contains=groovySpecialChar,groovySpecialCharError
|
||||||
|
" syn match groovyCharacter "'\\''" contains=groovySpecialChar
|
||||||
|
" syn match groovyCharacter "'[^\\]'"
|
||||||
|
syn match groovyNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||||
|
syn match groovyNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||||
|
syn match groovyNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||||
|
syn match groovyNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||||
|
|
||||||
|
" unicode characters
|
||||||
|
syn match groovySpecial "\\u\d\{4\}"
|
||||||
|
|
||||||
|
syn cluster groovyTop add=groovyString,groovyCharacter,groovyNumber,groovySpecial,groovyStringError
|
||||||
|
|
||||||
|
if exists("groovy_highlight_functions")
|
||||||
|
if groovy_highlight_functions == "indent"
|
||||||
|
syn match groovyFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||||
|
syn region groovyFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||||
|
syn match groovyFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||||
|
syn region groovyFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||||
|
else
|
||||||
|
" This line catches method declarations at any indentation>0, but it assumes
|
||||||
|
" two things:
|
||||||
|
" 1. class names are always capitalized (ie: Button)
|
||||||
|
" 2. method names are never capitalized (except constructors, of course)
|
||||||
|
syn region groovyFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,groovyComment,groovyLineComment,@groovyClasses
|
||||||
|
endif
|
||||||
|
syn match groovyBraces "[{}]"
|
||||||
|
syn cluster groovyTop add=groovyFuncDef,groovyBraces
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("groovy_highlight_debug")
|
||||||
|
|
||||||
|
" Strings and constants
|
||||||
|
syn match groovyDebugSpecial contained "\\\d\d\d\|\\."
|
||||||
|
syn region groovyDebugString contained start=+"+ end=+"+ contains=groovyDebugSpecial
|
||||||
|
syn match groovyDebugStringError +"\([^"\\]\|\\.\)*$+
|
||||||
|
syn match groovyDebugCharacter contained "'[^\\]'"
|
||||||
|
syn match groovyDebugSpecialCharacter contained "'\\.'"
|
||||||
|
syn match groovyDebugSpecialCharacter contained "'\\''"
|
||||||
|
syn match groovyDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||||
|
syn match groovyDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||||
|
syn match groovyDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||||
|
syn match groovyDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||||
|
syn keyword groovyDebugBoolean contained true false
|
||||||
|
syn keyword groovyDebugType contained null this super
|
||||||
|
syn region groovyDebugParen start=+(+ end=+)+ contained contains=groovyDebug.*,groovyDebugParen
|
||||||
|
|
||||||
|
" to make this work you must define the highlighting for these groups
|
||||||
|
syn match groovyDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||||
|
syn match groovyDebug "\<p\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||||
|
syn match groovyDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||||
|
syn match groovyDebug "\<trace[SL]\=\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||||
|
|
||||||
|
syn cluster groovyTop add=groovyDebug
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_c_syn_inits")
|
||||||
|
GroovyHiLink groovyDebug Debug
|
||||||
|
GroovyHiLink groovyDebugString DebugString
|
||||||
|
GroovyHiLink groovyDebugStringError groovyError
|
||||||
|
GroovyHiLink groovyDebugType DebugType
|
||||||
|
GroovyHiLink groovyDebugBoolean DebugBoolean
|
||||||
|
GroovyHiLink groovyDebugNumber Debug
|
||||||
|
GroovyHiLink groovyDebugSpecial DebugSpecial
|
||||||
|
GroovyHiLink groovyDebugSpecialCharacter DebugSpecial
|
||||||
|
GroovyHiLink groovyDebugCharacter DebugString
|
||||||
|
GroovyHiLink groovyDebugParen Debug
|
||||||
|
|
||||||
|
GroovyHiLink DebugString String
|
||||||
|
GroovyHiLink DebugSpecial Special
|
||||||
|
GroovyHiLink DebugBoolean Boolean
|
||||||
|
GroovyHiLink DebugType Type
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Match all Exception classes
|
||||||
|
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
|
||||||
|
|
||||||
|
|
||||||
|
if !exists("groovy_minlines")
|
||||||
|
let groovy_minlines = 10
|
||||||
|
endif
|
||||||
|
exec "syn sync ccomment groovyComment minlines=" . groovy_minlines
|
||||||
|
|
||||||
|
|
||||||
|
" ###################
|
||||||
|
" Groovy stuff
|
||||||
|
" syn match groovyOperator "|[ ,a-zA-Z0-9_*]\+|"
|
||||||
|
|
||||||
|
" All groovy valid tokens
|
||||||
|
" syn match groovyTokens ";\|,\|<=>\|<>\|:\|:=\|>\|>=\|=\|==\|<\|<=\|!=\|/\|/=\|\.\.|\.\.\.\|\~=\|\~=="
|
||||||
|
" syn match groovyTokens "\*=\|&\|&=\|\*\|->\|\~\|+\|-\|/\|?\|<<<\|>>>\|<<\|>>"
|
||||||
|
|
||||||
|
" Must put explicit these ones because groovy.vim mark them as errors otherwise
|
||||||
|
" syn match groovyTokens "<=>\|<>\|==\~"
|
||||||
|
"syn cluster groovyTop add=groovyTokens
|
||||||
|
|
||||||
|
" Mark these as operators
|
||||||
|
|
||||||
|
" Hightlight brackets
|
||||||
|
" syn match groovyBraces "[{}]"
|
||||||
|
" syn match groovyBraces "[\[\]]"
|
||||||
|
" syn match groovyBraces "[\|]"
|
||||||
|
|
||||||
|
if exists("groovy_mark_braces_in_parens_as_errors")
|
||||||
|
syn match groovyInParen contained "[{}]"
|
||||||
|
GroovyHiLink groovyInParen groovyError
|
||||||
|
syn cluster groovyTop add=groovyInParen
|
||||||
|
endif
|
||||||
|
|
||||||
|
" catch errors caused by wrong parenthesis
|
||||||
|
syn region groovyParenT transparent matchgroup=groovyParen start="(" end=")" contains=@groovyTop,groovyParenT1
|
||||||
|
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="(" end=")" contains=@groovyTop,groovyParenT2 contained
|
||||||
|
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="(" end=")" contains=@groovyTop,groovyParenT contained
|
||||||
|
syn match groovyParenError ")"
|
||||||
|
GroovyHiLink groovyParenError groovyError
|
||||||
|
|
||||||
|
" catch errors caused by wrong square parenthesis
|
||||||
|
syn region groovyParenT transparent matchgroup=groovyParen start="\[" end="\]" contains=@groovyTop,groovyParenT1
|
||||||
|
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="\[" end="\]" contains=@groovyTop,groovyParenT2 contained
|
||||||
|
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="\[" end="\]" contains=@groovyTop,groovyParenT contained
|
||||||
|
syn match groovyParenError "\]"
|
||||||
|
|
||||||
|
" ###############################
|
||||||
|
" java.vim default highlighting
|
||||||
|
if version >= 508 || !exists("did_groovy_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_groovy_syn_inits = 1
|
||||||
|
endif
|
||||||
|
GroovyHiLink groovyFuncDef Function
|
||||||
|
GroovyHiLink groovyBraces Function
|
||||||
|
GroovyHiLink groovyBranch Conditional
|
||||||
|
GroovyHiLink groovyUserLabelRef groovyUserLabel
|
||||||
|
GroovyHiLink groovyLabel Label
|
||||||
|
GroovyHiLink groovyUserLabel Label
|
||||||
|
GroovyHiLink groovyConditional Conditional
|
||||||
|
GroovyHiLink groovyRepeat Repeat
|
||||||
|
GroovyHiLink groovyExceptions Exception
|
||||||
|
GroovyHiLink groovyAssert Statement
|
||||||
|
GroovyHiLink groovyStorageClass StorageClass
|
||||||
|
GroovyHiLink groovyMethodDecl groovyStorageClass
|
||||||
|
GroovyHiLink groovyClassDecl groovyStorageClass
|
||||||
|
GroovyHiLink groovyScopeDecl groovyStorageClass
|
||||||
|
GroovyHiLink groovyBoolean Boolean
|
||||||
|
GroovyHiLink groovySpecial Special
|
||||||
|
GroovyHiLink groovySpecialError Error
|
||||||
|
GroovyHiLink groovySpecialCharError Error
|
||||||
|
GroovyHiLink groovyString String
|
||||||
|
GroovyHiLink groovyCharacter Character
|
||||||
|
GroovyHiLink groovySpecialChar SpecialChar
|
||||||
|
GroovyHiLink groovyNumber Number
|
||||||
|
GroovyHiLink groovyError Error
|
||||||
|
GroovyHiLink groovyStringError Error
|
||||||
|
GroovyHiLink groovyStatement Statement
|
||||||
|
GroovyHiLink groovyOperator Operator
|
||||||
|
GroovyHiLink groovyComment Comment
|
||||||
|
GroovyHiLink groovyDocComment Comment
|
||||||
|
GroovyHiLink groovyLineComment Comment
|
||||||
|
GroovyHiLink groovyConstant Constant
|
||||||
|
GroovyHiLink groovyTypedef Typedef
|
||||||
|
GroovyHiLink groovyTodo Todo
|
||||||
|
|
||||||
|
GroovyHiLink groovyCommentTitle SpecialComment
|
||||||
|
GroovyHiLink groovyDocTags Special
|
||||||
|
GroovyHiLink groovyDocParam Function
|
||||||
|
GroovyHiLink groovyCommentStar groovyComment
|
||||||
|
|
||||||
|
GroovyHiLink groovyType Type
|
||||||
|
GroovyHiLink groovyExternal Include
|
||||||
|
|
||||||
|
GroovyHiLink htmlComment Special
|
||||||
|
GroovyHiLink htmlCommentPart Special
|
||||||
|
GroovyHiLink groovySpaceError Error
|
||||||
|
GroovyHiLink groovyJDKBuiltin Special
|
||||||
|
GroovyHiLink groovyJDKOperOverl Operator
|
||||||
|
GroovyHiLink groovyJDKMethods Function
|
||||||
|
endif
|
||||||
|
|
||||||
|
delcommand GroovyHiLink
|
||||||
|
|
||||||
|
|
||||||
|
let b:current_syntax = "groovy"
|
||||||
|
if main_syntax == 'groovy'
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:spell_options="contained"
|
||||||
|
|
||||||
|
" vim: ts=8
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,260 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
||||||
|
|
||||||
" syntax highlighting for haskell
|
|
||||||
"
|
|
||||||
" Heavily modified version of the haskell syntax
|
|
||||||
" highlighter to support haskell.
|
|
||||||
"
|
|
||||||
" author: raichoo (raichoo@googlemail.com)
|
|
||||||
|
|
||||||
if version < 600
|
|
||||||
syn clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
|
||||||
syn region haskellRecordBlock matchgroup=haskellDelimiter start="{" end="}"
|
|
||||||
\ contains=
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellBrackets,
|
|
||||||
\ haskellRecordField,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellPragma,
|
|
||||||
\ haskellForall
|
|
||||||
else
|
|
||||||
syn region haskellRecordBlock matchgroup=haskellDelimiter start="{" end="}"
|
|
||||||
\ contains=
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellBrackets,
|
|
||||||
\ haskellRecordField,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellPragma
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
|
||||||
syn region haskellImportList matchgroup=haskellDelimiter start="(" end=")"
|
|
||||||
\ contains=
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellPatternKeyword
|
|
||||||
else
|
|
||||||
syn region haskellImportList matchgroup=haskellDelimiter start="(" end=")"
|
|
||||||
\ contains=
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellParens
|
|
||||||
end
|
|
||||||
syn match haskellRecordField "[_a-z][a-zA-Z0-9_']*\s*::" contained
|
|
||||||
\ contains=
|
|
||||||
\ haskellIdentifier,
|
|
||||||
\ haskellOperators
|
|
||||||
syn match haskellTopLevelDecl
|
|
||||||
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
|
||||||
\ contains=
|
|
||||||
\ haskellIdentifier,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellBrackets,
|
|
||||||
\ haskellWhere,
|
|
||||||
\ haskellLet,
|
|
||||||
\ haskellDefault
|
|
||||||
syn region haskellModuleBlock matchgroup=haskellBlockKeywords start="\<module\>" end="\<where\>"
|
|
||||||
\ contains=haskellType,haskellDot,haskellImportList
|
|
||||||
syn region haskellClassBlock
|
|
||||||
\ matchgroup=haskellBlockKeywords
|
|
||||||
\ start="^\<\(class\|instance\)\>"
|
|
||||||
\ end="\<where\>\|^\<"
|
|
||||||
\ contains=
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellPragma
|
|
||||||
syn keyword haskellDeclKeyword newtype data type family instance where contained
|
|
||||||
syn region haskellDeclBlock keepend
|
|
||||||
\ start="^\<\(newtype\|data\|type\)\>\s\+\(\<\(family\|instance\)\>\)\?"
|
|
||||||
\ end="\<where\>\|=\|^\<"
|
|
||||||
\ contains=
|
|
||||||
\ haskellDeclKeyword,
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellQuoted,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellBrackets,
|
|
||||||
\ haskellDot,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellPragma
|
|
||||||
syn match haskellAssocType "\s\+\<\(data\|type\|newtype\)\>"
|
|
||||||
syn match haskellDeriving "\(deriving\s\+instance\|deriving\)"
|
|
||||||
syn keyword haskellDefault default
|
|
||||||
syn keyword haskellImportKeywords import qualified safe as hiding contained
|
|
||||||
syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained
|
|
||||||
syn region haskellForeignImport start="\<foreign\>" end="::" keepend
|
|
||||||
\ contains=
|
|
||||||
\ haskellString,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellForeignKeywords,
|
|
||||||
\ haskellIdentifier
|
|
||||||
syn region haskellImport
|
|
||||||
\ start="^import"
|
|
||||||
\ end="^\<"
|
|
||||||
\ contains=
|
|
||||||
\ haskellImportKeywords,
|
|
||||||
\ haskellImportList,
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellLineComment,
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellDot
|
|
||||||
syn keyword haskellStatement do case of in
|
|
||||||
syn keyword haskellWhere where
|
|
||||||
syn keyword haskellLet let
|
|
||||||
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
|
|
||||||
syn keyword haskellStatic static
|
|
||||||
endif
|
|
||||||
syn keyword haskellConditional if then else
|
|
||||||
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
|
|
||||||
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
|
||||||
syn match haskellSeparator "[,;]"
|
|
||||||
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP
|
|
||||||
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP
|
|
||||||
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP
|
|
||||||
syn keyword haskellInfix infix infixl infixr
|
|
||||||
syn keyword haskellBottom undefined error
|
|
||||||
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>"
|
|
||||||
syn match haskellQuote "\<'\+" contained
|
|
||||||
syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained
|
|
||||||
syn region haskellQuoted start="\<'\+" end="\>"
|
|
||||||
\ contains=
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellQuote,
|
|
||||||
\ haskellQuotedType,
|
|
||||||
\ haskellSeparator,
|
|
||||||
\ haskellParens,
|
|
||||||
\ haskellOperators,
|
|
||||||
\ haskellIdentifier
|
|
||||||
syn match haskellDot "\."
|
|
||||||
syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
|
|
||||||
\ contains=
|
|
||||||
\ haskellTodo,
|
|
||||||
\ @Spell
|
|
||||||
syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*`"
|
|
||||||
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
||||||
\ contains=@Spell
|
|
||||||
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
|
|
||||||
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
|
|
||||||
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>\n\?\s*"
|
|
||||||
\ nextgroup=haskellBlockComment,haskellRecordBlock
|
|
||||||
syn region haskellBlockComment start="{-" end="-}"
|
|
||||||
\ contains=
|
|
||||||
\ haskellBlockComment,
|
|
||||||
\ haskellTodo,
|
|
||||||
\ @Spell
|
|
||||||
syn region haskellPragma start="{-#" end="#-}"
|
|
||||||
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-z][a-zA-z0-9_']*|" end="|\]"
|
|
||||||
syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
|
|
||||||
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
|
|
||||||
syn match haskellPreProc "^#.*$"
|
|
||||||
syn keyword haskellTodo TODO FIXME contained
|
|
||||||
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
|
|
||||||
syn keyword haskellTypeRoles phantom representational nominal contained
|
|
||||||
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="^\<" keepend
|
|
||||||
\ contains=
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellTypeRoles
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
|
||||||
syn keyword haskellForall forall
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
|
|
||||||
syn keyword haskellRecursiveDo mdo rec
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
|
|
||||||
syn keyword haskellArrowSyntax proc
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
|
||||||
syn region haskellPatternSynonym start="^\<pattern\>" end="=\|<-" keepend
|
|
||||||
\ contains=
|
|
||||||
\ haskellPatternKeyword,
|
|
||||||
\ haskellType,
|
|
||||||
\ haskellOperators
|
|
||||||
syn keyword haskellPatternKeyword pattern contained
|
|
||||||
endif
|
|
||||||
|
|
||||||
highlight def link haskellBottom Macro
|
|
||||||
highlight def link haskellTH Boolean
|
|
||||||
highlight def link haskellBlockKeywords Structure
|
|
||||||
highlight def link haskellIdentifier Identifier
|
|
||||||
highlight def link haskellForeignKeywords Structure
|
|
||||||
highlight def link haskellDeriving Structure
|
|
||||||
highlight def link haskellStatement Statement
|
|
||||||
highlight def link haskellWhere Statement
|
|
||||||
highlight def link haskellLet Statement
|
|
||||||
highlight def link haskellDefault Statement
|
|
||||||
highlight def link haskellConditional Conditional
|
|
||||||
highlight def link haskellNumber Number
|
|
||||||
highlight def link haskellFloat Float
|
|
||||||
highlight def link haskellSeparator Delimiter
|
|
||||||
highlight def link haskellDelimiter Delimiter
|
|
||||||
highlight def link haskellInfix PreProc
|
|
||||||
highlight def link haskellOperators Operator
|
|
||||||
highlight def link haskellQuote Operator
|
|
||||||
highlight def link haskellQuotedType Include
|
|
||||||
highlight def link haskellDot Operator
|
|
||||||
highlight def link haskellType Include
|
|
||||||
highlight def link haskellLineComment Comment
|
|
||||||
highlight def link haskellBlockComment Comment
|
|
||||||
highlight def link haskellPragma SpecialComment
|
|
||||||
highlight def link haskellString String
|
|
||||||
highlight def link haskellChar String
|
|
||||||
highlight def link haskellBacktick Operator
|
|
||||||
highlight def link haskellPreProc Macro
|
|
||||||
highlight def link haskellTodo Todo
|
|
||||||
highlight def link haskellAssocType Structure
|
|
||||||
highlight def link haskellImportBlock Delimiter
|
|
||||||
highlight def link haskellImportKeywords Structure
|
|
||||||
highlight def link haskellDeclKeyword Structure
|
|
||||||
|
|
||||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
|
||||||
highlight def link haskellForall Operator
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
|
|
||||||
highlight def link haskellRecursiveDo Operator
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
|
|
||||||
highlight def link haskellArrowSyntax Operator
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
|
||||||
highlight def link haskellPatternKeyword Structure
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
|
|
||||||
highlight def link haskellTypeRoles Structure
|
|
||||||
endif
|
|
||||||
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
|
|
||||||
highlight def link haskellStatic Statement
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:current_syntax = "haskell"
|
|
||||||
|
|
||||||
endif
|
|
||||||
103
syntax/kotlin.vim
Normal file
103
syntax/kotlin.vim
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Kotlin
|
||||||
|
" Maintainer: Alexander Udalov
|
||||||
|
" Latest Revision: 1 October 2015
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "kotlin"
|
||||||
|
|
||||||
|
syn keyword ktStatement break continue return
|
||||||
|
syn keyword ktConditional if else when
|
||||||
|
syn keyword ktRepeat do for while
|
||||||
|
syn keyword ktOperator as in is by
|
||||||
|
syn keyword ktKeyword get set out super this This where
|
||||||
|
syn keyword ktException try catch finally throw
|
||||||
|
|
||||||
|
syn keyword ktInclude import package
|
||||||
|
|
||||||
|
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
|
||||||
|
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic
|
||||||
|
syn keyword ktStructure class object interface fun val var constructor init
|
||||||
|
syn keyword ktTypedef typealias
|
||||||
|
|
||||||
|
syn keyword ktBoolean true false
|
||||||
|
syn keyword ktConstant null
|
||||||
|
|
||||||
|
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix
|
||||||
|
|
||||||
|
syn keyword ktTodo TODO FIXME XXX contained
|
||||||
|
syn match ktLineComment "//.*$" contains=ktTodo,@Spell
|
||||||
|
syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell
|
||||||
|
|
||||||
|
syn match ktSpecialCharError "\v\\." contained
|
||||||
|
syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained
|
||||||
|
syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
||||||
|
syn region ktString start='"""' end='"""' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
||||||
|
syn match ktCharacter "\v'[^']*'" contains=ktSpecialChar,ktSpecialCharError
|
||||||
|
syn match ktCharacter "\v'\\''" contains=ktSpecialChar
|
||||||
|
syn match ktCharacter "\v'[^\\]'"
|
||||||
|
|
||||||
|
" TODO: highlight label in 'this@Foo'
|
||||||
|
syn match ktAnnotation "\v(\w)@<!\@[[:alnum:]_.]*(:[[:alnum:]_.]*)?"
|
||||||
|
syn match ktLabel "\v\w+\@"
|
||||||
|
|
||||||
|
syn match ktSimpleInterpolation "\v\$\h\w*" contained
|
||||||
|
syn region ktComplexInterpolation matchgroup=ktComplexInterpolationBrace start="\v\$\{" end="\v\}" contains=ALLBUT,ktSimpleInterpolation
|
||||||
|
|
||||||
|
syn match ktNumber "\v<\d+[LFf]?"
|
||||||
|
syn match ktNumber "\v<0[Xx]\x+L?"
|
||||||
|
syn match ktNumber "\v<0[Bb]\d+L?"
|
||||||
|
syn match ktFloat "\v<\d*(\d[eE][-+]?\d+|\.\d+([eE][-+]?\d+)?)[Ff]?"
|
||||||
|
|
||||||
|
syn match ktEscapedName "\v`.*`"
|
||||||
|
|
||||||
|
syn match ktExclExcl "!!"
|
||||||
|
syn match ktArrow "->"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
hi link ktStatement Statement
|
||||||
|
hi link ktConditional Conditional
|
||||||
|
hi link ktRepeat Repeat
|
||||||
|
hi link ktOperator Operator
|
||||||
|
hi link ktKeyword Keyword
|
||||||
|
hi link ktException Exception
|
||||||
|
|
||||||
|
hi link ktInclude Include
|
||||||
|
|
||||||
|
hi link ktType Type
|
||||||
|
hi link ktModifier StorageClass
|
||||||
|
hi link ktStructure Structure
|
||||||
|
hi link ktTypedef Typedef
|
||||||
|
|
||||||
|
hi link ktBoolean Boolean
|
||||||
|
hi link ktConstant Constant
|
||||||
|
|
||||||
|
hi link ktTodo Todo
|
||||||
|
hi link ktLineComment Comment
|
||||||
|
hi link ktComment Comment
|
||||||
|
hi link ktCommentMatchGroup Comment
|
||||||
|
|
||||||
|
hi link ktSpecialChar SpecialChar
|
||||||
|
hi link ktSpecialCharError Error
|
||||||
|
hi link ktString String
|
||||||
|
hi link ktCharacter Character
|
||||||
|
|
||||||
|
hi link ktAnnotation Identifier
|
||||||
|
hi link ktLabel Identifier
|
||||||
|
|
||||||
|
hi link ktSimpleInterpolation Identifier
|
||||||
|
hi link ktComplexInterpolationBrace Identifier
|
||||||
|
|
||||||
|
hi link ktNumber Number
|
||||||
|
hi link ktFloat Float
|
||||||
|
|
||||||
|
hi link ktExclExcl Special
|
||||||
|
hi link ktArrow Structure
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -87,14 +87,14 @@ exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start=
|
|||||||
|
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend
|
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*\z(\z(`\)\{3,}\|\z(\~\)\{3,}\)[^`]*$" end="^\s*\z1\%(\z2\z3\)*\ze\s*$" keepend
|
||||||
|
|
||||||
syn match markdownFootnote "\[^[^\]]\+\]"
|
syn match markdownFootnote "\[^[^\]]\+\]"
|
||||||
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
|
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
|
||||||
|
|
||||||
if main_syntax ==# 'markdown'
|
if main_syntax ==# 'markdown'
|
||||||
for s:type in g:markdown_fenced_languages
|
for s:type in g:markdown_fenced_languages
|
||||||
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\z(`\)\{3,}\|\z(\~\)\{3,}\)\s*'.matchstr(s:type,'[^=]*').'\>[^`]*$" end="^\s*\z1\%(\z2\z3\)*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
||||||
endfor
|
endfor
|
||||||
unlet! s:type
|
unlet! s:type
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ let s:keywords = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ "p6Operator": [
|
\ "p6Operator": [
|
||||||
\ "div xx x mod also leg cmp before after eq ne le lt not",
|
\ "div xx x mod also leg cmp before after eq ne le lt not",
|
||||||
\ "gt ge eqv ff fff and andthen or xor orelse extra lcm gcd",
|
\ "gt ge eqv ff fff and andthen or xor orelse extra lcm gcd o",
|
||||||
\ ],
|
\ ],
|
||||||
\ "p6Type": [
|
\ "p6Type": [
|
||||||
\ "int int1 int2 int4 int8 int16 int32 int64",
|
\ "int int1 int2 int4 int8 int16 int32 int64",
|
||||||
@@ -176,7 +176,7 @@ syn match p6Type display "\%(::\)\@2<!\%(Order\%(::Same\|::More\|::Less\)\?\|Boo
|
|||||||
" Don't put a "\+" at the end of the character class. That makes it so
|
" Don't put a "\+" at the end of the character class. That makes it so
|
||||||
" greedy that the "%" " in "+%foo" won't be allowed to match as a sigil,
|
" greedy that the "%" " in "+%foo" won't be allowed to match as a sigil,
|
||||||
" among other things
|
" among other things
|
||||||
syn match p6Operator display "[-+/*~?|=^!%&,<>».;\\∈∉∋∌∩∪≼≽⊂⊃⊄⊅⊆⊇⊈⊉⊍⊎⊖∅]"
|
syn match p6Operator display "[-+/*~?|=^!%&,<>».;\\∈∉∋∌∩∪≼≽⊂⊃⊄⊅⊆⊇⊈⊉⊍⊎⊖∅∘]"
|
||||||
syn match p6Operator display "\%(:\@1<!::\@2!\|::=\|\.::\)"
|
syn match p6Operator display "\%(:\@1<!::\@2!\|::=\|\.::\)"
|
||||||
" these require whitespace on the left side
|
" these require whitespace on the left side
|
||||||
syn match p6Operator display "\%(\s\|^\)\@1<=\%(xx=\|p5=>\)"
|
syn match p6Operator display "\%(\s\|^\)\@1<=\%(xx=\|p5=>\)"
|
||||||
@@ -249,9 +249,10 @@ syn cluster p6Interp_qq
|
|||||||
\ add=@p6Interp_function
|
\ add=@p6Interp_function
|
||||||
\ add=@p6Interp_closure
|
\ add=@p6Interp_closure
|
||||||
\ add=@p6Interp_backslash
|
\ add=@p6Interp_backslash
|
||||||
|
\ add=p6MatchVarSigil
|
||||||
|
|
||||||
syn region p6InterpScalar
|
syn region p6InterpScalar
|
||||||
\ start="\ze\z(\$\%(\%(\%(\d\+\|!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
\ start="\ze\z(\$\%(\%(\%(\d\+\|!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||||
\ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\|\%(\d\+\|!\|/\|¢\)\)\)"
|
\ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\|\%(\d\+\|!\|/\|¢\)\)\)"
|
||||||
\ end="\z1\zs"
|
\ end="\z1\zs"
|
||||||
\ contained keepend
|
\ contained keepend
|
||||||
@@ -266,7 +267,7 @@ syn region p6InterpScalar
|
|||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
|
|
||||||
syn region p6InterpArray
|
syn region p6InterpArray
|
||||||
\ start="\ze\z(@\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
\ start="\ze\z(@\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||||
\ end="\z1\zs"
|
\ end="\z1\zs"
|
||||||
\ contained keepend
|
\ contained keepend
|
||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
@@ -280,7 +281,7 @@ syn region p6InterpArray
|
|||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
|
|
||||||
syn region p6InterpHash
|
syn region p6InterpHash
|
||||||
\ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
\ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||||
\ end="\z1\zs"
|
\ end="\z1\zs"
|
||||||
\ contained keepend
|
\ contained keepend
|
||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
@@ -294,7 +295,7 @@ syn region p6InterpHash
|
|||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
|
|
||||||
syn region p6InterpFunction
|
syn region p6InterpFunction
|
||||||
\ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
\ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||||
\ end="\z1\zs"
|
\ end="\z1\zs"
|
||||||
\ contained keepend
|
\ contained keepend
|
||||||
\ contains=TOP
|
\ contains=TOP
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -173,10 +173,10 @@ syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" sk
|
|||||||
|
|
||||||
" Array of interpolated Symbols
|
" Array of interpolated Symbols
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
||||||
|
|
||||||
" Here Document
|
" Here Document
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
@@ -244,7 +244,7 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|||||||
" statements without 'do'
|
" statements without 'do'
|
||||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(\\\n\s*\)\@<!\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
|
||||||
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
||||||
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
||||||
|
|||||||
@@ -27,10 +27,11 @@ syn region tomlString oneline start=/'/ end=/'/
|
|||||||
syn region tomlString start=/'''/ end=/'''/
|
syn region tomlString start=/'''/ end=/'''/
|
||||||
hi def link tomlString String
|
hi def link tomlString String
|
||||||
|
|
||||||
syn match tomlInteger /\<-\?\d\+\>/ display
|
syn match tomlInteger /\<[+-]\=[0-9]\(_\=\d\)*\>/ display
|
||||||
hi def link tomlInteger Number
|
hi def link tomlInteger Number
|
||||||
|
|
||||||
syn match tomlFloat /\<-\?\d\+\.\d\+\>/ display
|
syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\.\d\+\>/ display
|
||||||
|
syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\(\.[0-9]\(_\=\d\)*\)\=[eE][+-]\=[0-9]\(_\=\d\)*\>/ display
|
||||||
hi def link tomlFloat Float
|
hi def link tomlFloat Float
|
||||||
|
|
||||||
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
||||||
|
|||||||
Reference in New Issue
Block a user