Compare commits

..

34 Commits

Author SHA1 Message Date
Adam Stankiewicz
841cb535df Try sudo-less build on travis 2015-12-06 12:12:02 +01:00
Adam Stankiewicz
e5b26a7308 Update apt-get on travis before installation 2015-12-06 12:09:13 +01:00
Adam Stankiewicz
b4b054ebf5 Add objc syntax highlighting, closes #77 2015-12-06 11:58:15 +01:00
Adam Stankiewicz
08ea94e011 Add elm support, closes #81 2015-12-06 11:53:26 +01:00
Adam Stankiewicz
ba7a783c7f Pack compiler configuration with go, closes #84 2015-12-06 11:51:45 +01:00
Adam Stankiewicz
f58692a641 Update nginx source to upstream, closes #90 2015-12-06 11:45:35 +01:00
Adam Stankiewicz
0dc7696c89 Add jinja language support, closes #92 2015-12-06 11:39:05 +01:00
Adam Stankiewicz
5658b62b7a Add dart language support, closes #93 2015-12-06 11:38:02 +01:00
Adam Stankiewicz
938a2f1667 Add vcl syntax, closes #82 2015-12-06 11:34:19 +01:00
Adam Stankiewicz
303b3f1b43 Update all bundles 2015-12-06 11:31:38 +01:00
Adam Stankiewicz
bf84973173 Update repository urls for redirects 2015-12-06 11:31:01 +01:00
Adam Stankiewicz
89728a486d Merge pull request #87 from debris/update_rust
rust repository url updated
2015-12-06 11:29:54 +01:00
Adam Stankiewicz
ae3a0d72cc Merge pull request #95 from clessg/master
Use updated Swift plugin
2015-12-06 11:29:29 +01:00
Chris Gaudreau
3475a2df67 Use updated Swift plugin 2015-12-05 21:05:04 -04:00
Adam Stankiewicz
ac42e00864 Merge pull request #88 from shaneog/patch-1
Add links to vim package managers
2015-11-24 17:09:15 +01:00
Shane O'Grady
0293cf8346 Add links to vim package managers 2015-11-24 12:08:46 -02:00
debris
8c139a4546 rust repository url updated 2015-11-20 15:47:50 +01:00
Adam Stankiewicz
47a036761a Mention about Plug package manager 2015-10-24 14:41:39 +02:00
Adam Stankiewicz
d2c90dad0a Remove duplicate package from build list 2015-10-24 14:25:31 +02:00
Adam Stankiewicz
7ac92eac0f Merge pull request #78 from KabbAmine/sass-scss
Add sass/scss
2015-10-24 14:22:55 +02:00
Kabbaj Amine
7800dae776 Add sass/scss 2015-10-24 14:34:14 +03:00
Adam Stankiewicz
a39c9013cc Update ruby syntax 2015-10-24 13:15:38 +02:00
Adam Stankiewicz
25d2786cae Update erlang provider to vim-erlang/vim-erlang-runtime, closes #76 2015-10-18 16:13:43 +02:00
Adam Stankiewicz
1f1e821192 Change haskell provider to neovimhaskell/haskell-vim, closes #75 2015-10-18 16:08:51 +02:00
Adam Stankiewicz
ae882e85f8 Update 2015-10-18 16:07:12 +02:00
Adam Stankiewicz
aec5e42bdb Update yajs syntax 2015-10-10 17:52:47 +02:00
Adam Stankiewicz
a0c79360ed Add qml support, closes #69 2015-10-10 17:25:38 +02:00
Adam Stankiewicz
2d3b20bc68 Add groovy syntax, closes #74 2015-10-10 17:18:03 +02:00
Adam Stankiewicz
a6b0efd530 Add glsl and kotlin languages, fixes #72, #71 2015-10-10 17:15:29 +02:00
Adam Stankiewicz
0de043adbc Update 2015-10-10 16:56:22 +02:00
Adam Stankiewicz
67fcbd2a86 Remove highlighting of reserved words in javascript 2015-07-19 21:13:11 +02:00
Adam Stankiewicz
c925c92217 Better support for es6 syntax 2015-07-19 18:57:00 +02:00
Adam Stankiewicz
852d25b307 Remove bitdeli as it sems to not work with Github image proxying 2015-07-18 23:57:14 +02:00
Adam Stankiewicz
4d8ff4eabc Mention how to update language packs 2015-07-18 23:55:47 +02:00
87 changed files with 4501 additions and 865 deletions

View File

@@ -1,7 +1,11 @@
language: ruby language: ruby
rvm: rvm:
- 1.9.3 - 1.9.3
before_install: sudo apt-get install vim-gtk sudo: false
addons:
apt:
packages:
- vim-gtk
before_script: before_script:
- "export DISPLAY=:99.0" - "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start" - "sh -e /etc/init.d/xvfb start"

View File

@@ -18,7 +18,7 @@ A collection of language packs for Vim.
## Installation ## Installation
1. Install pathogen, Vundle or NeoBundle package manager. 1. Install [Pathogen](https://github.com/tpope/vim-pathogen), [Vundle](https://github.com/VundleVim/Vundle.vim), [NeoBundle](https://github.com/Shougo/neobundle.vim), or [Plug](https://github.com/junegunn/vim-plug) package manager for Vim.
2. Use this repository as submodule or package. 2. Use this repository as submodule or package.
Optionally download one of the [releases](https://github.com/sheerun/vim-polyglot/releases) and unpack it directly under `~/.vim` directory. Optionally download one of the [releases](https://github.com/sheerun/vim-polyglot/releases) and unpack it directly under `~/.vim` directory.
@@ -26,71 +26,80 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
## Language packs ## Language packs
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect) - [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, ftdetect) - [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftdetect)
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax) - [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax) - [c/c++](https://github.com/vim-jp/vim-cpp) (syntax)
- [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin)
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect) - [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin)
- [css](https://github.com/JulesWang/css.vim) (syntax) - [css](https://github.com/JulesWang/css.vim) (syntax)
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, ftplugin, ftdetect)
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect) - [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
- [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/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect) - [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect) - [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
- [go](https://github.com/fatih/vim-go) (syntax, compiler, 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, indent, ftplugin, ftdetect)
- [haskell](https://github.com/raichoo/haskell-vim) (syntax, indent, ftplugin, ftdetect) - [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin, ftdetect)
- [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)
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect) - [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftdetect) - [javascript](https://github.com/sheerun/yajs.vim) (syntax, indent)
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect) - [jinja](https://github.com/Glench/Vim-Jinja2-Syntax) (syntax, indent, ftdetect)
- [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) (ftdetect, after)
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
- [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)
- [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect) - [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect)
- [nginx](https://github.com/mutewinter/nginx.vim) (syntax, ftdetect) - [nginx](https://github.com/nginx/nginx) (syntax, indent, ftdetect)
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
- [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin) - [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin)
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax) - [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin, ftdetect) - [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin, ftdetect)
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect) - [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect) - [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent) - [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin) - [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect)
- [ragel](https://github.com/jneen/ragel.vim) (syntax) - [ragel](https://github.com/jneen/ragel.vim) (syntax)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect) - [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect) - [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect) - [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect) - [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect) - [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect) - [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin, ftdetect)
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect) - [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect) - [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect) - [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect) - [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax, ftdetect)
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax) - [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
- [yard](https://github.com/sheerun/vim-yardoc) (syntax) - [yard](https://github.com/sheerun/vim-yardoc) (syntax)
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
## Disabling a language pack ## Disabling a language pack
@@ -103,6 +112,10 @@ let g:polyglot_disabled = ['css']
Note that disabiling languages won't make in general your vim startup any faster / slower (only for specific file type). Vim-polyglot is selection of language plugins that are loaded only on demand. Note that disabiling languages won't make in general your vim startup any faster / slower (only for specific file type). Vim-polyglot is selection of language plugins that are loaded only on demand.
## Updating
You can either wait for new patch release with updates or run the `./build` script by yourself.
## Contributing ## Contributing
Language packs are periodically updated using automated `build` script. Language packs are periodically updated using automated `build` script.
@@ -112,7 +125,3 @@ Feel free to add your language, and send pull-request.
## License ## License
See linked repositories for detailed license information. See linked repositories for detailed license information.
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sheerun/vim-polyglot/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

View File

@@ -1,24 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftdetect file
"
" Language: JSX (JavaScript)
" Maintainer: Max Wang <mxawng@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
fu! <SID>EnableJSX()
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
return 1
endfu
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
autocmd BufNewFile,BufRead *.js
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
endif

View File

@@ -9,13 +9,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Do nothing if we don't find the @jsx pragma (and we care).
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
if g:jsx_pragma_required && !b:jsx_pragma_found | finish | endif
" Do nothing if we don't have the .jsx extension (and we care).
if g:jsx_ext_required && !exists('b:jsx_ext_found') | finish | endif
" Prologue; load in XML indentation. " Prologue; load in XML indentation.
if exists('b:did_indent') if exists('b:did_indent')
let s:did_indent=b:did_indent let s:did_indent=b:did_indent

97
after/indent/objc.vim Normal file
View File

@@ -0,0 +1,97 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
" Vim indent file
" Language: Objective-C
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
" Last Change: 2012 Jan 01
" Ensure 'cpo' is set to Vim default values and restore later
let s:save_cpo = &cpo
set cpo&vim
" Only load this indent file when no other was loaded.
"if exists("b:did_indent")
" finish
"endif
"let b:did_indent = 1
"setlocal cindent
setl indentkeys=0{,0},:,0#,!^F,o,O,e,<:>
setlocal indentexpr=GetObjCIndentImproved()
" Top level statements which should not be indented, and which should not
" cause next (non-blank) line to be indented either.
let s:topLev = '^\s*@\%(class\|end\|implementation\|interface\|protocol\|\)\>'
function! GetObjCIndentImproved()
" NOTE: Ignore leading white space to avoid having to deal with space vs.
" tab issues. Rely on the indent() function instead.
let thisLine = substitute(getline(v:lnum), '^\s*', '', '')
if thisLine =~# s:topLev || getline(prevnonblank(v:lnum - 1)) =~# s:topLev
return 0
endif
" If current line looks like an argument to a message dispatch, then line
" up colon with previous line. This will indent the second line so that
" the colons line up in
"
" [obj firstParameter:value
" paramB:value2];
"
" but it will not line up colons in
"
" if ([obj something:here])
" [obj other:here];
"
let thisColon = match(thisLine, '^\s*\K\k*\zs:')
if thisColon > 0
let prevLine = substitute(getline(v:lnum - 1), '^\s*', '', '')
let prevColon = match(prevLine, ':')
if prevColon > 0
" Try to align colons, always making sure line is indented at least
" one shiftwidth more than the indentation at the beginning of the
" message. Avoids situations like this:
"
" if ([obj a:x
" aLongParameter:y])
"
let [lnum,lcol] = searchpairpos('\[', '', '\]', 'b', 0,
\ max([1, v:lnum - 10]))
let minInd = &sw + (lnum > 0 ? indent(lnum) : 0)
let alignedInd = indent(v:lnum - 1) + prevColon - thisColon
return alignedInd > minInd ? alignedInd : minInd
endif
endif
let prevLnum = v:lnum - 1
let ind = indent(prevLnum)
" Indent one shiftwidth after opening block, e.g.:
"
" call_func_with_block(param, ^{
" do_stuff();
" });
"
let blockPat = '\^\s*\(([^)]*)\)\?\s*{$'
if thisLine =~ '^}'
norm '^%'
if getline(".") =~ blockPat
return indent(".")
endif
endif
if getline(prevLnum) =~ blockPat
return ind + &sw
endif
return cindent(v:lnum)
endfunction
" Restore 'cpo' options
let &cpo = s:save_cpo
unlet s:save_cpo
endif

View File

@@ -1,37 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vimscript file
"
" Set up a bunch of configuration variables.
"
" Also check (if desired) whether or not the @jsx pragma is correctly included
" in '%'. Set the result in b:jsx_pragma_found.
"
" Language: JSX (JavaScript)
" Maintainer: Max Wang <mxawng@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Only check once.
if exists('b:jsx_pragma_found')
finish
endif
" Whether the .jsx extension is required to enable JSX syntax/indent.
if !exists('g:jsx_ext_required')
let g:jsx_ext_required = 1
endif
" Whether the @jsx pragma is required to enable JSX syntax/indent.
if !exists('g:jsx_pragma_required')
let g:jsx_pragma_required = 0
endif
if !g:jsx_pragma_required | finish | endif
" Look for the @jsx pragma. It must be included in a docblock comment before
" anything else in the file (except whitespace).
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
endif

View File

@@ -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

View File

@@ -11,13 +11,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Do nothing if we don't find the @jsx pragma (and we care).
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
if g:jsx_pragma_required && !b:jsx_pragma_found | finish | endif
" Do nothing if we don't have the .jsx extension (and we care).
if g:jsx_ext_required && !exists('b:jsx_ext_found') | finish | endif
" Prologue; load in XML syntax. " Prologue; load in XML syntax.
if exists('b:current_syntax') if exists('b:current_syntax')
let s:current_syntax=b:current_syntax let s:current_syntax=b:current_syntax
@@ -28,9 +21,24 @@ if exists('s:current_syntax')
let b:current_syntax=s:current_syntax let b:current_syntax=s:current_syntax
endif endif
" Officially, vim-jsx depends on the pangloss/vim-javascript syntax package
" (and is tested against it exclusively). However, in practice, we make some
" effort towards compatibility with other packages.
"
" These are the plugin-to-syntax-element correspondences:
"
" - pangloss/vim-javascript: jsBlock, jsExpression
" - jelera/vim-javascript-syntax: javascriptBlock
" - othree/yajs.vim: javascriptNoReserved
" Highlight JSX regions as XML; recursively match. " Highlight JSX regions as XML; recursively match.
"
" Note that we prohibit JSX tags from having a < or word character immediately
" preceding it, to avoid conflicts with, respectively, the left shift operator
" and generic Flow type annotations (http://flowtype.org/).
syn region jsxRegion contains=@XMLSyntax,jsxRegion,jsBlock,javascriptBlock syn region jsxRegion contains=@XMLSyntax,jsxRegion,jsBlock,javascriptBlock
\ start=+<\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+ \ start=+\%(<\|\w\)\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+
\ skip=+<!--\_.\{-}-->+ \ skip=+<!--\_.\{-}-->+
\ end=+</\z1\_\s\{-}>+ \ end=+</\z1\_\s\{-}>+
\ end=+/>+ \ end=+/>+
@@ -44,4 +52,7 @@ syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock
" Add jsxRegion to the lowest-level JS syntax cluster. " Add jsxRegion to the lowest-level JS syntax cluster.
syn cluster jsExpression add=jsxRegion syn cluster jsExpression add=jsxRegion
" Allow jsxRegion to contain reserved words.
syn cluster javascriptNoReserved add=jsxRegion
endif endif

23
after/syntax/objc.vim Normal file
View File

@@ -0,0 +1,23 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
" ARC type modifiers
syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained
" Block modifiers
syn keyword objcTypeModifier __block
" Remote messaging modifiers
syn keyword objcTypeModifier byref
" Property keywords - these are only highlighted inside '@property (...)'
syn keyword objcPropertyAttribute contained getter setter readwrite readonly strong weak copy assign retain nonatomic
syn match objcProperty display "^\s*@property\>\s*([^)]*)" contains=objcPropertyAttribute
" The @property directive must be defined after objcProperty or it won't be
" highlighted
syn match objcDirective "@property\|@synthesize\|@dynamic\|@package"
" Highlight property attributes as if they were type modifiers
hi def link objcPropertyAttribute objcTypeModifier
endif

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8' if !exists('g:rust_conceal') || g:rust_conceal == 0 || !has('conceal') || &enc != 'utf-8'
finish finish
endif endif
" For those who don't want to see `::`... " For those who don't want to see `::`...
if exists('g:rust_conceal_mod_path') if exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
syn match rustNiceOperator "::" conceal cchar= syn match rustNiceOperator "::" conceal cchar=
endif endif
@@ -20,7 +20,7 @@ syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrow
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar= syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=
" For those who don't want to see `pub`... " For those who don't want to see `pub`...
if exists('g:rust_conceal_pub') if exists('g:rust_conceal_pub') && g:rust_conceal_pub != 0
syn match rustPublicSigil contained "pu" conceal cchar= syn match rustPublicSigil contained "pu" conceal cchar=
syn match rustPublicRest contained "b" conceal cchar=  syn match rustPublicRest contained "b" conceal cchar= 
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
@@ -28,7 +28,7 @@ endif
hi link rustNiceOperator Operator hi link rustNiceOperator Operator
if !exists('g:rust_conceal_mod_path') if !exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
hi! link Conceal Operator hi! link Conceal Operator
endif endif

12
autoload/elm/io.vim Normal file
View File

@@ -0,0 +1,12 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
" System IO
" Craft a system command and run it, returning the output.
function! elm#io#system(program, args)
let cmd ="which " . a:program . " && " . a:program . " " . a:args
return system(cmd)
endfunction
endif

View File

@@ -36,72 +36,74 @@ endfunction
" Run {{{1 " Run {{{1
function! rust#Run(bang, args) function! rust#Run(bang, args)
let args = s:ShellTokenize(a:args)
if a:bang if a:bang
let idx = index(a:args, '--') let idx = index(l:args, '--')
if idx != -1 if idx != -1
let rustc_args = idx == 0 ? [] : a:args[:idx-1] let rustc_args = idx == 0 ? [] : l:args[:idx-1]
let args = a:args[idx+1:] let args = l:args[idx+1:]
else else
let rustc_args = a:args let rustc_args = l:args
let args = [] let args = []
endif endif
else else
let rustc_args = [] let rustc_args = []
let args = a:args
endif endif
let b:rust_last_rustc_args = rustc_args let b:rust_last_rustc_args = l:rustc_args
let b:rust_last_args = args let b:rust_last_args = l:args
call s:WithPath(function("s:Run"), rustc_args, args) call s:WithPath(function("s:Run"), rustc_args, args)
endfunction endfunction
function! s:Run(path, rustc_args, args) function! s:Run(dict, rustc_args, args)
try let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
let exepath = tempname() if has('win32')
if has('win32') let exepath .= '.exe'
let exepath .= '.exe' endif
endif
let rustc_args = [a:path, '-o', exepath] + a:rustc_args let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let output = system(shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)'))) let pwd = a:dict.istemp ? a:dict.tmpdir : ''
if output != '' let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
echohl WarningMsg if output != ''
echo output echohl WarningMsg
echohl None echo output
endif echohl None
if !v:shell_error endif
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)')) if !v:shell_error
endif exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
finally endif
if exists("exepath")
silent! call delete(exepath)
endif
endtry
endfunction endfunction
" Expand {{{1 " Expand {{{1
function! rust#Expand(bang, args) function! rust#Expand(bang, args)
if a:bang && !empty(a:args) let args = s:ShellTokenize(a:args)
let pretty = a:args[0] if a:bang && !empty(l:args)
let args = a:args[1:] let pretty = remove(l:args, 0)
else else
let pretty = "expanded" let pretty = "expanded"
let args = a:args
endif endif
call s:WithPath(function("s:Expand"), pretty, args) call s:WithPath(function("s:Expand"), pretty, args)
endfunction endfunction
function! s:Expand(path, pretty, args) function! s:Expand(dict, pretty, args)
try try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--pretty', a:pretty] + a:args if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)"))) let flag = '--xpretty'
else
let flag = '--pretty'
endif
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if v:shell_error if v:shell_error
echohl WarningMsg echohl WarningMsg
echo output echo output
@@ -115,6 +117,20 @@ function! s:Expand(path, pretty, args)
setl buftype=nofile setl buftype=nofile
setl bufhidden=hide setl bufhidden=hide
setl noswapfile setl noswapfile
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.pretty.rs'
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif endif
endtry endtry
endfunction endfunction
@@ -122,7 +138,7 @@ endfunction
function! rust#CompleteExpand(lead, line, pos) function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$' if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a ! " first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="] let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
if !empty(a:lead) if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead") call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif endif
@@ -135,72 +151,120 @@ endfunction
" Emit {{{1 " Emit {{{1
function! rust#Emit(type, args) function! rust#Emit(type, args)
call s:WithPath(function("s:Emit"), a:type, a:args) let args = s:ShellTokenize(a:args)
call s:WithPath(function("s:Emit"), a:type, args)
endfunction endfunction
function! s:Emit(path, type, args) function! s:Emit(dict, type, args)
try try
let output_path = a:dict.tmpdir.'/output'
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--emit', a:type, '-o', '-'] + a:args let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)"))) let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
if v:shell_error let pwd = a:dict.istemp ? a:dict.tmpdir : ''
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg echohl WarningMsg
echo output echo output
echohl None echohl None
else endif
if !v:shell_error
new new
silent put =output exe 'silent keepalt read' fnameescape(output_path)
1 1
d d
if a:type == "ir" if a:type == "llvm-ir"
setl filetype=llvm setl filetype=llvm
let extension = 'll'
elseif a:type == "asm" elseif a:type == "asm"
setl filetype=asm setl filetype=asm
let extension = 's'
endif endif
setl buftype=nofile setl buftype=nofile
setl bufhidden=hide setl bufhidden=hide
setl noswapfile setl noswapfile
if exists('l:extension')
" give the buffer a nice name
let suffix = 1
let basename = fnamemodify(a:dict.path, ':t:r')
while 1
let bufname = basename
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
let bufname .= '.'.extension
if bufexists(bufname)
let suffix += 1
continue
endif
exe 'silent noautocmd keepalt file' fnameescape(bufname)
break
endwhile
endif
endif endif
endtry endtry
endfunction endfunction
" Utility functions {{{1 " Utility functions {{{1
" Invokes func(dict, ...)
" Where {dict} is a dictionary with the following keys:
" 'path' - The path to the file
" 'tmpdir' - The path to a temporary directory that will be deleted when the
" function returns.
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
" If {istemp} is 1 then an additional key is provided:
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
"
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
" then it is guaranteed to have a '.rs' extension.
function! s:WithPath(func, ...) function! s:WithPath(func, ...)
let buf = bufnr('')
let saved = {}
let dict = {}
try try
let save_write = &write let saved.write = &write
set write set write
let path = expand('%') let dict.path = expand('%')
let pathisempty = empty(path) let pathisempty = empty(dict.path)
if pathisempty || !save_write
" use a temporary file named 'unnamed.rs' inside a temporary
" directory. This produces better error messages
let tmpdir = tempname()
call mkdir(tmpdir)
let save_cwd = getcwd() " Always create a tmpdir in case the wrapped command wants it
silent exe 'lcd' fnameescape(tmpdir) let dict.tmpdir = tempname()
call mkdir(dict.tmpdir)
let path = 'unnamed.rs' if pathisempty || !saved.write
let dict.istemp = 1
" if we're doing this because of nowrite, preserve the filename
if !pathisempty
let filename = expand('%:t:r').".rs"
else
let filename = 'unnamed.rs'
endif
let dict.tmpdir_relpath = filename
let dict.path = dict.tmpdir.'/'.filename
let save_mod = &mod let saved.mod = &mod
set nomod set nomod
silent exe 'keepalt write! ' . fnameescape(path) silent exe 'keepalt write! ' . fnameescape(dict.path)
if pathisempty if pathisempty
silent keepalt 0file silent keepalt 0file
endif endif
else else
let dict.istemp = 0
update update
endif endif
call call(a:func, [path] + a:000) call call(a:func, [dict] + a:000)
finally finally
if exists("save_mod") | let &mod = save_mod | endif if bufexists(buf)
if exists("save_write") | let &write = save_write | endif for [opt, value] in items(saved)
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif silent call setbufvar(buf, '&'.opt, value)
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif unlet value " avoid variable type mismatches
endfor
endif
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
endtry endtry
endfunction endfunction
@@ -210,6 +274,71 @@ function! rust#AppendCmdLine(text)
return cmd return cmd
endfunction endfunction
" Tokenize the string according to sh parsing rules
function! s:ShellTokenize(text)
" states:
" 0: start of word
" 1: unquoted
" 2: unquoted backslash
" 3: double-quote
" 4: double-quoted backslash
" 5: single-quote
let l:state = 0
let l:current = ''
let l:args = []
for c in split(a:text, '\zs')
if l:state == 0 || l:state == 1 " unquoted
if l:c ==# ' '
if l:state == 0 | continue | endif
call add(l:args, l:current)
let l:current = ''
let l:state = 0
elseif l:c ==# '\'
let l:state = 2
elseif l:c ==# '"'
let l:state = 3
elseif l:c ==# "'"
let l:state = 5
else
let l:current .= l:c
let l:state = 1
endif
elseif l:state == 2 " unquoted backslash
if l:c !=# "\n" " can it even be \n?
let l:current .= l:c
endif
let l:state = 1
elseif l:state == 3 " double-quote
if l:c ==# '\'
let l:state = 4
elseif l:c ==# '"'
let l:state = 1
else
let l:current .= l:c
endif
elseif l:state == 4 " double-quoted backslash
if stridx('$`"\', l:c) >= 0
let l:current .= l:c
elseif l:c ==# "\n" " is this even possible?
" skip it
else
let l:current .= '\'.l:c
endif
let l:state = 3
elseif l:state == 5 " single-quoted
if l:c == "'"
let l:state = 1
else
let l:current .= l:c
endif
endif
endfor
if l:state != 0
call add(l:args, l:current)
endif
return l:args
endfunction
function! s:RmDir(path) function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME " sanity check; make sure it's not empty, /, or $HOME
if empty(a:path) if empty(a:path)
@@ -222,6 +351,66 @@ function! s:RmDir(path)
silent exe "!rm -rf " . shellescape(a:path) silent exe "!rm -rf " . shellescape(a:path)
endfunction endfunction
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
" If {pwd} is the empty string then it doesn't change the cwd.
function! s:system(pwd, cmd)
let cmd = a:cmd
if !empty(a:pwd)
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
endif
return system(cmd)
endfunction
" Playpen Support {{{1
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
" gist.vim available under the BSD license, available at
" http://github.com/mattn/gist-vim
function! s:has_webapi()
if !exists("*webapi#http#post")
try
call webapi#http#post()
catch
endtry
endif
return exists("*webapi#http#post")
endfunction
function! rust#Play(count, line1, line2, ...) abort
redraw
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
if !s:has_webapi()
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
return
endif
let bufname = bufname('%')
if a:count < 1
let content = join(getline(a:line1, a:line2), "\n")
else
let save_regcont = @"
let save_regtype = getregtype('"')
silent! normal! gvy
let content = @"
call setreg('"', save_regcont, save_regtype)
endif
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
if strlen(body) > 5000
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
return
endif
let payload = "format=simple&url=".webapi#http#encodeURI(body)
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
let url = res.content
redraw | echomsg 'Done: '.url
endfunction
" }}}1 " }}}1
" vim: set noet sw=4 ts=4: " vim: set noet sw=4 ts=4:

83
autoload/rustfmt.vim Normal file
View File

@@ -0,0 +1,83 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Author: Stephen Sugden <stephen@stephensugden.com>
"
" Adapted from https://github.com/fatih/vim-go
if !exists("g:rustfmt_autosave")
let g:rustfmt_autosave = 0
endif
if !exists("g:rustfmt_command")
let g:rustfmt_command = "rustfmt"
endif
if !exists("g:rustfmt_options")
let g:rustfmt_options = ""
endif
if !exists("g:rustfmt_fail_silently")
let g:rustfmt_fail_silently = 0
endif
let s:got_fmt_error = 0
function! rustfmt#Format()
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = g:rustfmt_command . " --write-mode=overwrite "
let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
if v:shell_error == 0
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
" Replace current file with temp file, then reload buffer
call rename(l:tmpname, expand('%'))
silent edit!
let &syntax = &syntax
" only clear location list if it was previously filled to prevent
" clobbering other additions
if s:got_fmt_error
let s:got_fmt_error = 0
call setloclist(0, [])
lwindow
endif
elseif g:rustfmt_fail_silently == 0
" otherwise get the errors and put them in the location list
let errors = []
for line in out
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
if !empty(tokens)
call add(errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[5]})
endif
endfor
if empty(errors)
% | " Couldn't detect rustfmt error format, output errors
endif
if !empty(errors)
call setloclist(0, errors, 'r')
echohl Error | echomsg "rustfmt returned error" | echohl None
endif
let s:got_fmt_error = 1
lwindow
" We didn't use the temp file, so clean up
call delete(l:tmpname)
endif
call winrestview(l:curw)
endfunction
endif

47
build
View File

@@ -3,7 +3,7 @@
set -E set -E
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect" DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
DIRS_BASIC="syntax indent ftdetect after/syntax after/indent after/ftdetect" DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after" DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
OUTPUT="" OUTPUT=""
@@ -97,71 +97,80 @@ EOF
PACKS=" PACKS="
arduino:sudar/vim-arduino-syntax arduino:sudar/vim-arduino-syntax
blade:xsbeats/vim-blade blade:jwalton512/vim-blade
c++11:octol/vim-cpp-enhanced-highlight c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/cpp-vim c/c++:vim-jp/vim-cpp
cjsx:mtscout6/vim-cjsx
clojure:guns/vim-clojure-static clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script coffee-script:kchmck/vim-coffee-script
cjsx:mtscout6/vim-cjsx
css:JulesWang/css.vim css:JulesWang/css.vim
cucumber:tpope/vim-cucumber cucumber:tpope/vim-cucumber
dart:dart-lang/dart-vim-plugin
dockerfile:honza/dockerfile.vim dockerfile:honza/dockerfile.vim
elm:lambdatoast/elm.vim
elixir:elixir-lang/vim-elixir elixir:elixir-lang/vim-elixir
emberscript:heartsentwined/vim-ember-script emberscript:heartsentwined/vim-ember-script
emblem:heartsentwined/vim-emblem emblem:heartsentwined/vim-emblem
erlang:hcs42/vim-erlang-runtime erlang:vim-erlang/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:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe haxe:yaymukund/vim-haxe
html5:othree/html5.vim html5:othree/html5.vim
jade:digitaltoad/vim-jade jade:digitaltoad/vim-jade
jasmine:glanotte/vim-jasmine jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript javascript:sheerun/yajs.vim
julia:dcjones/julia-minimalist-vim jinja:Glench/Vim-Jinja2-Syntax
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
julia:dcjones/julia-minimalist-vim
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
markdown:tpope/vim-markdown markdown:tpope/vim-markdown
nginx:mutewinter/nginx.vim nginx:nginx/nginx::/contrib/vim/
objc:b4winckler/vim-objc
ocaml:jrk/vim-ocaml ocaml:jrk/vim-ocaml
octave:vim-scripts/octave.vim-- octave:vim-scripts/octave.vim--
opencl:petRUShka/vim-opencl opencl:petRUShka/vim-opencl
perl:vim-perl/vim-perl perl:vim-perl/vim-perl
php:StanAngeloff/php.vim php:StanAngeloff/php.vim
puppet:rodjek/vim-puppet
powershell:Persistent13/vim-ps1 powershell:Persistent13/vim-ps1
protobuf:uarun/vim-protobuf protobuf:uarun/vim-protobuf
puppet:rodjek/vim-puppet
python:mitsuhiko/vim-python-combined python:mitsuhiko/vim-python-combined
r-lang:vim-scripts/R.vim qml:peterhoeg/vim-qml
ragel:jneen/ragel.vim ragel:jneen/ragel.vim
r-lang:vim-scripts/R.vim
rspec:sheerun/rspec.vim rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby ruby:vim-ruby/vim-ruby
rust:wting/rust.vim rust:rust-lang/rust.vim
sbt:derekwyatt/vim-sbt sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala scala:derekwyatt/vim-scala
slim:slim-template/vim-slim slim:slim-template/vim-slim
solidity:ethereum/vim-solidity solidity:ethereum/vim-solidity
stylus:wavded/vim-stylus stylus:wavded/vim-stylus
swift:keith/swift.vim
systemd:kurayama/systemd-vim-syntax systemd:kurayama/systemd-vim-syntax
swift:toyamarinyon/vim-swift
textile:timcharper/textile.vim textile:timcharper/textile.vim
tmux:tejr/vim-tmux
tomdoc:duwanis/tomdoc.vim
typescript:leafgarland/typescript-vim
vbnet:vim-scripts/vbnet.vim
thrift:solarnz/thrift.vim thrift:solarnz/thrift.vim
tmux:tejr/vim-tmux
tomdoc:wellbredgrapefruit/tomdoc.vim
toml:cespare/vim-toml toml:cespare/vim-toml
twig:beyondwords/vim-twig twig:beyondwords/vim-twig
typescript:leafgarland/typescript-vim
vala:tkztmk/vim-vala
vbnet:vim-scripts/vbnet.vim
vcl:smerrill/vcl-vim-plugin
vm:lepture/vim-velocity
xls:vim-scripts/XSLT-syntax xls:vim-scripts/XSLT-syntax
yard:sheerun/vim-yardoc yard:sheerun/vim-yardoc
vala:tkztmk/vim-vala
vm:lepture/vim-velocity
" "
rm -rf tmp rm -rf tmp

45
compiler/go.vim Normal file
View File

@@ -0,0 +1,45 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" compiler/go.vim: Vim compiler file for Go.
if exists("current_compiler")
finish
endif
let current_compiler = "go"
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
let s:save_cpo = &cpo
set cpo-=C
if filereadable("makefile") || filereadable("Makefile")
CompilerSet makeprg=make
else
CompilerSet makeprg=go\ build
endif
" Define the patterns that will be recognized by QuickFix when parsing the
" output of Go command that use this errorforamt (when called make, cexpr or
" lmake, lexpr). This is the global errorformat, however some command might
" use a different output, for those we define them directly and modify the
" errorformat ourselves. More information at:
" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat
CompilerSet errorformat =%-G#\ %.%# " Ignore lines beginning with '#' ('# command-line-arguments' line sometimes appears?)
CompilerSet errorformat+=%-G%.%#panic:\ %m " Ignore lines containing 'panic: message'
CompilerSet errorformat+=%Ecan\'t\ load\ package:\ %m " Start of multiline error string is 'can\'t load package'
CompilerSet errorformat+=%A%f:%l:%c:\ %m " Start of multiline unspecified string is 'filename:linenumber:columnnumber:'
CompilerSet errorformat+=%A%f:%l:\ %m " Start of multiline unspecified string is 'filename:linenumber:'
CompilerSet errorformat+=%C%*\\s%m " Continuation of multiline error message is indented
CompilerSet errorformat+=%-G%.%# " All lines not matching any of the above patterns are ignored
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:ts=4:sw=4:et
endif

View File

@@ -24,7 +24,7 @@ CompilerSet errorformat=
\%f:%l:\ %tarning:\ %m, \%f:%l:\ %tarning:\ %m,
\%E%.%#:in\ `load':\ %f:%l:%m, \%E%.%#:in\ `load':\ %f:%l:%m,
\%E%f:%l:in\ `%*[^']':\ %m, \%E%f:%l:in\ `%*[^']':\ %m,
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#, \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#,
\%E\ \ %\\d%\\+)%.%#, \%E\ \ %\\d%\\+)%.%#,
\%C\ \ \ \ \ %m, \%C\ \ \ \ \ %m,
\%-G%.%# \%-G%.%#

View File

@@ -17,7 +17,7 @@ if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args> command -nargs=* CompilerSet setlocal <args>
endif endif
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1 if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
CompilerSet makeprg=rustc CompilerSet makeprg=rustc
else else
CompilerSet makeprg=rustc\ \% CompilerSet makeprg=rustc\ \%

View File

@@ -34,6 +34,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
autocmd BufRead,BufNewFile *.dart set filetype=dart
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
au BufNewFile,BufRead Dockerfile set filetype=dockerfile au BufNewFile,BufRead Dockerfile set filetype=dockerfile
@@ -54,6 +58,10 @@ function! s:DetectElixir()
endfunction endfunction
autocmd BufNewFile,BufRead * call s:DetectElixir() autocmd BufNewFile,BufRead * call s:DetectElixir()
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
au BufNewFile,BufRead *.elm set filetype=elm
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
autocmd BufNewFile,BufRead *.em set filetype=ember-script autocmd BufNewFile,BufRead *.em set filetype=ember-script
@@ -64,9 +72,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
autocmd BufNewFile,BufRead *.emblem set filetype=emblem autocmd BufNewFile,BufRead *.emblem set filetype=emblem
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
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 +97,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 +115,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
@@ -126,17 +142,45 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
au BufNewFile,BufRead *.js setf javascript if !exists('g:jsx_ext_required')
au BufNewFile,BufRead *.jsm setf javascript let g:jsx_ext_required = 1
au BufNewFile,BufRead Jakefile setf javascript endif
fun! s:SelectJavascript() if !exists('g:jsx_pragma_required')
if getline(1) =~# '^#!.*/bin/env\s\+node\>' let g:jsx_pragma_required = 0
set ft=javascript endif
endif if g:jsx_pragma_required
" Look for the @jsx pragma. It must be included in a docblock comment before
" anything else in the file (except whitespace).
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
endif
fu! <SID>EnableJSX()
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
return 1
endfu
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
autocmd BufNewFile,BufRead *.js
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
fun! s:SelectHTML()
let n = 1
while n < 50 && n <= line("$")
" check for jinja
if getline(n) =~ '{{.*}}\|{%-\?\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
set ft=jinja
return
endif
let n = n + 1
endwhile
endfun endfun
au BufNewFile,BufRead * call s:SelectJavascript() autocmd BufNewFile,BufRead *.html,*.htm,*.nunjucks,*.nunjs call s:SelectHTML()
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja set ft=jinja
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
@@ -156,6 +200,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
@@ -200,11 +249,14 @@ endif
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif au BufRead,BufNewFile *.nginx set ft=nginx
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
au BufRead,BufNewFile nginx.conf set ft=nginx
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
au BufRead,BufNewFile *.cl set filetype=opencl au! BufRead,BufNewFile *.cl set filetype=opencl
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
@@ -256,6 +308,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
au! BufRead,BufNewFile *.pp setfiletype puppet au! BufRead,BufNewFile *.pp setfiletype puppet
au! BufRead,BufNewFile Puppetfile setfiletype ruby au! BufRead,BufNewFile Puppetfile setfiletype ruby
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
autocmd BufRead,BufNewFile *.qml setfiletype qml
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
function! s:setf(filetype) abort function! s:setf(filetype) abort
@@ -285,6 +341,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
@@ -320,7 +378,17 @@ autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
autocmd BufNewFile,BufRead *.swift set filetype=swift autocmd BufNewFile,BufRead *.swift setfiletype swift
autocmd BufRead * call s:Swift()
function! s:Swift()
if !empty(&filetype)
return
endif
let line = getline(1)
if line =~ "^#!.*swift"
setfiletype swift
endif
endfunction
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
@@ -358,13 +426,17 @@ 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
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
au BufRead,BufNewFile *.vcl set filetype=vcl
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity

31
ftplugin/dart.vim Normal file
View File

@@ -0,0 +1,31 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
" Enable automatic indentation (2 spaces) if variable g:dart_style_guide is set
if exists('g:dart_style_guide')
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal formatoptions-=t
endif
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
setlocal commentstring=//%s
let s:win_sep = (has('win32') || has('win64')) ? '/' : ''
let &l:errorformat =
\ join([
\ ' %#''file://' . s:win_sep . '%f'': %s: line %l pos %c:%m',
\ '%m'
\ ], ',')
let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms<'
endif

86
ftplugin/elm.vim Normal file
View File

@@ -0,0 +1,86 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
" elm.vim - Plugin for the Elm programming language
" Maintainer: Alexander Noriega <http://lambdatoast.com/>
" Version: 0.4.3
" Plugin setup stuff
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
" Compilation
function! ElmMake(file)
let args = a:file
return elm#io#system("elm-make", args)
endfunction
function! ElmMakeCurrentFile()
echo ElmMake(expand("%"))
endfunction
function! ElmMakeMain()
echo ElmMake("Main.elm")
endfunction
function! ElmMakeFile(file)
echo ElmMake(a:file)
endfunction
" REPL
function! ElmRepl()
!elm-repl
endfunction
" Evaluation
function! ElmEvalLine()
return ElmEval(getline("."))
endfunction
function! ElmEvalSelection()
let savedReg = @z
normal! `<v`>"zy
let res = ElmEval(substitute(getreg("z"), "\n", "\\\n", "g"))
let @z = savedReg
normal! gv
endfunction
function! ElmEval(sourceCode)
let currentLine = a:sourceCode
let args = "echo '" . currentLine . "' | elm-repl"
let result = elm#io#system("echo", args)
let cleanResult = "-- " . join(s:Filtered(function("s:IsUsefulReplOutput"), split(result, "\n")), "")
put =cleanResult
endfunction
function! s:IsUsefulReplOutput(str)
return a:str !~ "^Elm REPL" && a:str !~ "Type :help" && a:str !~ ">\\s*$"
endfunction
" List processing
function! s:Filtered(fn, l)
let new_list = deepcopy(a:l)
call filter(new_list, string(a:fn) . '(v:val)')
return new_list
endfunction
command -buffer ElmEvalLine call ElmEvalLine()
command -buffer ElmEvalSelection call ElmEvalSelection()
command -buffer ElmMakeMain call ElmMakeMain()
command -buffer -nargs=1 ElmMakeFile call ElmMakeFile <args>
command -buffer ElmMakeCurrentFile call ElmMakeCurrentFile()
command -buffer ElmRepl call ElmRepl()
" Define comment convention
setlocal comments=:--
setlocal commentstring=--%s
endif

View File

@@ -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(\)\=["'']\='

10
ftplugin/objc.vim Normal file
View File

@@ -0,0 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
" Use C++ style comment strings with commentary.vim
setl commentstring=//%s
" Search for include files inside frameworks (used for gf etc.)
setl includeexpr=substitute(v:fname,'\\([^/]\\+\\)/\\(.\\+\\)','/System/Library/Frameworks/\\1.framework/Headers/\\2','')
endif

View File

@@ -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")

41
ftplugin/qml.vim Normal file
View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim filetype plugin file
" Language: qml
" Last change: 2014 Feb 8
if exists( 'b:did_ftplugin' )
finish
endif
let b:did_ftplugin = 1
let s:cpoptions_save = &cpoptions
set cpoptions&vim
" command for undo
let b:undo_ftplugin =
\ 'let b:browsefilter = "" | ' .
\ 'setlocal ' .
\ 'comments< '.
\ 'commentstring< ' .
\ 'formatoptions< ' .
\ 'indentexpr<'
if has( 'gui_win32' )
\ && !exists( 'b:browsefilter' )
let b:browsefilter =
\ 'qml files (*.qml)\t*.qml\n' .
\ 'All files (*.*)\t*.*\n'
endif
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
setlocal commentstring=//%s
setlocal formatoptions-=t
setlocal formatoptions+=croql
let &cpoptions = s:cpoptions_save
unlet s:cpoptions_save
endif

View File

@@ -46,7 +46,7 @@ endif
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','') setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','')
setlocal suffixesadd=.rb setlocal suffixesadd=.rb
if exists("&ofu") && has("ruby") if exists("&ofu") && has("ruby")
@@ -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'))
@@ -138,7 +138,7 @@ if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val.
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
endif endif
if has("gui_win32") && !exists("b:browsefilter") if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
endif endif
@@ -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>')
@@ -361,7 +361,7 @@ function! RubyCursorFile() abort
endtry endtry
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!') let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*') let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
let ext = getline('.') =~# '^\s*\%(require\|autoload\)\>' ? '.rb' : '' let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
if s:synname() ==# 'rubyConstant' if s:synname() ==# 'rubyConstant'
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','') let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
let cfile = substitute(cfile,'::','/','g') let cfile = substitute(cfile,'::','/','g')
@@ -369,7 +369,7 @@ function! RubyCursorFile() abort
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g') let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
return tolower(cfile) . '.rb' return tolower(cfile) . '.rb'
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$' elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . '.rb' let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$' elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1') let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
let cfile = expand('%:p:h') . target . ext let cfile = expand('%:p:h') . target . ext

View File

@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Description: Vim syntax file for Rust " Description: Vim syntax file for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info> " Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org> " Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: Jul 07, 2014 " Last Change: January 29, 2015
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -20,7 +20,7 @@ set cpo&vim
" comments, so we'll use that as our default, but make it easy to switch. " comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without " This does not affect indentation at all (I tested it with and without
" leader), merely whether a leader is inserted by default or not. " leader), merely whether a leader is inserted by default or not.
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1 if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why, " Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no " but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug. " leaders. I'm fairly sure that's a Vim bug.
@@ -37,7 +37,7 @@ silent! setlocal formatoptions+=j
" otherwise it's better than nothing. " otherwise it's better than nothing.
setlocal smartindent nocindent setlocal smartindent nocindent
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1 if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99 setlocal textwidth=99
endif endif
@@ -69,7 +69,7 @@ if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
endif endif
endif endif
if has('conceal') && exists('g:rust_conceal') if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
let b:rust_set_conceallevel=1 let b:rust_set_conceallevel=1
setlocal conceallevel=2 setlocal conceallevel=2
endif endif
@@ -84,19 +84,35 @@ xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR> onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR> onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" %-matching. <:> is handy for generics.
set matchpairs+=<:>
" There are two minor issues with it; (a) comparison operators in expressions,
" where a less-than may match a greater-than later on—this is deemed a trivial
" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the
" highlighting perspective (built into Vim), but the actual % functionality
" can be fixed by this use of matchit.vim.
let b:match_skip = 's:comment\|string\|rustArrow'
source $VIMRUNTIME/macros/matchit.vim
" Commands {{{1 " Commands {{{1
" See |:RustRun| for docs " See |:RustRun| for docs
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>]) command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
" See |:RustExpand| for docs " See |:RustExpand| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>]) command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
" See |:RustEmitIr| for docs " See |:RustEmitIr| for docs
command! -nargs=* -bar -buffer RustEmitIr call rust#Emit("ir", [<f-args>]) command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
" See |:RustEmitAsm| for docs " See |:RustEmitAsm| for docs
command! -nargs=* -bar -buffer RustEmitAsm call rust#Emit("asm", [<f-args>]) command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
" See |:RustPlay| for docs
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
" See |:RustFmt| for docs
command! -buffer RustFmt call rustfmt#Format()
" Mappings {{{1 " Mappings {{{1
@@ -134,6 +150,7 @@ let b:undo_ftplugin = "
\|delcommand RustExpand \|delcommand RustExpand
\|delcommand RustEmitIr \|delcommand RustEmitIr
\|delcommand RustEmitAsm \|delcommand RustEmitAsm
\|delcommand RustPlay
\|nunmap <buffer> <D-r> \|nunmap <buffer> <D-r>
\|nunmap <buffer> <D-R> \|nunmap <buffer> <D-R>
\|nunmap <buffer> [[ \|nunmap <buffer> [[
@@ -142,6 +159,8 @@ let b:undo_ftplugin = "
\|xunmap <buffer> ]] \|xunmap <buffer> ]]
\|ounmap <buffer> [[ \|ounmap <buffer> [[
\|ounmap <buffer> ]] \|ounmap <buffer> ]]
\|set matchpairs-=<:>
\|unlet b:match_skip
\" \"
" }}}1 " }}}1

8
ftplugin/swift.vim Normal file
View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
setlocal commentstring=//\ %s
" @-@ adds the literal @ to iskeyword for @IBAction and similar
setlocal iskeyword+=@-@,#
setlocal completefunc=syntaxcomplete#Complete
endif

13
indent/dart.vim Normal file
View File

@@ -0,0 +1,13 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
setlocal cindent
setlocal cinoptions+=j1,J1
let b:undo_indent = 'setl cin< cino<'
endif

129
indent/elm.vim Normal file
View File

@@ -0,0 +1,129 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
" Vim indent file
" Language: Haskell
" Maintainer: lilydjwg <lilydjwg@gmail.com>
" Version: 1.0
" References: http://en.wikibooks.org/wiki/Haskell/Indentation
" http://book.realworldhaskell.org/read/
" See Also: The Align plugin http://www.vim.org/scripts/script.php?script_id=294
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=HaskellIndent()
for i in split('0{,:,0#,e', ',')
exec "setlocal indentkeys-=" . i
endfor
setlocal indentkeys+=0=else,0=in,0=where,0),0<bar>
setlocal tabstop=8
setlocal expandtab
if !exists('g:Haskell_no_mapping')
inoremap <silent> <BS> <C-R>=<SID>HaskellDedent(1)<CR>
inoremap <silent> <C-D> <C-R>=<SID>HaskellDedent(0)<CR>
endif
" Only define the functions once.
if exists("*HaskellIndent")
finish
endif
let s:align_map = {
\ 'in': '\<let\>',
\ '\<else\>': '\<then\>',
\ ',': '\v%(\s|\w|^)@<=[[{]%(\s|\w|"|$)@='
\ }
let s:indent_self = ['=']
let s:indent_next = ['let', 'in', 'where', 'do', 'if']
let s:indent_if_final = ['=', 'do', '->', 'of', 'where']
function HaskellIndent()
let lnum = v:lnum - 1
" Hit the start of the file, use zero indent.
if lnum == 0
return 0
endif
let ind = indent(lnum)
let prevline = getline(lnum)
let curline = getline(v:lnum)
let curwords = split(curline)
if len(curwords) > 0
if has_key(s:align_map, curwords[0])
let word = s:align_map[curwords[0]]
let m = -1
let line = v:lnum
while m == -1
let line -= 1
if line <= 0
return -1
endif
let m = match(getline(line), word)
endwhile
return m
elseif index(s:indent_self, curwords[0]) != -1
return ind + &sw
elseif curwords[0] == '|'
return match(prevline, '\v%(\s|\w|^)@<=[|=]%(\s|\w)@=')
elseif index([')', '}'], curwords[0]) != -1
return ind - &sw
elseif curwords[0] == 'where'
if prevline =~ '\v^\s+\|%(\s|\w)@='
return ind - 1
endif
endif
endif
let prevwords = split(prevline)
if len(prevwords) == 0
return 0
endif
if prevwords[-1] == 'where' && prevwords[0] == 'module'
return 0
elseif index(s:indent_if_final, prevwords[-1]) != -1
return ind + &sw
elseif prevwords[-1] =~ '\v%(\s|\w|^)@<=[[{(]$'
return ind + &sw
else
for word in reverse(prevwords)
if index(s:indent_next, word) != -1
return match(prevline, '\<'.word.'\>') + len(word) + 1
endif
endfor
endif
if len(curwords) > 0 && curwords[0] == 'where'
return ind + &sw
endif
return ind
endfunction
function s:HaskellDedent(isbs)
if a:isbs && strpart(getline('.'), 0, col('.')-1) !~ '^\s\+$'
return "\<BS>"
endif
let curind = indent('.')
let line = line('.') - 1
while curind > 0 && line > 0
let ind = indent(line)
if ind >= curind
let line -= 1
else
echomsg curind ind
call setline('.', repeat(' ', ind) .
\ substitute(getline('.'), '^\s\+', '', ''))
return ''
endif
endwhile
return a:isbs ? "\<BS>" : ''
endfunction
endif

14
indent/glsl.vim Normal file
View 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

104
indent/handlebars.vim Normal file
View File

@@ -0,0 +1,104 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
" Mustache & Handlebars syntax
" Language: Mustache, Handlebars
" Maintainer: Juvenn Woo <machese@gmail.com>
" Screenshot: http://imgur.com/6F408
" Version: 2
" Last Change: Oct 10th 2015
" Remarks: based on eruby indent plugin by tpope
" References:
" [Mustache](http://github.com/defunkt/mustache)
" [Handlebars](https://github.com/wycats/handlebars.js)
" [ctemplate](http://code.google.com/p/google-ctemplate/)
" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html)
" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html)
if exists("b:did_indent_hbs")
finish
endif
unlet! b:did_indent
setlocal indentexpr=
runtime! indent/html.vim
unlet! b:did_indent
" Force HTML indent to not keep state.
let b:html_indent_usestate = 0
if &l:indentexpr == ''
if &l:cindent
let &l:indentexpr = 'cindent(v:lnum)'
else
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
endif
endif
let b:handlebars_subtype_indentexpr = &l:indentexpr
let b:did_indent = 1
let b:did_indent_hbs = 1
setlocal indentexpr=GetHandlebarsIndent()
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
" Only define the function once.
if exists("*GetHandlebarsIndent")
finish
endif
function! GetHandlebarsIndent(...)
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
if a:0 && a:1 == '.'
let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d'
let v:lnum = a:1
endif
let vcol = col('.')
call cursor(v:lnum,1)
call cursor(v:lnum,vcol)
exe "let ind = ".b:handlebars_subtype_indentexpr
" Workaround for Andy Wokula's HTML indent. This should be removed after
" some time, since the newest version is fixed in a different way.
if b:handlebars_subtype_indentexpr =~# '^HtmlIndent('
\ && exists('b:indent')
\ && type(b:indent) == type({})
\ && has_key(b:indent, 'lnum')
" Force HTML indent to not keep state
let b:indent.lnum = -1
endif
let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum)
let cline = getline(v:lnum)
" all indent rules only apply if the block opening/closing
" tag is on a separate line
" indent after block {{#block
if line =~# '\v\s*\{\{\#.*\s*'
let ind = ind + sw
endif
" unindent after block close {{/block}}
if cline =~# '\v^\s*\{\{\/\S*\}\}\s*'
let ind = ind - sw
endif
" unindent {{else}}
if cline =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind - sw
endif
" indent again after {{else}}
if line =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind + sw
endif
return ind
endfunction
endif

View File

@@ -65,6 +65,15 @@ function! GetHaskellIndent()
return match(l:prevline, '\S') return match(l:prevline, '\S')
endif endif
if synIDattr(synID(line("."), col("."), 1), "name") == 'haskellBlockComment'
for l:c in range(v:lnum - 1, 0, -1)
let l:bline = getline(l:c)
if l:bline =~ '{-'
return 1 + match(l:bline, '{-')
endfor
return 1
endif
if l:prevline =~ '^\s*$' if l:prevline =~ '^\s*$'
return 0 return 0
endif endif

16
indent/jinja.vim Normal file
View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
" Vim indent file
" Language: Jinja HTML template
" Maintainer: Evan Hammer <evan@evanhammer.com>
" Last Change: 2013 Jan 26
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Use HTML formatting rules.
runtime! indent/html.vim
endif

54
indent/kotlin.vim Normal file
View 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

15
indent/nginx.vim Normal file
View File

@@ -0,0 +1,15 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=
" cindent actually works for nginx' simple file structure
setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#
endif

63
indent/qml.vim Normal file
View File

@@ -0,0 +1,63 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim indent file
" Language: QML
" Author: Robert Kieffer
" URL:
" Last Change: 2010-03-27 (Happy Birthday, Dash!)
"
" Improved JavaScript indent script.
" Indent script in place for this already?
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetJsIndent()
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=*/
" Only define functions once per session
if exists("*GetJsIndent")
finish
endif
" Clean up a line of code by removing trailing '//' comments, and trimming
" whitespace
function! Trim(line)
return substitute(substitute(a:line, '// .*', '', ''), '^\s*\|\s*$', '', 'g')
endfunction
function! GetJsIndent()
let num = v:lnum
let line = Trim(getline(num))
let pnum = prevnonblank(num - 1)
if pnum == 0
return 0
endif
let pline = Trim(getline(pnum))
let ind = indent(pnum)
" bracket/brace/paren blocks
if pline =~ '[{[(]$'
let ind += &sw
endif
if line =~ '^[}\])]'
let ind -= &sw
endif
" '/*' comments
if pline =~ '^/\*.*\*/'
" no indent for single-line form
elseif pline =~ '^/\*'
let ind += 1
elseif pline =~ '^\*/'
let ind -= 1
endif
return ind
endfunction
endif

View File

@@ -123,6 +123,13 @@ function GetRustIndent(lnum)
let prevlinenum = prevnonblank(prevlinenum - 1) let prevlinenum = prevnonblank(prevlinenum - 1)
let prevline = s:get_line_trimmed(prevlinenum) let prevline = s:get_line_trimmed(prevlinenum)
endwhile endwhile
" Handle where clauses nicely: subsequent values should line up nicely.
if prevline[len(prevline) - 1] == ","
\ && prevline =~# '^\s*where\s'
return indent(prevlinenum) + 6
endif
if prevline[len(prevline) - 1] == "," if prevline[len(prevline) - 1] == ","
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]' \ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
\ && prevline !~ '^\s*fn\s' \ && prevline !~ '^\s*fn\s'

View File

@@ -119,7 +119,7 @@ function! GetStylusIndent()
" if group !~? 'css.*' && line =~? ')\s*$' " match user functions " if group !~? 'css.*' && line =~? ')\s*$' " match user functions
" return increase " return increase
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudoClass|cssPseudoClassId|stylusId|stylusClass)$' if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudo|stylusId|stylusClass)$'
return increase return increase
elseif (group == 'stylusUserFunction') && (indent(lnum) == '0') " mixin definition elseif (group == 'stylusUserFunction') && (indent(lnum) == '0') " mixin definition
return increase return increase

View File

@@ -1,19 +1,230 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
" Language: Swift<https://developer.apple.com/swift/> " File: swift.vim
" Maintainer: toyama satoshi <toyamarinyon@gmail.com> " Author: Keith Smiley
" URL: http://github.com/toyamarinyon/vim-swift " Description: The indent file for Swift
" License: GPL " Last Modified: December 05, 2014
" Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
let b:did_indent = 1 let b:did_indent = 1
" C indenting is built-in, thus this is very simple let s:cpo_save = &cpo
setlocal cindent set cpo&vim
let b:undo_indent = "setl cin<" setlocal nosmartindent
setlocal indentkeys-=:
setlocal indentkeys-=e
setlocal indentkeys+=0]
setlocal indentexpr=SwiftIndent()
function! s:NumberOfMatches(char, string, index)
let instances = 0
let i = 0
while i < strlen(a:string)
if a:string[i] == a:char && !s:IsExcludedFromIndentAtPosition(a:index, i + 1)
let instances += 1
endif
let i += 1
endwhile
return instances
endfunction
function! s:SyntaxNameAtPosition(line, column)
return synIDattr(synID(a:line, a:column, 0), "name")
endfunction
function! s:SyntaxName()
return s:SyntaxNameAtPosition(line("."), col("."))
endfunction
function! s:IsExcludedFromIndentAtPosition(line, column)
let name = s:SyntaxNameAtPosition(a:line, a:column)
return name ==# "swiftComment" || name ==# "swiftString"
endfunction
function! s:IsExcludedFromIndent()
return s:SyntaxName() ==# "swiftComment" || s:SyntaxName() ==# "swiftString"
endfunction
function! s:IsCommentLine(lnum)
return synIDattr(synID(a:lnum,
\ match(getline(a:lnum), "\S") + 1, 0), "name")
\ ==# "swiftComment"
endfunction
function! SwiftIndent(...)
let clnum = a:0 ? a:1 : v:lnum
let line = getline(clnum)
let previousNum = prevnonblank(clnum - 1)
while s:IsCommentLine(previousNum) != 0
let previousNum = prevnonblank(previousNum - 1)
endwhile
let previous = getline(previousNum)
let cindent = cindent(clnum)
let previousIndent = indent(previousNum)
let numOpenParens = s:NumberOfMatches("(", previous, previousNum)
let numCloseParens = s:NumberOfMatches(")", previous, previousNum)
let numOpenBrackets = s:NumberOfMatches("{", previous, previousNum)
let numCloseBrackets = s:NumberOfMatches("}", previous, previousNum)
let currentOpenBrackets = s:NumberOfMatches("{", line, clnum)
let currentCloseBrackets = s:NumberOfMatches("}", line, clnum)
let numOpenSquare = s:NumberOfMatches("[", previous, previousNum)
let numCloseSquare = s:NumberOfMatches("]", previous, previousNum)
let currentCloseSquare = s:NumberOfMatches("]", line, clnum)
if numOpenSquare > numCloseSquare && currentCloseSquare < 1
return previousIndent + shiftwidth()
endif
if currentCloseSquare > 0 && line !~ '\v\[.*\]'
let column = col(".")
call cursor(line("."), 1)
let openingSquare = searchpair("\\[", "", "\\]", "bWn", "s:IsExcludedFromIndent()")
call cursor(line("."), column)
if openingSquare == 0
return -1
endif
return indent(openingSquare)
endif
if s:IsExcludedFromIndent()
return previousIndent
endif
if line =~ ":$"
let switch = search("switch", "bWn")
return indent(switch)
elseif previous =~ ":$"
return previousIndent + shiftwidth()
endif
if numOpenParens == numCloseParens
if numOpenBrackets > numCloseBrackets
if currentCloseBrackets > currentOpenBrackets || line =~ "\\v^\\s*}"
let column = col(".")
call cursor(line("."), 1)
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
call cursor(line("."), column)
if openingBracket == 0
return -1
else
return indent(openingBracket)
endif
endif
return previousIndent + shiftwidth()
elseif previous =~ "}.*{"
if line =~ "\\v^\\s*}"
return previousIndent
endif
return previousIndent + shiftwidth()
elseif line =~ "}.*{"
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
return indent(openingBracket)
elseif currentCloseBrackets > currentOpenBrackets
let column = col(".")
call cursor(line("."), 1)
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
call cursor(line("."), column)
let bracketLine = getline(openingBracket)
let numOpenParensBracketLine = s:NumberOfMatches("(", bracketLine, openingBracket)
let numCloseParensBracketLine = s:NumberOfMatches(")", bracketLine, openingBracket)
if numCloseParensBracketLine > numOpenParensBracketLine
let line = line(".")
let column = col(".")
call cursor(openingParen, column)
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
call cursor(line, column)
return indent(openingParen)
endif
return indent(openingBracket)
else
return -1
endif
endif
if numCloseParens > 0
if currentOpenBrackets > 0 || currentCloseBrackets > 0
if currentOpenBrackets > 0
if numOpenBrackets > numCloseBrackets
return previousIndent + shiftwidth()
endif
if line =~ "}.*{"
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
return indent(openingBracket)
endif
if numCloseParens > numOpenParens
let line = line(".")
let column = col(".")
call cursor(line - 1, column)
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
call cursor(line, column)
return indent(openingParen)
endif
return previousIndent
endif
if currentCloseBrackets > 0
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
return indent(openingBracket)
endif
return cindent
endif
if numCloseParens < numOpenParens
if numOpenBrackets > numCloseBrackets
return previousIndent + shiftwidth()
endif
let previousParen = match(previous, "(")
return previousParen + 1
endif
if numOpenBrackets > numCloseBrackets
let line = line(".")
let column = col(".")
call cursor(previousNum, column)
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
call cursor(line, column)
return indent(openingParen) + shiftwidth()
endif
let line = line(".")
let column = col(".")
call cursor(previousNum, column)
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
call cursor(line, column)
return indent(openingParen)
endif
if numOpenParens > 0
let previousParen = match(previous, "(")
return previousParen + 1
endif
return cindent
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
endif endif

View File

@@ -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

View File

@@ -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

View File

@@ -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
@@ -25,7 +25,8 @@ endif
" C++ extensions " C++ extensions
syn keyword cppStatement new delete this friend using syn keyword cppStatement new delete this friend using
syn keyword cppAccess public protected private syn keyword cppAccess public protected private
syn keyword cppType inline virtual explicit export bool wchar_t syn keyword cppModifier inline virtual explicit export
syn keyword cppType bool wchar_t
syn keyword cppExceptions throw try catch syn keyword cppExceptions throw try catch
syn keyword cppOperator operator typeid syn keyword cppOperator operator typeid
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
@@ -38,7 +39,8 @@ syn keyword cppConstant __cplusplus
" C++ 11 extensions " C++ 11 extensions
if !exists("cpp_no_cpp11") if !exists("cpp_no_cpp11")
syn keyword cppType override final syn keyword cppModifier override final
syn keyword cppType nullptr_t
syn keyword cppExceptions noexcept syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype thread_local syn keyword cppStorageClass constexpr decltype thread_local
syn keyword cppConstant nullptr syn keyword cppConstant nullptr
@@ -51,6 +53,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 "[<>]?"
@@ -67,6 +74,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppExceptions Exception HiLink cppExceptions Exception
HiLink cppOperator Operator HiLink cppOperator Operator
HiLink cppStatement Statement HiLink cppStatement Statement
HiLink cppModifier Type
HiLink cppType Type HiLink cppType Type
HiLink cppStorageClass StorageClass HiLink cppStorageClass StorageClass
HiLink cppStructure Structure HiLink cppStructure Structure
@@ -74,6 +82,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

View File

@@ -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

110
syntax/dart.vim Normal file
View File

@@ -0,0 +1,110 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
" Vim syntax file " Language: Dart
" Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
" for details. All rights reserved. Use of this source code is governed by a
" BSD-style license that can be found in the LICENSE file.
if !exists("g:main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let g:main_syntax = 'dart'
syntax region dartFold start="{" end="}" transparent fold
endif
" Ensure long multiline strings are highlighted.
syntax sync fromstart
" keyword definitions
syntax keyword dartConditional if else switch
syntax keyword dartRepeat do while for
syntax keyword dartBoolean true false
syntax keyword dartConstant null
syntax keyword dartTypedef this super class typedef
syntax keyword dartOperator new is as in factory
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
syntax keyword dartType void var bool int double num dynamic
syntax keyword dartStatement return
syntax keyword dartStorageClass static abstract final const
syntax keyword dartExceptions throw rethrow try on catch finally
syntax keyword dartAssert assert
syntax keyword dartClassDecl extends with implements
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
syntax keyword dartKeyword get set operator call external async await yield sync
syntax match dartUserLabelRef "\k\+" contained
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
syntax keyword dartLabel default
syntax match dartLibrary "^\(import\|part of\|part\|export\|library\|show\|hide\)\s"
" Comments
syntax keyword dartTodo contained TODO FIXME XXX
syntax region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLink,@Spell
syntax match dartLineComment "//.*" contains=dartTodo,@Spell
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
syntax region dartDocLink contained start=+\[+ end=+\]+
" Strings
syntax region dartString start=+\z(["']\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar
syntax region dartRawString start=+r\z(["']\)+ end=+\z1+ contains=@Spell
syntax region dartMultilineString start=+\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar
syntax region dartRawMultilineString start=+r\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell
syntax match dartInterpolation contained "\$\(\w\+\|{[^}]\+}\)"
syntax match dartSpecialChar contained "\\\(u\x\{4\}\|u{\x\+}\|x\x\x\|x{\x\+}\|.\)"
" Numbers
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
" TODO(antonm): consider conditional highlighting of corelib classes.
syntax keyword dartCoreClasses BidirectionalIterator Comparable DateTime Duration Expando Function Invocation Iterable Iterator List Map Match Object Pattern RegExp RuneIterator Runes Set StackTrace Stopwatch String StringBuffer StringSink Symbol Type
syntax keyword dartCoreTypedefs Comparator
syntax keyword dartCoreExceptions AbstractClassInstantiationError ArgumentError AssertionError CastError ConcurrentModificationError Error Exception FallThroughError FormatException IntegerDivisionByZeroException NoSuchMethodError NullThrownError OutOfMemoryError RangeError RuntimeError StackOverflowError StateError TypeError UnimplementedError UnsupportedError
" The default highlighting.
highlight default link dartBranch Conditional
highlight default link dartUserLabelRef dartUserLabel
highlight default link dartLabel Label
highlight default link dartUserLabel Label
highlight default link dartConditional Conditional
highlight default link dartRepeat Repeat
highlight default link dartExceptions Exception
highlight default link dartAssert Statement
highlight default link dartStorageClass StorageClass
highlight default link dartClassDecl dartStorageClass
highlight default link dartBoolean Boolean
highlight default link dartString String
highlight default link dartRawString String
highlight default link dartMultilineString String
highlight default link dartRawMultilineString String
highlight default link dartNumber Number
highlight default link dartStatement Statement
highlight default link dartOperator Operator
highlight default link dartComment Comment
highlight default link dartLineComment Comment
highlight default link dartLineDocComment Comment
highlight default link dartConstant Constant
highlight default link dartTypedef Typedef
highlight default link dartTodo Todo
highlight default link dartKeyword Keyword
highlight default link dartType Type
highlight default link dartInterpolation PreProc
highlight default link dartDocLink SpecialComment
highlight default link dartSpecialChar SpecialChar
highlight default link dartLibrary Include
highlight default link dartCoreClasses Type
highlight default link dartCoreTypedefs Typedef
highlight default link dartCoreExceptions Exception
let b:current_syntax = "dart"
let b:spell_options = "contained"
if g:main_syntax is# 'dart'
unlet g:main_syntax
endif
endif

View File

@@ -17,7 +17,7 @@ syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@el
syn match elixirComment '#.*' contains=elixirTodo syn match elixirComment '#.*' contains=elixirTodo
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
syn keyword elixirKeyword case when cond for if unless try receive send syn keyword elixirKeyword case when cond for if unless try receive spawn send
syn keyword elixirKeyword exit raise throw after rescue catch else do end syn keyword elixirKeyword exit raise throw after rescue catch else do end
syn keyword elixirKeyword quote unquote super syn keyword elixirKeyword quote unquote super

81
syntax/elm.vim Normal file
View File

@@ -0,0 +1,81 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
" Vim syntax file
" Language: Elm (http://elm-lang.org/)
" Maintainer: Alexander Noriega
" Latest Revision: 19 April 2015
if exists("b:current_syntax")
finish
endif
" Keywords
syn keyword elmKeyword alias as case else exposing if import in let module of port then type where
" Builtin operators
syn match elmBuiltinOp "\~"
syn match elmBuiltinOp "||"
syn match elmBuiltinOp "|>"
syn match elmBuiltinOp "|"
syn match elmBuiltinOp "`"
syn match elmBuiltinOp "\^"
syn match elmBuiltinOp "\\"
syn match elmBuiltinOp ">>"
syn match elmBuiltinOp ">="
syn match elmBuiltinOp ">"
syn match elmBuiltinOp "=="
syn match elmBuiltinOp "="
syn match elmBuiltinOp "<\~"
syn match elmBuiltinOp "<|"
syn match elmBuiltinOp "<="
syn match elmBuiltinOp "<<"
syn match elmBuiltinOp "<-"
syn match elmBuiltinOp "<"
syn match elmBuiltinOp "::"
syn match elmBuiltinOp ":"
syn match elmBuiltinOp "/="
syn match elmBuiltinOp "//"
syn match elmBuiltinOp "/"
syn match elmBuiltinOp "\.\."
syn match elmBuiltinOp "\."
syn match elmBuiltinOp "->"
syn match elmBuiltinOp "-"
syn match elmBuiltinOp "++"
syn match elmBuiltinOp "+"
syn match elmBuiltinOp "*"
syn match elmBuiltinOp "&&"
syn match elmBuiltinOp "%"
" Special names
syntax match specialName "^main "
" Comments
syn match elmTodo "[tT][oO][dD][oO]\|FIXME\|XXX" contained
syn match elmLineComment "--.*" contains=elmTodo,@spell
syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell
" String literals
syn region elmString start="\"" skip="\\\"" end="\"" contains=elmStringEscape
syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained
syn match elmStringEscape "\\[nrfvbt\\\"]" contained
" Number literals
syn match elmNumber "\(\<\d\+\>\)"
syn match elmNumber "\(\<\d\+\.\d\+\>\)"
" Types
syn match elmType "\<[A-Z][0-9A-Za-z_'-]*"
let b:current_syntax = "elm"
hi def link elmKeyword Keyword
hi def link elmBuiltinOp Special
hi def link elmType Type
hi def link elmTodo Todo
hi def link elmLineComment Comment
hi def link elmComment Comment
hi def link elmString String
hi def link elmNumber Number
hi def link specialName Special
endif

View File

@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
" Language: git rebase --interactive " Language: git rebase --interactive
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: git-rebase-todo " Filenames: git-rebase-todo
" Last Change: 2012 April 7 " Last Change: 2015 November 21
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -20,6 +20,7 @@ syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
syn match gitrebaseCommand ".*" contained syn match gitrebaseCommand ".*" contained
syn match gitrebaseComment "^#.*" contains=gitrebaseHash syn match gitrebaseComment "^#.*" contains=gitrebaseHash

660
syntax/glsl.vim Normal file
View 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

View File

@@ -12,7 +12,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" let OPTION_NAME = 0 " let OPTION_NAME = 0
" in your ~/.vimrc file to disable particular options. You can also write: " in your ~/.vimrc file to disable particular options. You can also write:
" let OPTION_NAME = 1 " let OPTION_NAME = 1
" to enable particular options. " to enable particular options.
" At present, all options default to on, except highlight of: " At present, all options default to on, except highlight of:
" functions, methods and structs. " functions, methods and structs.
" "
@@ -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")
@@ -54,23 +56,27 @@ if !exists("g:go_highlight_trailing_whitespace_error")
endif endif
if !exists("g:go_highlight_operators") if !exists("g:go_highlight_operators")
let g:go_highlight_operators = 0 let g:go_highlight_operators = 0
endif endif
if !exists("g:go_highlight_functions") if !exists("g:go_highlight_functions")
let g:go_highlight_functions = 0 let g:go_highlight_functions = 0
endif endif
if !exists("g:go_highlight_methods") if !exists("g:go_highlight_methods")
let g:go_highlight_methods = 0 let g:go_highlight_methods = 0
endif endif
if !exists("g:go_highlight_structs") if !exists("g:go_highlight_structs")
let g:go_highlight_structs = 0 let g:go_highlight_structs = 0
endif endif
if !exists("g:go_highlight_build_constraints") if !exists("g:go_highlight_build_constraints")
let g:go_highlight_build_constraints = 0 let g:go_highlight_build_constraints = 0
endif
if !exists("g:go_highlight_string_spellcheck")
let g:go_highlight_string_spellcheck = 1
endif endif
syn case match syn case match
@@ -113,8 +119,8 @@ syn match goDeclaration /\<func\>/
" Predefined functions and values " Predefined functions and values
syn keyword goBuiltins append cap close complex copy delete imag len syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
syn keyword goBuiltins make new panic print println real recover syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/
syn keyword goBoolean iota true false nil syn keyword goBoolean iota true false nil
hi def link goBuiltins Keyword hi def link goBuiltins Keyword
@@ -147,13 +153,18 @@ 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
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup if g:go_highlight_string_spellcheck != 0
syn region goRawString start=+`+ end=+`+ 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 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
hi def link goRawString String hi def link goRawString String
hi def link goFormatSpecifier goSpecialString hi def link goFormatSpecifier goSpecialString
" Characters; their contents " Characters; their contents
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
@@ -236,57 +247,76 @@ syn keyword goTodo contained NOTE
hi def link goTodo Todo hi def link goTodo Todo
" Operators; " Operators;
if g:go_highlight_operators != 0 if g:go_highlight_operators != 0
" match single-char operators: - + % < > ! & | ^ * = " match single-char operators: - + % < > ! & | ^ * =
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= == " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
syn match goOperator /[-+%<>!&|^*=]=\?/ syn match goOperator /[-+%<>!&|^*=]=\?/
" match / and /= " match / and /=
syn match goOperator /\/\%(=\|\ze[^/*]\)/ syn match goOperator /\/\%(=\|\ze[^/*]\)/
" match two-char operators: << >> &^ " match two-char operators: << >> &^
" and corresponding three-char operators: <<= >>= &^= " and corresponding three-char operators: <<= >>= &^=
syn match goOperator /\%(<<\|>>\|&^\)=\?/ syn match goOperator /\%(<<\|>>\|&^\)=\?/
" match remaining two-char operators: := && || <- ++ -- " match remaining two-char operators: := && || <- ++ --
syn match goOperator /:=\|||\|<-\|++\|--/ syn match goOperator /:=\|||\|<-\|++\|--/
" match ... " match ...
syn match goOperator /\.\.\./ syn match goOperator /\.\.\./
endif endif
hi def link goOperator Operator hi def link goOperator Operator
" Functions; " Functions;
if g:go_highlight_functions != 0 if g:go_highlight_functions != 0
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/ syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/ syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
endif endif
hi def link goFunction Function hi def link goFunction Function
" Methods; " Methods;
if g:go_highlight_methods != 0 if g:go_highlight_methods != 0
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/ syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
endif endif
hi def link goMethod Type hi def link goMethod Type
" Structs; " Structs;
if g:go_highlight_structs != 0 if g:go_highlight_structs != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/ syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/ syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
endif endif
hi def link goStruct Function hi def link goStruct Function
hi def link goStructDef Function hi def link goStructDef Function
" Build Constraints " Build Constraints
if g:go_highlight_build_constraints != 0 if g:go_highlight_build_constraints != 0
syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows syn match goBuildKeyword display contained "+build"
syn keyword goBuildArch contained 386 amd64 amd64p32 arm " Highlight the known values of GOOS, GOARCH, and other +build options.
syn match goBuildDirective display contained "+build" syn keyword goBuildDirectives contained
syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
endif \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
\ s390 s390x sparc sparc64 cgo ignore race
hi def link goBuildComment Comment " Other words in the build directive are build tags not listed above, so
hi def link goBuildOs Type " avoid highlighting them as comments by using a matchgroup just for the
hi def link goBuildArch Type " start of the comment.
hi def link goBuildDirective PreProc " The rs=s+2 option lets the \s*+build portion be part of the inner region
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
syn region goBuildComment matchgroup=goBuildCommentStart
\ start="//\s*+build\s"rs=s+2 end="$"
\ contains=goBuildKeyword,goBuildDirectives
hi def link goBuildCommentStart Comment
hi def link goBuildDirectives Type
hi def link goBuildKeyword PreProc
" One or more line comments that are followed immediately by a "package"
" declaration are treated like package documentation, so these must be
" matched as comments to avoid looking like working build constraints.
" The he, me, and re options let the "package" itself be highlighted by
" the usual rules.
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
\ contains=@goCommentGroup,@Spell
hi def link goPackageComment Comment
endif
" Search backwards for a global declaration to start processing the syntax. " Search backwards for a global declaration to start processing the syntax.

View File

@@ -39,7 +39,7 @@ hi def link goRawString String
" Characters; their contents " Characters; their contents
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
hi def link goCharacter Character hi def link goCharacter Character
@@ -67,8 +67,8 @@ hi def link goImaginary Number
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary
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 /\$[a-zA-Z0-9_]*\>/
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
View 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

View File

@@ -13,101 +13,26 @@ elseif exists("b:current_syntax")
finish finish
endif endif
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1 syn match haskellRecordField contained containedin=haskellBlock
syn region haskellRecordBlock matchgroup=haskellDelimiter start="{" end="}" \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
\ 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= \ contains=
\ haskellIdentifier, \ haskellIdentifier,
\ haskellOperators \ haskellOperators,
syn match haskellTopLevelDecl \ haskellSeparator,
\ haskellParens,
syn match haskellTypeSig
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" \ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
\ contains= \ contains=
\ haskellWhere,
\ haskellLet,
\ haskellIdentifier, \ haskellIdentifier,
\ haskellOperators, \ haskellOperators,
\ haskellSeparator, \ haskellSeparator,
\ haskellParens, \ haskellParens,
\ haskellBrackets, syn keyword haskelLWhere where
\ haskellWhere, syn keyword haskellLet let
\ haskellLet, syn keyword haskellDeclKeyword module class instance newtype deriving in
\ haskellDefault syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
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 haskellDefault default
syn keyword haskellImportKeywords import qualified safe as hiding contained syn keyword haskellImportKeywords import qualified safe as hiding contained
syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained
@@ -117,19 +42,16 @@ syn region haskellForeignImport start="\<foreign\>" end="::" keepend
\ haskellOperators, \ haskellOperators,
\ haskellForeignKeywords, \ haskellForeignKeywords,
\ haskellIdentifier \ haskellIdentifier
syn region haskellImport syn match haskellImport "^\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+\)\?.\+\(\s\+\<as\>\s\+.\+\)\?\(\s\+\<hiding\>\)\?"
\ start="^import"
\ end="^\<"
\ contains= \ contains=
\ haskellParens,
\ haskellOperators,
\ haskellImportKeywords, \ haskellImportKeywords,
\ haskellImportList,
\ haskellType, \ haskellType,
\ haskellLineComment, \ haskellLineComment,
\ haskellBlockComment, \ haskellBlockComment,
\ haskellDot \ haskellPragma,
syn keyword haskellStatement do case of in syn keyword haskellStatement do case of
syn keyword haskellWhere where
syn keyword haskellLet let
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1 if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
syn keyword haskellStatic static syn keyword haskellStatic static
endif endif
@@ -137,12 +59,12 @@ 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 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 haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
syn match haskellSeparator "[,;]" syn match haskellSeparator "[,;]"
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP
syn keyword haskellInfix infix infixl infixr syn keyword haskellInfix infix infixl infixr
syn keyword haskellBottom undefined error syn keyword haskellBottom undefined error
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>" syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
syn match haskellQuote "\<'\+" contained syn match haskellQuote "\<'\+" contained
syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained
syn region haskellQuoted start="\<'\+" end="\>" syn region haskellQuoted start="\<'\+" end="\>"
@@ -154,7 +76,6 @@ syn region haskellQuoted start="\<'\+" end="\>"
\ haskellParens, \ haskellParens,
\ haskellOperators, \ haskellOperators,
\ haskellIdentifier \ haskellIdentifier
syn match haskellDot "\."
syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
\ contains= \ contains=
\ haskellTodo, \ haskellTodo,
@@ -164,22 +85,24 @@ syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
\ contains=@Spell \ contains=@Spell
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>" syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>\n\?\s*" syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>"
\ nextgroup=haskellBlockComment,haskellRecordBlock
syn region haskellBlockComment start="{-" end="-}" syn region haskellBlockComment start="{-" end="-}"
\ contains= \ contains=
\ haskellBlockComment, \ haskellBlockComment,
\ haskellTodo, \ haskellTodo,
\ @Spell \ @Spell
syn region haskellPragma start="{-#" end="#-}" syn region haskellPragma start="{-#" end="#-}"
syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-z][a-zA-z0-9_']*|" 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 haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
syn match haskellPreProc "^#.*$" syn match haskellPreProc "^#.*$"
syn keyword haskellTodo TODO FIXME contained syn keyword haskellTodo TODO FIXME contained
" Treat a shebang line at the start of the file as a comment
syn match haskellShebang "\%^#!.*$"
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1 if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
syn keyword haskellTypeRoles phantom representational nominal contained syn keyword haskellTypeRoles phantom representational nominal contained
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="^\<" keepend syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend
\ contains= \ contains=
\ haskellType, \ haskellType,
\ haskellTypeRoles \ haskellTypeRoles
@@ -194,12 +117,7 @@ if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
syn keyword haskellArrowSyntax proc syn keyword haskellArrowSyntax proc
endif endif
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1 if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
syn region haskellPatternSynonym start="^\<pattern\>" end="=\|<-" keepend syn keyword haskellPatternKeyword pattern
\ contains=
\ haskellPatternKeyword,
\ haskellType,
\ haskellOperators
syn keyword haskellPatternKeyword pattern contained
endif endif
highlight def link haskellBottom Macro highlight def link haskellBottom Macro
@@ -209,8 +127,6 @@ highlight def link haskellIdentifier Identifier
highlight def link haskellForeignKeywords Structure highlight def link haskellForeignKeywords Structure
highlight def link haskellDeriving Structure highlight def link haskellDeriving Structure
highlight def link haskellStatement Statement highlight def link haskellStatement Statement
highlight def link haskellWhere Statement
highlight def link haskellLet Statement
highlight def link haskellDefault Statement highlight def link haskellDefault Statement
highlight def link haskellConditional Conditional highlight def link haskellConditional Conditional
highlight def link haskellNumber Number highlight def link haskellNumber Number
@@ -221,8 +137,8 @@ highlight def link haskellInfix PreProc
highlight def link haskellOperators Operator highlight def link haskellOperators Operator
highlight def link haskellQuote Operator highlight def link haskellQuote Operator
highlight def link haskellQuotedType Include highlight def link haskellQuotedType Include
highlight def link haskellDot Operator
highlight def link haskellType Include highlight def link haskellType Include
highlight def link haskellShebang Comment
highlight def link haskellLineComment Comment highlight def link haskellLineComment Comment
highlight def link haskellBlockComment Comment highlight def link haskellBlockComment Comment
highlight def link haskellPragma SpecialComment highlight def link haskellPragma SpecialComment
@@ -235,6 +151,10 @@ highlight def link haskellAssocType Structure
highlight def link haskellImportBlock Delimiter highlight def link haskellImportBlock Delimiter
highlight def link haskellImportKeywords Structure highlight def link haskellImportKeywords Structure
highlight def link haskellDeclKeyword Structure highlight def link haskellDeclKeyword Structure
highlight def link haskellDecl Structure
highlight def link haskellWhere Structure
highlight def link haskellLet Structure
highlight def link haskellQuasiQuoted String
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1 if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
highlight def link haskellForall Operator highlight def link haskellForall Operator

View File

@@ -18,6 +18,8 @@ silent! syntax include @htmlCoffeescript syntax/coffee.vim
unlet! b:current_syntax unlet! b:current_syntax
silent! syntax include @htmlStylus syntax/stylus.vim silent! syntax include @htmlStylus syntax/stylus.vim
unlet! b:current_syntax unlet! b:current_syntax
silent! syntax include @htmlCss syntax/css.vim
unlet! b:current_syntax
silent! syntax include @htmlMarkdown syntax/markdown.vim silent! syntax include @htmlMarkdown syntax/markdown.vim
unlet! b:current_syntax unlet! b:current_syntax
@@ -37,7 +39,7 @@ syn region jadeCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!"
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
syn match jadeClassChar "\." contained nextgroup=jadeClass syn match jadeClassChar "\." contained nextgroup=jadeClass
syn match jadeBlockExpansionChar ":\s\+" contained nextgroup=jadeTag syn match jadeBlockExpansionChar ":\s\+" contained nextgroup=jadeTag,jadeClassChar,jadeIdChar
syn match jadeIdChar "#[[{]\@!" contained nextgroup=jadeId syn match jadeIdChar "#[[{]\@!" contained nextgroup=jadeId
syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
@@ -69,7 +71,7 @@ syn keyword jadeScriptLoopKeywords for in contained
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag,jadeCoffeescriptFilter keepend syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag,jadeCoffeescriptFilter keepend
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffee-\?script\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend

View File

@@ -2,9 +2,21 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
" Vim syntax file " Vim syntax file
" Language: JavaScript " Language: JavaScript
" Maintainer: vim-javascript community " Maintainer: Kao Wei-Ko(othree) <othree@gmail.com>
" URL: https://github.com/pangloss/vim-javascript " Last Change: 2015-05-11
" Version: 1.5
" Changes: Go to https://github.com/othree/yajs.vim for recent changes.
" Origin: https://github.com/jelera/vim-javascript-syntax
" Credits: Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
" (This file is based on their hard work), gumnos (From the #vim
" IRC Channel in Freenode)
" if exists("b:yajs_loaded")
" finish
" else
" let b:yajs_loaded = 1
" endif
if !exists("main_syntax") if !exists("main_syntax")
if version < 600 if version < 600
syntax clear syntax clear
@@ -14,322 +26,371 @@ if !exists("main_syntax")
let main_syntax = 'javascript' let main_syntax = 'javascript'
endif endif
if !exists('g:javascript_conceal')
let g:javascript_conceal = 0
endif
"" Drop fold if it is set but VIM doesn't support it.
let b:javascript_fold='true'
if version < 600 " Don't support the old version
unlet! b:javascript_fold
endif
"" dollar sign is permittd anywhere in an identifier
setlocal iskeyword+=$
syntax sync fromstart
syntax match jsNoise /\%(:\|,\|\;\|\.\)/
"" Program Keywords
syntax keyword jsStorageClass const var let
syntax keyword jsOperator delete instanceof typeof void new in
syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false
syntax keyword jsModules import export contained
syntax keyword jsModuleWords default from as contained
syntax keyword jsOf of contained
syntax region jsImportContainer start="^\s\?import \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsStringS,jsStringD,jsTemplateString
syntax region jsExportContainer start="^\s\?export \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsClass,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsAssignmentExpr
"" JavaScript comments
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
syntax region jsLineComment start=+\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell
syntax region jsEnvComment start="\%^#!" end="$" display
syntax region jsLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell fold
syntax region jsCvsTag start="\$\cid:" end="\$" oneline contained
syntax region jsComment start="/\*" end="\*/" contains=jsCommentTodo,jsCvsTag,@Spell fold
"" JSDoc / JSDoc Toolkit
if !exists("javascript_ignore_javaScriptdoc")
syntax case ignore
"" syntax coloring for javadoc comments (HTML)
"syntax include @javaHtml <sfile>:p:h/html.vim
"unlet b:current_syntax
syntax region jsBlockComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
" tags containing a param
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
" tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\|\[\|]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
syntax case match
endif "" JSDoc end
syntax case match
"" Syntax in the JavaScript code
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained
syntax match jsTemplateVar "\${.\{-}}" contained
syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell
syntax region jsStringS start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@htmlPreproc,@Spell
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateVar,jsSpecial,@htmlPreproc
syntax region jsTaggedTemplate start=/\k\+\(\(\n\|\s\)\+\)\?`/ end=+`\|$+ contains=jsTemplateString
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained
syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained
syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained
syntax match jsRegexpOr "\v\<@!\|" contained
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
syntax match jsNumber /\<-\=\d\+\(L\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
syntax keyword jsNumber Infinity
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey contained
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ contained
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
syntax match jsFuncAssignExpr /\v%(%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\s*){-1,}\ze%(function\s*\*?\s*\()/ contains=jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis contained
syntax match jsFuncAssignObjChain /\v%([a-zA-Z_$]\k*\.)+/ contains=jsPrototype,jsNoise contained
syntax match jsFuncAssignIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
exe 'syntax keyword jsStatic static '.(exists('g:javascript_conceal_static') ? 'conceal cchar='.g:javascript_conceal_static : '')
exe 'syntax keyword jsSuper super '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
"" Statement Keywords
syntax keyword jsStatement break continue with
syntax keyword jsConditional if else switch
syntax keyword jsRepeat do while for
syntax keyword jsLabel case default
syntax keyword jsKeyword yield
syntax keyword jsClass extends class
syntax keyword jsException try catch throw finally
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
syntax match jsGlobalObjects /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient debugger implements protected volatile double public
"" DOM/HTML/CSS specified things
" DOM2 Objects
syntax keyword jsGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
syntax keyword jsExceptions DOMException
" DOM2 CONSTANT
syntax keyword jsDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
syntax keyword jsDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
" HTML events and internal variables
syntax case ignore
syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
syntax case match
" Follow stuff should be highligh within a special context
" While it can't be handled with context depended with Regex based highlight
" So, turn it off by default
if exists("javascript_enable_domhtmlcss")
" DOM2 things
syntax match jsDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
syntax match jsDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=jsParen skipwhite
" HTML things
syntax match jsHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
syntax match jsHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=jsParen skipwhite
" CSS Styles in JavaScript
syntax keyword jsCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
syntax keyword jsCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
syntax keyword jsCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
syntax keyword jsCssStyles contained bottom height left position right top width zIndex
syntax keyword jsCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
syntax keyword jsCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
syntax keyword jsCssStyles contained listStyle listStyleImage listStylePosition listStyleType
syntax keyword jsCssStyles contained background backgroundAttachment backgroundColor backgroundImage backgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
syntax keyword jsCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
syntax keyword jsCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
syntax keyword jsCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
" Highlight ways
syntax match jsDotNotation "\." nextgroup=jsPrototype,jsDomElemAttrs,jsDomElemFuncs,jsHtmlElemAttrs,jsHtmlElemFuncs
syntax match jsDotNotation "\.style\." nextgroup=jsCssStyles
endif "DOM/HTML/CSS
"" end DOM/HTML/CSS specified things
"" Code blocks
syntax cluster jsExpression contains=jsComment,jsLineComment,jsBlockComment,jsTaggedTemplate,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsStatic,jsSuper,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS,jsAssignmentExpr,jsImportContainer,jsExportContainer,jsClass
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsOf,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
syntax region jsBlock matchgroup=jsBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold
syntax region jsFuncBlock matchgroup=jsFuncBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=+?+ end=+:+ contains=@jsExpression,jsTernaryIf
"" catch errors caused by wrong parenthesis
syntax match jsParensError ")\|}\|\]"
syntax match jsParensErrA contained "\]"
syntax match jsParensErrB contained ")"
syntax match jsParensErrC contained "}"
if main_syntax == "javascript"
syntax sync clear
syntax sync ccomment jsComment minlines=200
syntax sync match jsHighlight grouphere jsBlock /{/
endif
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest,jsAssignmentExpr nextgroup=jsFuncBlock keepend skipwhite skipempty
syntax match jsFuncArgCommas contained ','
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
syntax match jsArrowFunction /=>/
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet " For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_javascript_syn_inits") if version >= 508 || !exists("did_javascript_syn_inits")
let did_javascript_hilink = 1
if version < 508 if version < 508
let did_javascript_syn_inits = 1 let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args> command -nargs=+ HiLink hi link <args>
else else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif endif
HiLink jsFuncArgRest Special else
HiLink jsComment Comment finish
HiLink jsLineComment Comment
HiLink jsEnvComment PreProc
HiLink jsBlockComment Comment
HiLink jsCommentTodo Todo
HiLink jsCvsTag Function
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
HiLink jsStringS String
HiLink jsStringD String
HiLink jsTemplateString String
HiLink jsTaggedTemplate StorageClass
HiLink jsTernaryIfOperator Conditional
HiLink jsRegexpString String
HiLink jsRegexpBoundary SpecialChar
HiLink jsRegexpQuantifier SpecialChar
HiLink jsRegexpOr Conditional
HiLink jsRegexpMod SpecialChar
HiLink jsRegexpBackRef SpecialChar
HiLink jsRegexpGroup jsRegexpString
HiLink jsRegexpCharClass Character
HiLink jsCharacter Character
HiLink jsPrototype Special
HiLink jsConditional Conditional
HiLink jsBranch Conditional
HiLink jsLabel Label
HiLink jsReturn Statement
HiLink jsRepeat Repeat
HiLink jsStatement Statement
HiLink jsException Exception
HiLink jsKeyword Keyword
HiLink jsArrowFunction Type
HiLink jsFunction Type
HiLink jsGenerator jsFunction
HiLink jsFuncName Function
HiLink jsArgsObj Special
HiLink jsError Error
HiLink jsParensError Error
HiLink jsParensErrA Error
HiLink jsParensErrB Error
HiLink jsParensErrC Error
HiLink jsOperator Operator
HiLink jsOf Operator
HiLink jsStorageClass StorageClass
HiLink jsClass Structure
HiLink jsThis Special
HiLink jsStatic Special
HiLink jsSuper Special
HiLink jsNan Number
HiLink jsNull Type
HiLink jsUndefined Type
HiLink jsNumber Number
HiLink jsFloat Float
HiLink jsBooleanTrue Boolean
HiLink jsBooleanFalse Boolean
HiLink jsNoise Noise
HiLink jsBrackets Noise
HiLink jsParens Noise
HiLink jsBraces Noise
HiLink jsFuncBraces Noise
HiLink jsFuncParens Noise
HiLink jsSpecial Special
HiLink jsTemplateVar Special
HiLink jsGlobalObjects Special
HiLink jsExceptions Special
HiLink jsFutureKeys Special
HiLink jsBuiltins Special
HiLink jsModules Include
HiLink jsModuleWords Include
HiLink jsDomErrNo Constant
HiLink jsDomNodeConsts Constant
HiLink jsDomElemAttrs Label
HiLink jsDomElemFuncs PreProc
HiLink jsHtmlEvents Special
HiLink jsHtmlElemAttrs Label
HiLink jsHtmlElemFuncs PreProc
HiLink jsCssStyles Label
delcommand HiLink
endif endif
" Define the htmlJavaScript for HTML syntax html.vim "Dollar sign is permitted anywhere in an identifier
syntax cluster htmlJavaScript contains=@jsAll,jsBracket,jsParen,jsBlock setlocal iskeyword-=$
syntax cluster javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc if &filetype =~ 'javascript'
setlocal iskeyword+=$
syntax cluster htmlJavaScript contains=TOP
endif
" Vim's default html.vim highlights all javascript as 'Special' syntax sync fromstart
hi! def link javaScript NONE
"Syntax coloring for Node.js shebang line
syntax match shellbang "^#!.*node\>"
syntax match shellbang "^#!.*iojs\>"
syntax match javascriptOpSymbols /:\ze\_[^+\-*/%\^=!<>&|?:]/ nextgroup=@javascriptStatement,javascriptCase skipwhite skipempty
syntax match javascriptOpSymbols /[+\-*/%\^=!<>&|?:]\+/ contains=javascriptOpSymbol nextgroup=@javascriptExpression skipwhite skipempty
"JavaScript comments
syntax keyword javascriptCommentTodo contained TODO FIXME XXX TBD
syntax match javascriptLineComment "//.*" contains=@Spell,javascriptCommentTodo
syntax region javascriptComment start="/\*" end="\*/" contains=@Spell,javascriptCommentTodo extend
syntax cluster javascriptComments contains=javascriptDocComment,javascriptComment,javascriptLineComment
"JSDoc
syntax case ignore
syntax region javascriptDocComment start="/\*\*" end="\*/" contains=javascriptDocNotation,javascriptCommentTodo,@Spell fold keepend
syntax match javascriptDocNotation contained / @/ nextgroup=javascriptDocTags
syntax keyword javascriptDocTags contained constant constructor constructs function ignore inner private public readonly static
syntax keyword javascriptDocTags contained const dict expose inheritDoc interface nosideeffects override protected struct
syntax keyword javascriptDocTags contained example global
" syntax keyword javascriptDocTags contained ngdoc nextgroup=javascriptDocNGDirective
syntax keyword javascriptDocTags contained ngdoc scope priority animations
syntax keyword javascriptDocTags contained ngdoc restrict methodOf propertyOf eventOf eventType nextgroup=javascriptDocParam skipwhite
syntax keyword javascriptDocNGDirective contained overview service object function method property event directive filter inputType error
syntax keyword javascriptDocTags contained abstract virtual access augments
syntax keyword javascriptDocTags contained arguments callback lends memberOf name type kind link mixes mixin tutorial nextgroup=javascriptDocParam skipwhite
syntax keyword javascriptDocTags contained variation nextgroup=javascriptDocNumParam skipwhite
syntax keyword javascriptDocTags contained author class classdesc copyright default defaultvalue nextgroup=javascriptDocDesc skipwhite
syntax keyword javascriptDocTags contained deprecated description external host nextgroup=javascriptDocDesc skipwhite
syntax keyword javascriptDocTags contained file fileOverview overview namespace requires since version nextgroup=javascriptDocDesc skipwhite
syntax keyword javascriptDocTags contained summary todo license preserve nextgroup=javascriptDocDesc skipwhite
syntax keyword javascriptDocTags contained borrows exports nextgroup=javascriptDocA skipwhite
syntax keyword javascriptDocTags contained param arg argument property prop module nextgroup=javascriptDocNamedParamType,javascriptDocParamName skipwhite
syntax keyword javascriptDocTags contained type nextgroup=javascriptDocParamType skipwhite
syntax keyword javascriptDocTags contained define enum extends implements this typedef nextgroup=javascriptDocParamType skipwhite
syntax keyword javascriptDocTags contained return returns throws exception nextgroup=javascriptDocParamType,javascriptDocParamName skipwhite
syntax keyword javascriptDocTags contained see nextgroup=javascriptDocRef skipwhite
"syntax for event firing
syntax keyword javascriptDocTags contained emits fires nextgroup=javascriptDocEventRef skipwhite
syntax keyword javascriptDocTags contained function func method nextgroup=javascriptDocName skipwhite
syntax match javascriptDocName contained /\h\w*/
syntax keyword javascriptDocTags contained fires event nextgroup=javascriptDocEventRef skipwhite
syntax match javascriptDocEventRef contained /\h\w*#\(\h\w*\:\)\?\h\w*/
syntax match javascriptDocNamedParamType contained /{.\+}/ nextgroup=javascriptDocParamName skipwhite
syntax match javascriptDocParamName contained /\[\?[0-9a-zA-Z_\.]\+=\?[0-9a-zA-Z_\.]*\]\?/ nextgroup=javascriptDocDesc skipwhite
syntax match javascriptDocParamType contained /{.\+}/ nextgroup=javascriptDocDesc skipwhite
syntax match javascriptDocA contained /\%(#\|\w\|\.\|:\|\/\)\+/ nextgroup=javascriptDocAs skipwhite
syntax match javascriptDocAs contained /\s*as\s*/ nextgroup=javascriptDocB skipwhite
syntax match javascriptDocB contained /\%(#\|\w\|\.\|:\|\/\)\+/
syntax match javascriptDocParam contained /\%(#\|\w\|\.\|:\|\/\|-\)\+/
syntax match javascriptDocNumParam contained /\d\+/
syntax match javascriptDocRef contained /\%(#\|\w\|\.\|:\|\/\)\+/
syntax region javascriptDocLinkTag contained matchgroup=javascriptDocLinkTag start=/{/ end=/}/ contains=javascriptDocTags
syntax cluster javascriptDocs contains=javascriptDocParamType,javascriptDocNamedParamType,javascriptDocParam
if main_syntax == "javascript"
syntax sync clear
syntax sync ccomment javascriptComment minlines=200
endif
syntax case match
syntax cluster javascriptAfterIdentifier contains=javascriptDotNotation,javascriptFuncCallArg,javascriptComputedProperty,javascriptWSymbols,@javascriptSymbols
syntax match javascriptIdentifierName /\<[^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^0-9][^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^]*/ nextgroup=@javascriptAfterIdentifier contains=@_semantic
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
syntax cluster javascriptStatement contains=javascriptBlock,javascriptVariable,@javascriptExpression,javascriptConditional,javascriptRepeat,javascriptBranch,javascriptLabel,javascriptStatementKeyword,javascriptTry,javascriptDebugger
"Syntax in the JavaScript code
" syntax match javascriptASCII contained /\\\d\d\d/
syntax region javascriptTemplateSubstitution contained matchgroup=javascriptTemplateSB start=/\${/ end=/}/ contains=javascriptTemplateSBlock,javascriptTemplateSString
syntax region javascriptTemplateSBlock contained start=/{/ end=/}/ contains=javascriptTemplateSBlock,javascriptTemplateSString transparent
syntax region javascriptTemplateSString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ extend contains=javascriptTemplateSStringRB transparent
syntax match javascriptTemplateSStringRB /}/ contained
syntax region javascriptString start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax region javascriptTemplate start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/ contains=javascriptTemplateSubstitution nextgroup=@javascriptSymbols skipwhite skipempty
" syntax match javascriptTemplateTag /\k\+/ nextgroup=javascriptTemplate
syntax region javascriptArray matchgroup=javascriptBraces start=/\[/ end=/]/ contains=@javascriptValue,javascriptForComprehension,@javascriptComments nextgroup=@javascriptSymbols,@javascriptComments skipwhite skipempty
syntax match javascriptNumber /\<0[bB][01]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax match javascriptNumber /\<0[oO][0-7]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax match javascriptNumber /\<0[xX][0-9a-fA-F]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax match javascriptNumber /[+-]\=\%(\d\+\.\d\+\|\d\+\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ nextgroup=@javascriptSymbols skipwhite skipempty
syntax cluster javascriptTypes contains=javascriptString,javascriptTemplate,javascriptRegexpString,javascriptNumber,javascriptBoolean,javascriptNull,javascriptArray
syntax cluster javascriptValue contains=@javascriptTypes,@javascriptExpression,javascriptFuncKeyword,javascriptClassKeyword,javascriptObjectLiteral,javascriptIdentifier,javascriptIdentifierName,javascriptOperator,@javascriptSymbols
syntax match javascriptLabel /[a-zA-Z_$]\k*\_s*:/he=e-1 nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
syntax match javascriptObjectLabel contained /\k\+\_s*:/he=e-1 contains=javascriptObjectLabelColon nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
syntax match javascriptObjectLabelColon contained /:/ nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
" syntax match javascriptPropertyName contained /"[^"]\+"\s*:/he=e-1 nextgroup=@javascriptValue skipwhite skipempty
" syntax match javascriptPropertyName contained /'[^']\+'\s*:/he=e-1 nextgroup=@javascriptValue skipwhite skipempty
syntax region javascriptPropertyName contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ nextgroup=javascriptObjectLabelColon skipwhite skipempty
syntax region javascriptComputedPropertyName contained matchgroup=javascriptPropertyName start=/\[/rs=s+1 end=/]/ contains=@javascriptValue nextgroup=javascriptObjectLabelColon skipwhite skipempty
syntax region javascriptComputedProperty contained matchgroup=javascriptProperty start=/\[/rs=s+1 end=/]/ contains=@javascriptValue,@javascriptSymbols nextgroup=@javascriptAfterIdentifier skipwhite skipempty
" Value for object, statement for label statement
syntax cluster javascriptTemplates contains=javascriptTemplate,javascriptTemplateSubstitution,javascriptTemplateSBlock,javascriptTemplateSString,javascriptTemplateSStringRB,javascriptTemplateSB
syntax cluster javascriptStrings contains=javascriptProp,javascriptString,@javascriptTemplates,@javascriptComments,javascriptDocComment,javascriptRegexpString,javascriptPropertyName
"this
"JavaScript Prototype
syntax keyword javascriptPrototype prototype
"Program Keywords
syntax keyword javascriptIdentifier arguments this nextgroup=@javascriptAfterIdentifier
syntax keyword javascriptVariable let var const
syntax keyword javascriptOperator delete new instanceof typeof void in nextgroup=@javascriptValue,@javascriptTypes skipwhite skipempty
syntax keyword javascriptForOperator contained in of
syntax keyword javascriptBoolean true false nextgroup=@javascriptSymbols skipwhite skipempty
syntax keyword javascriptNull null undefined nextgroup=@javascriptSymbols skipwhite skipempty
syntax keyword javascriptMessage alert confirm prompt status
syntax keyword javascriptGlobal self top parent
"Statement Keywords
syntax keyword javascriptConditional if else switch
syntax keyword javascriptConditionalElse else
syntax keyword javascriptRepeat do while for nextgroup=javascriptLoopParen skipwhite skipempty
syntax keyword javascriptBranch break continue
syntax keyword javascriptCase case nextgroup=@javascriptTypes skipwhite
syntax keyword javascriptDefault default
syntax keyword javascriptStatementKeyword return with yield
syntax keyword javascriptReturn return nextgroup=@javascriptValue skipwhite
syntax keyword javascriptYield yield
syntax keyword javascriptTry try
syntax keyword javascriptExceptions catch throw finally
syntax keyword javascriptDebugger debugger
syntax match javascriptProp contained /[a-zA-Z_$][a-zA-Z0-9_$]*/ contains=@props,@_semantic transparent nextgroup=@javascriptAfterIdentifier
syntax match javascriptMethod contained /[a-zA-Z_$][a-zA-Z0-9_$]*\ze(/ contains=@props transparent nextgroup=javascriptFuncCallArg
syntax match javascriptDotNotation /\./ nextgroup=javascriptProp,javascriptMethod
syntax match javascriptDotStyleNotation /\.style\./ nextgroup=javascriptDOMStyle transparent
runtime syntax/yajs/javascript.vim
runtime syntax/yajs/es6-number.vim
runtime syntax/yajs/es6-string.vim
runtime syntax/yajs/es6-array.vim
runtime syntax/yajs/es6-object.vim
runtime syntax/yajs/es6-symbol.vim
runtime syntax/yajs/es6-function.vim
runtime syntax/yajs/es6-math.vim
runtime syntax/yajs/es6-date.vim
runtime syntax/yajs/es6-json.vim
runtime syntax/yajs/es6-regexp.vim
runtime syntax/yajs/es6-map.vim
runtime syntax/yajs/es6-set.vim
runtime syntax/yajs/es6-proxy.vim
runtime syntax/yajs/es6-promise.vim
runtime syntax/yajs/node.vim
runtime syntax/yajs/web.vim
let javascript_props = 1
runtime syntax/yajs/event.vim
syntax region javascriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=javascriptASCII,@events
"Import
syntax region javascriptImportDef start=/import/ end=/;\|\n/ contains=javascriptImport,javascriptString,javascriptEndColons
syntax keyword javascriptImport contained from as import
syntax keyword javascriptExport export module
syntax region javascriptBlock matchgroup=javascriptBraces start=/\([\^:]\s\*\)\=\zs{/ end=/}/ contains=@htmlJavaScript
syntax region javascriptMethodDef contained start=/\(\(\(set\|get\)\_s\+\)\?\)[a-zA-Z_$]\k*\_s*(/ end=/)/ contains=javascriptMethodAccessor,javascriptMethodName,javascriptFuncArg nextgroup=javascriptBlock skipwhite keepend
syntax region javascriptMethodArgs contained start=/(/ end=/)/ contains=javascriptFuncArg,@javascriptComments nextgroup=javascriptBlock skipwhite keepend
syntax match javascriptMethodName contained /[a-zA-Z_$]\k*/ nextgroup=javascriptMethodArgs skipwhite skipempty
syntax match javascriptMethodAccessor contained /\(set\|get\)\s\+\ze\k/ contains=javascriptMethodAccessorWords
syntax keyword javascriptMethodAccessorWords contained get set
syntax region javascriptMethodName contained matchgroup=javascriptPropertyName start=/\[/ end=/]/ contains=@javascriptValue nextgroup=javascriptMethodArgs skipwhite skipempty
syntax keyword javascriptAsyncFuncKeyword async await
" syntax keyword javascriptFuncKeyword function nextgroup=javascriptFuncName,javascriptFuncArg skipwhite
syntax keyword javascriptFuncKeyword function nextgroup=javascriptAsyncFunc,javascriptSyncFunc
syntax match javascriptSyncFunc contained // nextgroup=javascriptFuncName,javascriptFuncArg skipwhite skipempty
syntax match javascriptAsyncFunc contained /\s*\*\s*/ nextgroup=javascriptFuncName,javascriptFuncArg skipwhite skipempty
syntax match javascriptFuncName contained /[a-zA-Z_$]\k*/ nextgroup=javascriptFuncArg skipwhite
syntax match javascriptFuncArg contained /(\_[^()]*)/ contains=javascriptParens,javascriptFuncKeyword,javascriptFuncComma nextgroup=javascriptBlock skipwhite skipwhite skipempty
syntax match javascriptFuncComma contained /,/
"Class
syntax keyword javascriptClassKeyword class nextgroup=javascriptClassName skipwhite
syntax keyword javascriptClassSuper super
syntax match javascriptClassName contained /\k\+/ nextgroup=javascriptClassBlock,javascriptClassExtends skipwhite
syntax match javascriptClassSuperName contained /[a-zA-Z_$][a-zA-Z_$\[\]\.]*/ nextgroup=javascriptClassBlock skipwhite
syntax keyword javascriptClassExtends contained extends nextgroup=javascriptClassSuperName skipwhite
syntax region javascriptClassBlock contained matchgroup=javascriptBraces start=/{/ end=/}/ contains=javascriptMethodName,javascriptMethodAccessor,javascriptClassStatic,@javascriptComments
syntax keyword javascriptClassStatic contained static nextgroup=javascriptMethodName,javascriptMethodAccessor skipwhite
syntax keyword javascriptForComprehension contained for nextgroup=javascriptForComprehensionTail skipwhite skipempty
syntax region javascriptForComprehensionTail contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptOfComprehension,@javascriptExpression nextgroup=javascriptForComprehension,javascriptIfComprehension,@javascriptExpression skipwhite skipempty
syntax keyword javascriptOfComprehension contained of
syntax keyword javascriptIfComprehension contained if nextgroup=javascriptIfComprehensionTail
syntax region javascriptIfComprehensionTail contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptExpression nextgroup=javascriptForComprehension,javascriptIfComprehension skipwhite skipempty
syntax region javascriptObjectLiteral contained matchgroup=javascriptBraces start=/{/ end=/}/ contains=@javascriptComments,javascriptObjectLabel,javascriptPropertyName,javascriptMethodDef,javascriptComputedPropertyName,@javascriptValue
" syntax match javascriptBraces /[\[\]]/
syntax match javascriptParens /[()]/
" syntax match javascriptOpSymbols /[^+\-*/%\^=!<>&|?]\@<=\(<\|>\|<=\|>=\|==\|!=\|===\|!==\|+\|-\|*\|%\|++\|--\|<<\|>>\|>>>\|&\||\|^\|!\|\~\|&&\|||\|?\|=\|+=\|-=\|*=\|%=\|<<=\|>>=\|>>>=\|&=\||=\|^=\|\/\|\/=\)\ze\_[^+\-*/%\^=!<>&|?]/ nextgroup=@javascriptExpression skipwhite
" syntax match javascriptInvalidOp contained /[+\-*/%\^=!<>&|?:]\+/
syntax match javascriptOpSymbol contained /\(<\|>\|<=\|>=\|==\|!=\|===\|!==\|+\|*\|%\|++\|--\|<<\|>>\|>>>\|&\||\|^\|!\|\~\|&&\|||\|?\|=\|+=\|-=\|*=\|%=\|<<=\|>>=\|>>>=\|&=\||=\|^=\|\/\|\/=\)\ze\_[^+\-*/%\^=!<>&|?:]/ nextgroup=javascriptInvalidOp skipwhite skipempty
syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
syntax match javascriptWOpSymbols contained /\_s\+/ nextgroup=javascriptOpSymbols
syntax match javascriptEndColons /[;,]/
syntax match javascriptLogicSymbols /[^&|]\@<=\(&&\|||\)\ze\_[^&|]/ nextgroup=@javascriptExpression skipwhite skipempty
syntax cluster javascriptSymbols contains=javascriptOpSymbols,javascriptLogicSymbols
syntax match javascriptWSymbols contained /\_s\+/ nextgroup=@javascriptSymbols
syntax region javascriptRegexpString start="\(^\|&\||\|=\|(\|{\|;\|:\|\[\|!\)\@<=\_s*/[^/*]"me=e-1 skip="\\\\\|[^\\]\@<=\\/" end="/[gimy]\{0,2\}" oneline
syntax cluster javascriptEventTypes contains=javascriptEventString,javascriptTemplate,javascriptNumber,javascriptBoolean,javascriptNull
syntax cluster javascriptOps contains=javascriptOpSymbols,javascriptLogicSymbols,javascriptOperator
syntax region javascriptParenExp matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptExpression nextgroup=@javascriptSymbols skipwhite skipempty
syntax cluster javascriptExpression contains=javascriptArrowFuncDef,javascriptParenExp,@javascriptValue,javascriptObjectLiteral,javascriptFuncKeyword,javascriptYield,javascriptIdentifierName,javascriptRegexpString,@javascriptTypes,@javascriptOps,javascriptGlobal,jsxRegion
syntax cluster javascriptEventExpression contains=javascriptArrowFuncDef,javascriptParenExp,@javascriptValue,javascriptObjectLiteral,javascriptFuncKeyword,javascriptIdentifierName,javascriptRegexpString,@javascriptEventTypes,@javascriptOps,javascriptGlobal,jsxRegion
syntax region javascriptLoopParen contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptVariable,javascriptForOperator,javascriptEndColons,@javascriptExpression nextgroup=javascriptBlock skipwhite skipempty
" syntax match javascriptFuncCall contained /[a-zA-Z]\k*\ze(/ nextgroup=javascriptFuncCallArg
syntax region javascriptFuncCallArg contained matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptExpression,@javascriptComments nextgroup=@javascriptAfterIdentifier
syntax cluster javascriptSymbols contains=javascriptOpSymbols,javascriptLogicSymbols
syntax match javascriptWSymbols contained /\_s\+/ nextgroup=@javascriptSymbols
syntax region javascriptEventFuncCallArg contained matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptEventExpression,@javascriptComments
syntax match javascriptArrowFuncDef contained /([^)]*)\_s*=>/ contains=javascriptFuncArg,javascriptArrowFunc nextgroup=javascriptBlock skipwhite skipempty
syntax match javascriptArrowFuncDef contained /[a-zA-Z_$][a-zA-Z0-9_$]*\_s*=>/ contains=javascriptArrowFuncArg,javascriptArrowFunc nextgroup=javascriptBlock skipwhite skipempty
syntax match javascriptArrowFunc /=>/
syntax match javascriptArrowFuncArg contained /[a-zA-Z_$]\k*/
runtime syntax/semhl.vim
if exists("did_javascript_hilink")
HiLink javascriptEndColons Exception
HiLink javascriptOpSymbols Normal
HiLink javascriptLogicSymbols Boolean
HiLink javascriptBraces Function
HiLink javascriptParens Normal
HiLink javascriptComment Comment
HiLink javascriptLineComment Comment
HiLink javascriptDocComment Comment
HiLink javascriptCommentTodo Todo
HiLink javascriptDocNotation SpecialComment
HiLink javascriptDocTags SpecialComment
HiLink javascriptDocNGParam javascriptDocParam
HiLink javascriptDocParam Function
HiLink javascriptDocNumParam Function
HiLink javascriptDocEventRef Function
HiLink javascriptDocNamedParamType Type
HiLink javascriptDocParamName Type
HiLink javascriptDocParamType Type
HiLink javascriptString String
HiLink javascriptTemplate String
HiLink javascriptEventString String
HiLink javascriptASCII Label
HiLink javascriptTemplateSubstitution Label
" HiLink javascriptTemplateSBlock Label
" HiLink javascriptTemplateSString Label
HiLink javascriptTemplateSStringRB javascriptTemplateSubstitution
HiLink javascriptTemplateSB javascriptTemplateSubstitution
HiLink javascriptRegexpString String
HiLink javascriptGlobal Constant
HiLink javascriptCharacter Character
HiLink javascriptPrototype Type
HiLink javascriptConditional Conditional
HiLink javascriptConditionalElse Conditional
HiLink javascriptCase Conditional
HiLink javascriptDefault javascriptCase
HiLink javascriptBranch Conditional
HiLink javascriptIdentifier Structure
HiLink javascriptVariable Identifier
HiLink javascriptRepeat Repeat
HiLink javascriptForComprehension Repeat
HiLink javascriptIfComprehension Repeat
HiLink javascriptOfComprehension Repeat
HiLink javascriptForOperator Repeat
HiLink javascriptStatementKeyword Statement
HiLink javascriptReturn Statement
HiLink javascriptYield Statement
HiLink javascriptMessage Keyword
HiLink javascriptOperator Identifier
" HiLink javascriptType Type
HiLink javascriptNull Boolean
HiLink javascriptNumber Number
HiLink javascriptBoolean Boolean
HiLink javascriptObjectLabel javascriptLabel
HiLink javascriptLabel Label
HiLink javascriptPropertyName Label
HiLink javascriptImport Special
HiLink javascriptExport Special
HiLink javascriptTry Special
HiLink javascriptExceptions Special
HiLink javascriptMethodName Function
HiLink javascriptMethodAccessor Operator
HiLink javascriptAsyncFuncKeyword Keyword
HiLink javascriptFuncKeyword Keyword
HiLink javascriptAsyncFunc Keyword
HiLink javascriptArrowFunc Type
HiLink javascriptFuncName Function
HiLink javascriptFuncArg Special
HiLink javascriptArrowFuncArg javascriptFuncArg
HiLink javascriptFuncComma Operator
HiLink javascriptClassKeyword Keyword
HiLink javascriptClassExtends Keyword
HiLink javascriptClassName Function
HiLink javascriptClassSuperName Function
HiLink javascriptClassStatic StorageClass
HiLink javascriptClassSuper keyword
HiLink shellbang Comment
highlight link javaScript NONE
delcommand HiLink
unlet did_javascript_hilink
endif
let b:current_syntax = "javascript" let b:current_syntax = "javascript"
if main_syntax == 'javascript' if main_syntax == 'javascript'
unlet main_syntax unlet main_syntax
endif endif
endif endif

139
syntax/jinja.vim Normal file
View File

@@ -0,0 +1,139 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
" Vim syntax file
" Language: Jinja template
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
" Last Change: 2008 May 9
" Version: 1.1
"
" Known Bugs:
" because of odd limitations dicts and the modulo operator
" appear wrong in the template.
"
" Changes:
"
" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
" .vimrc variable to disable html highlighting
if !exists('g:jinja_syntax_html')
let g:jinja_syntax_html=1
endif
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'jinja'
endif
" Pull in the HTML syntax.
if g:jinja_syntax_html
if version < 600
so <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
unlet b:current_syntax
endif
endif
syntax case match
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
" have special threatment)
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
" Variable Names
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs
" Filters
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter
syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/
syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/
syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/
" Jinja template constants
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
" Operators
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
" Jinja template tag and variable blocks
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
" Jinja template 'raw' tag
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
" Jinja comments
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
" Block start keywords. A bit tricker. We only highlight at the start of a
" tag block and only if the name is not followed by a comma or equals sign
" which usually means that we have to deal with an assignment.
syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
" and context modifiers
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_jinja_syn_inits")
if version < 508
let did_jinja_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jinjaPunctuation jinjaOperator
HiLink jinjaAttribute jinjaVariable
HiLink jinjaFunction jinjaFilter
HiLink jinjaTagDelim jinjaTagBlock
HiLink jinjaVarDelim jinjaVarBlock
HiLink jinjaCommentDelim jinjaComment
HiLink jinjaRawDelim jinja
HiLink jinjaSpecial Special
HiLink jinjaOperator Normal
HiLink jinjaRaw Normal
HiLink jinjaTagBlock PreProc
HiLink jinjaVarBlock PreProc
HiLink jinjaStatement Statement
HiLink jinjaFilter Function
HiLink jinjaBlockName Function
HiLink jinjaVariable Identifier
HiLink jinjaString Constant
HiLink jinjaNumber Constant
HiLink jinjaComment Comment
delcommand HiLink
endif
let b:current_syntax = "jinja"
if main_syntax == 'jinja'
unlet main_syntax
endif
endif

103
syntax/kotlin.vim Normal file
View 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

View File

@@ -11,12 +11,11 @@ setlocal iskeyword+=.
setlocal iskeyword+=/ setlocal iskeyword+=/
setlocal iskeyword+=: setlocal iskeyword+=:
syn match ngxVariable '\$\w\w*' syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
syn match ngxVariableBlock '\$\w\w*' contained syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
syn match ngxVariableString '\$\w\w*' contained syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline
syn match ngxComment ' *#.*$' syn match ngxComment ' *#.*$'
syn keyword ngxBoolean on syn keyword ngxBoolean on
@@ -34,6 +33,7 @@ syn keyword ngxDirectiveBlock limit_except contained
syn keyword ngxDirectiveBlock if contained syn keyword ngxDirectiveBlock if contained
syn keyword ngxDirectiveBlock geo contained syn keyword ngxDirectiveBlock geo contained
syn keyword ngxDirectiveBlock map contained syn keyword ngxDirectiveBlock map contained
syn keyword ngxDirectiveBlock split_clients contained
syn keyword ngxDirectiveImportant include syn keyword ngxDirectiveImportant include
syn keyword ngxDirectiveImportant root syn keyword ngxDirectiveImportant root
@@ -44,6 +44,8 @@ syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass syn keyword ngxDirectiveImportant memcached_pass
syn keyword ngxDirectiveImportant fastcgi_pass syn keyword ngxDirectiveImportant fastcgi_pass
syn keyword ngxDirectiveImportant scgi_pass
syn keyword ngxDirectiveImportant uwsgi_pass
syn keyword ngxDirectiveImportant try_files syn keyword ngxDirectiveImportant try_files
syn keyword ngxDirectiveControl break syn keyword ngxDirectiveControl break
@@ -56,12 +58,15 @@ syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated limit_zone
syn keyword ngxDirectiveDeprecated open_file_cache_retest syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any syn keyword ngxDirectiveDeprecated satisfy_any
syn keyword ngxDirectiveDeprecated so_keepalive
syn keyword ngxDirective accept_mutex syn keyword ngxDirective accept_mutex
syn keyword ngxDirective accept_mutex_delay syn keyword ngxDirective accept_mutex_delay
syn keyword ngxDirective acceptex_read
syn keyword ngxDirective access_log syn keyword ngxDirective access_log
syn keyword ngxDirective add_after_body syn keyword ngxDirective add_after_body
syn keyword ngxDirective add_before_body syn keyword ngxDirective add_before_body
@@ -77,11 +82,14 @@ syn keyword ngxDirective auth_basic_user_file
syn keyword ngxDirective auth_http syn keyword ngxDirective auth_http
syn keyword ngxDirective auth_http_header syn keyword ngxDirective auth_http_header
syn keyword ngxDirective auth_http_timeout syn keyword ngxDirective auth_http_timeout
syn keyword ngxDirective auth_request
syn keyword ngxDirective auth_request_set
syn keyword ngxDirective autoindex syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_localtime syn keyword ngxDirective autoindex_localtime
syn keyword ngxDirective charset syn keyword ngxDirective charset
syn keyword ngxDirective charset_types syn keyword ngxDirective charset_types
syn keyword ngxDirective chunked_transfer_encoding
syn keyword ngxDirective client_body_buffer_size syn keyword ngxDirective client_body_buffer_size
syn keyword ngxDirective client_body_in_file_only syn keyword ngxDirective client_body_in_file_only
syn keyword ngxDirective client_body_in_single_buffer syn keyword ngxDirective client_body_in_single_buffer
@@ -105,32 +113,44 @@ syn keyword ngxDirective devpoll_changes
syn keyword ngxDirective devpoll_events syn keyword ngxDirective devpoll_events
syn keyword ngxDirective directio syn keyword ngxDirective directio
syn keyword ngxDirective directio_alignment syn keyword ngxDirective directio_alignment
syn keyword ngxDirective disable_symlinks
syn keyword ngxDirective empty_gif syn keyword ngxDirective empty_gif
syn keyword ngxDirective env syn keyword ngxDirective env
syn keyword ngxDirective epoll_events syn keyword ngxDirective epoll_events
syn keyword ngxDirective error_log syn keyword ngxDirective error_log
syn keyword ngxDirective etag
syn keyword ngxDirective eventport_events syn keyword ngxDirective eventport_events
syn keyword ngxDirective expires syn keyword ngxDirective expires
syn keyword ngxDirective fastcgi_bind syn keyword ngxDirective fastcgi_bind
syn keyword ngxDirective fastcgi_buffer_size syn keyword ngxDirective fastcgi_buffer_size
syn keyword ngxDirective fastcgi_buffering
syn keyword ngxDirective fastcgi_buffers syn keyword ngxDirective fastcgi_buffers
syn keyword ngxDirective fastcgi_busy_buffers_size syn keyword ngxDirective fastcgi_busy_buffers_size
syn keyword ngxDirective fastcgi_cache syn keyword ngxDirective fastcgi_cache
syn keyword ngxDirective fastcgi_cache_bypass
syn keyword ngxDirective fastcgi_cache_key syn keyword ngxDirective fastcgi_cache_key
syn keyword ngxDirective fastcgi_cache_lock
syn keyword ngxDirective fastcgi_cache_lock_timeout
syn keyword ngxDirective fastcgi_cache_methods syn keyword ngxDirective fastcgi_cache_methods
syn keyword ngxDirective fastcgi_cache_min_uses syn keyword ngxDirective fastcgi_cache_min_uses
syn keyword ngxDirective fastcgi_cache_path syn keyword ngxDirective fastcgi_cache_path
syn keyword ngxDirective fastcgi_cache_revalidate
syn keyword ngxDirective fastcgi_cache_use_stale syn keyword ngxDirective fastcgi_cache_use_stale
syn keyword ngxDirective fastcgi_cache_valid syn keyword ngxDirective fastcgi_cache_valid
syn keyword ngxDirective fastcgi_catch_stderr syn keyword ngxDirective fastcgi_catch_stderr
syn keyword ngxDirective fastcgi_connect_timeout syn keyword ngxDirective fastcgi_connect_timeout
syn keyword ngxDirective fastcgi_force_ranges
syn keyword ngxDirective fastcgi_hide_header syn keyword ngxDirective fastcgi_hide_header
syn keyword ngxDirective fastcgi_ignore_client_abort syn keyword ngxDirective fastcgi_ignore_client_abort
syn keyword ngxDirective fastcgi_ignore_headers syn keyword ngxDirective fastcgi_ignore_headers
syn keyword ngxDirective fastcgi_index syn keyword ngxDirective fastcgi_index
syn keyword ngxDirective fastcgi_intercept_errors syn keyword ngxDirective fastcgi_intercept_errors
syn keyword ngxDirective fastcgi_keep_conn
syn keyword ngxDirective fastcgi_max_temp_file_size syn keyword ngxDirective fastcgi_max_temp_file_size
syn keyword ngxDirective fastcgi_next_upstream syn keyword ngxDirective fastcgi_next_upstream
syn keyword ngxDirective fastcgi_next_upstream_timeout
syn keyword ngxDirective fastcgi_next_upstream_tries
syn keyword ngxDirective fastcgi_no_cache
syn keyword ngxDirective fastcgi_param syn keyword ngxDirective fastcgi_param
syn keyword ngxDirective fastcgi_pass_header syn keyword ngxDirective fastcgi_pass_header
syn keyword ngxDirective fastcgi_pass_request_body syn keyword ngxDirective fastcgi_pass_request_body
@@ -143,12 +163,15 @@ syn keyword ngxDirective fastcgi_store
syn keyword ngxDirective fastcgi_store_access syn keyword ngxDirective fastcgi_store_access
syn keyword ngxDirective fastcgi_temp_file_write_size syn keyword ngxDirective fastcgi_temp_file_write_size
syn keyword ngxDirective fastcgi_temp_path syn keyword ngxDirective fastcgi_temp_path
syn keyword ngxDirective fastcgi_upstream_fail_timeout
syn keyword ngxDirective fastcgi_upstream_max_fails
syn keyword ngxDirective flv syn keyword ngxDirective flv
syn keyword ngxDirective geoip_city syn keyword ngxDirective geoip_city
syn keyword ngxDirective geoip_country syn keyword ngxDirective geoip_country
syn keyword ngxDirective geoip_org
syn keyword ngxDirective geoip_proxy
syn keyword ngxDirective geoip_proxy_recursive
syn keyword ngxDirective google_perftools_profiles syn keyword ngxDirective google_perftools_profiles
syn keyword ngxDirective gunzip
syn keyword ngxDirective gunzip_buffers
syn keyword ngxDirective gzip syn keyword ngxDirective gzip
syn keyword ngxDirective gzip_buffers syn keyword ngxDirective gzip_buffers
syn keyword ngxDirective gzip_comp_level syn keyword ngxDirective gzip_comp_level
@@ -162,30 +185,40 @@ syn keyword ngxDirective gzip_static
syn keyword ngxDirective gzip_types syn keyword ngxDirective gzip_types
syn keyword ngxDirective gzip_vary syn keyword ngxDirective gzip_vary
syn keyword ngxDirective gzip_window syn keyword ngxDirective gzip_window
syn keyword ngxDirective hash
syn keyword ngxDirective if_modified_since syn keyword ngxDirective if_modified_since
syn keyword ngxDirective ignore_invalid_headers syn keyword ngxDirective ignore_invalid_headers
syn keyword ngxDirective image_filter syn keyword ngxDirective image_filter
syn keyword ngxDirective image_filter_buffer syn keyword ngxDirective image_filter_buffer
syn keyword ngxDirective image_filter_interlace
syn keyword ngxDirective image_filter_jpeg_quality syn keyword ngxDirective image_filter_jpeg_quality
syn keyword ngxDirective image_filter_sharpen
syn keyword ngxDirective image_filter_transparency syn keyword ngxDirective image_filter_transparency
syn keyword ngxDirective imap_auth syn keyword ngxDirective imap_auth
syn keyword ngxDirective imap_capabilities syn keyword ngxDirective imap_capabilities
syn keyword ngxDirective imap_client_buffer syn keyword ngxDirective imap_client_buffer
syn keyword ngxDirective index syn keyword ngxDirective index
syn keyword ngxDirective iocp_threads
syn keyword ngxDirective ip_hash syn keyword ngxDirective ip_hash
syn keyword ngxDirective keepalive
syn keyword ngxDirective keepalive_disable
syn keyword ngxDirective keepalive_requests syn keyword ngxDirective keepalive_requests
syn keyword ngxDirective keepalive_timeout syn keyword ngxDirective keepalive_timeout
syn keyword ngxDirective kqueue_changes syn keyword ngxDirective kqueue_changes
syn keyword ngxDirective kqueue_events syn keyword ngxDirective kqueue_events
syn keyword ngxDirective large_client_header_buffers syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective least_conn
syn keyword ngxDirective limit_conn syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_log_level syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_conn_status
syn keyword ngxDirective limit_conn_zone
syn keyword ngxDirective limit_rate syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_log_level syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_status
syn keyword ngxDirective limit_req_zone syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective limit_zone syn keyword ngxDirective lingering_close
syn keyword ngxDirective lingering_time syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout syn keyword ngxDirective lingering_timeout
syn keyword ngxDirective lock_file syn keyword ngxDirective lock_file
@@ -195,21 +228,27 @@ syn keyword ngxDirective log_subrequest
syn keyword ngxDirective map_hash_bucket_size syn keyword ngxDirective map_hash_bucket_size
syn keyword ngxDirective map_hash_max_size syn keyword ngxDirective map_hash_max_size
syn keyword ngxDirective master_process syn keyword ngxDirective master_process
syn keyword ngxDirective max_ranges
syn keyword ngxDirective memcached_bind syn keyword ngxDirective memcached_bind
syn keyword ngxDirective memcached_buffer_size syn keyword ngxDirective memcached_buffer_size
syn keyword ngxDirective memcached_connect_timeout syn keyword ngxDirective memcached_connect_timeout
syn keyword ngxDirective memcached_gzip_flag
syn keyword ngxDirective memcached_next_upstream syn keyword ngxDirective memcached_next_upstream
syn keyword ngxDirective memcached_next_upstream_timeout
syn keyword ngxDirective memcached_next_upstream_tries
syn keyword ngxDirective memcached_read_timeout syn keyword ngxDirective memcached_read_timeout
syn keyword ngxDirective memcached_send_timeout syn keyword ngxDirective memcached_send_timeout
syn keyword ngxDirective memcached_upstream_fail_timeout
syn keyword ngxDirective memcached_upstream_max_fails
syn keyword ngxDirective merge_slashes syn keyword ngxDirective merge_slashes
syn keyword ngxDirective min_delete_depth syn keyword ngxDirective min_delete_depth
syn keyword ngxDirective modern_browser syn keyword ngxDirective modern_browser
syn keyword ngxDirective modern_browser_value syn keyword ngxDirective modern_browser_value
syn keyword ngxDirective mp4
syn keyword ngxDirective mp4_buffer_size
syn keyword ngxDirective mp4_max_buffer_size
syn keyword ngxDirective msie_padding syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept syn keyword ngxDirective multi_accept
syn keyword ngxDirective mysql_test
syn keyword ngxDirective open_file_cache syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events syn keyword ngxDirective open_file_cache_events
@@ -218,6 +257,7 @@ syn keyword ngxDirective open_file_cache_valid
syn keyword ngxDirective open_log_file_cache syn keyword ngxDirective open_log_file_cache
syn keyword ngxDirective output_buffers syn keyword ngxDirective output_buffers
syn keyword ngxDirective override_charset syn keyword ngxDirective override_charset
syn keyword ngxDirective pcre_jit
syn keyword ngxDirective perl syn keyword ngxDirective perl
syn keyword ngxDirective perl_modules syn keyword ngxDirective perl_modules
syn keyword ngxDirective perl_require syn keyword ngxDirective perl_require
@@ -226,6 +266,7 @@ syn keyword ngxDirective pid
syn keyword ngxDirective pop3_auth syn keyword ngxDirective pop3_auth
syn keyword ngxDirective pop3_capabilities syn keyword ngxDirective pop3_capabilities
syn keyword ngxDirective port_in_redirect syn keyword ngxDirective port_in_redirect
syn keyword ngxDirective post_acceptex
syn keyword ngxDirective postpone_gzipping syn keyword ngxDirective postpone_gzipping
syn keyword ngxDirective postpone_output syn keyword ngxDirective postpone_output
syn keyword ngxDirective protocol syn keyword ngxDirective protocol
@@ -237,22 +278,33 @@ syn keyword ngxDirective proxy_buffering
syn keyword ngxDirective proxy_buffers syn keyword ngxDirective proxy_buffers
syn keyword ngxDirective proxy_busy_buffers_size syn keyword ngxDirective proxy_busy_buffers_size
syn keyword ngxDirective proxy_cache syn keyword ngxDirective proxy_cache
syn keyword ngxDirective proxy_cache_bypass
syn keyword ngxDirective proxy_cache_key syn keyword ngxDirective proxy_cache_key
syn keyword ngxDirective proxy_cache_lock
syn keyword ngxDirective proxy_cache_lock_timeout
syn keyword ngxDirective proxy_cache_methods syn keyword ngxDirective proxy_cache_methods
syn keyword ngxDirective proxy_cache_min_uses syn keyword ngxDirective proxy_cache_min_uses
syn keyword ngxDirective proxy_cache_path syn keyword ngxDirective proxy_cache_path
syn keyword ngxDirective proxy_cache_revalidate
syn keyword ngxDirective proxy_cache_use_stale syn keyword ngxDirective proxy_cache_use_stale
syn keyword ngxDirective proxy_cache_valid syn keyword ngxDirective proxy_cache_valid
syn keyword ngxDirective proxy_connect_timeout syn keyword ngxDirective proxy_connect_timeout
syn keyword ngxDirective proxy_cookie_domain
syn keyword ngxDirective proxy_cookie_path
syn keyword ngxDirective proxy_force_ranges
syn keyword ngxDirective proxy_headers_hash_bucket_size syn keyword ngxDirective proxy_headers_hash_bucket_size
syn keyword ngxDirective proxy_headers_hash_max_size syn keyword ngxDirective proxy_headers_hash_max_size
syn keyword ngxDirective proxy_hide_header syn keyword ngxDirective proxy_hide_header
syn keyword ngxDirective proxy_http_version
syn keyword ngxDirective proxy_ignore_client_abort syn keyword ngxDirective proxy_ignore_client_abort
syn keyword ngxDirective proxy_ignore_headers syn keyword ngxDirective proxy_ignore_headers
syn keyword ngxDirective proxy_intercept_errors syn keyword ngxDirective proxy_intercept_errors
syn keyword ngxDirective proxy_max_temp_file_size syn keyword ngxDirective proxy_max_temp_file_size
syn keyword ngxDirective proxy_method syn keyword ngxDirective proxy_method
syn keyword ngxDirective proxy_next_upstream syn keyword ngxDirective proxy_next_upstream
syn keyword ngxDirective proxy_next_upstream_timeout
syn keyword ngxDirective proxy_next_upstream_tries
syn keyword ngxDirective proxy_no_cache
syn keyword ngxDirective proxy_pass_error_message syn keyword ngxDirective proxy_pass_error_message
syn keyword ngxDirective proxy_pass_header syn keyword ngxDirective proxy_pass_header
syn keyword ngxDirective proxy_pass_request_body syn keyword ngxDirective proxy_pass_request_body
@@ -263,18 +315,27 @@ syn keyword ngxDirective proxy_send_lowat
syn keyword ngxDirective proxy_send_timeout syn keyword ngxDirective proxy_send_timeout
syn keyword ngxDirective proxy_set_body syn keyword ngxDirective proxy_set_body
syn keyword ngxDirective proxy_set_header syn keyword ngxDirective proxy_set_header
syn keyword ngxDirective proxy_ssl_ciphers
syn keyword ngxDirective proxy_ssl_crl
syn keyword ngxDirective proxy_ssl_name
syn keyword ngxDirective proxy_ssl_protocols
syn keyword ngxDirective proxy_ssl_server_name
syn keyword ngxDirective proxy_ssl_session_reuse syn keyword ngxDirective proxy_ssl_session_reuse
syn keyword ngxDirective proxy_ssl_trusted_certificate
syn keyword ngxDirective proxy_ssl_verify
syn keyword ngxDirective proxy_ssl_verify_depth
syn keyword ngxDirective proxy_store syn keyword ngxDirective proxy_store
syn keyword ngxDirective proxy_store_access syn keyword ngxDirective proxy_store_access
syn keyword ngxDirective proxy_temp_file_write_size syn keyword ngxDirective proxy_temp_file_write_size
syn keyword ngxDirective proxy_temp_path syn keyword ngxDirective proxy_temp_path
syn keyword ngxDirective proxy_timeout syn keyword ngxDirective proxy_timeout
syn keyword ngxDirective proxy_upstream_fail_timeout
syn keyword ngxDirective proxy_upstream_max_fails
syn keyword ngxDirective random_index syn keyword ngxDirective random_index
syn keyword ngxDirective read_ahead syn keyword ngxDirective read_ahead
syn keyword ngxDirective real_ip_header syn keyword ngxDirective real_ip_header
syn keyword ngxDirective real_ip_recursive
syn keyword ngxDirective recursive_error_pages syn keyword ngxDirective recursive_error_pages
syn keyword ngxDirective referer_hash_bucket_size
syn keyword ngxDirective referer_hash_max_size
syn keyword ngxDirective request_pool_size syn keyword ngxDirective request_pool_size
syn keyword ngxDirective reset_timedout_connection syn keyword ngxDirective reset_timedout_connection
syn keyword ngxDirective resolver syn keyword ngxDirective resolver
@@ -285,6 +346,45 @@ syn keyword ngxDirective rtsig_overflow_test
syn keyword ngxDirective rtsig_overflow_threshold syn keyword ngxDirective rtsig_overflow_threshold
syn keyword ngxDirective rtsig_signo syn keyword ngxDirective rtsig_signo
syn keyword ngxDirective satisfy syn keyword ngxDirective satisfy
syn keyword ngxDirective scgi_bind
syn keyword ngxDirective scgi_buffer_size
syn keyword ngxDirective scgi_buffering
syn keyword ngxDirective scgi_buffers
syn keyword ngxDirective scgi_busy_buffers_size
syn keyword ngxDirective scgi_cache
syn keyword ngxDirective scgi_cache_bypass
syn keyword ngxDirective scgi_cache_key
syn keyword ngxDirective scgi_cache_lock
syn keyword ngxDirective scgi_cache_lock_timeout
syn keyword ngxDirective scgi_cache_methods
syn keyword ngxDirective scgi_cache_min_uses
syn keyword ngxDirective scgi_cache_path
syn keyword ngxDirective scgi_cache_revalidate
syn keyword ngxDirective scgi_cache_use_stale
syn keyword ngxDirective scgi_cache_valid
syn keyword ngxDirective scgi_connect_timeout
syn keyword ngxDirective scgi_force_ranges
syn keyword ngxDirective scgi_hide_header
syn keyword ngxDirective scgi_ignore_client_abort
syn keyword ngxDirective scgi_ignore_headers
syn keyword ngxDirective scgi_intercept_errors
syn keyword ngxDirective scgi_max_temp_file_size
syn keyword ngxDirective scgi_next_upstream
syn keyword ngxDirective scgi_next_upstream_timeout
syn keyword ngxDirective scgi_next_upstream_tries
syn keyword ngxDirective scgi_no_cache
syn keyword ngxDirective scgi_param
syn keyword ngxDirective scgi_pass_header
syn keyword ngxDirective scgi_pass_request_body
syn keyword ngxDirective scgi_pass_request_headers
syn keyword ngxDirective scgi_read_timeout
syn keyword ngxDirective scgi_send_timeout
syn keyword ngxDirective scgi_store
syn keyword ngxDirective scgi_store_access
syn keyword ngxDirective scgi_temp_file_write_size
syn keyword ngxDirective scgi_temp_path
syn keyword ngxDirective secure_link
syn keyword ngxDirective secure_link_md5
syn keyword ngxDirective secure_link_secret syn keyword ngxDirective secure_link_secret
syn keyword ngxDirective send_lowat syn keyword ngxDirective send_lowat
syn keyword ngxDirective send_timeout syn keyword ngxDirective send_timeout
@@ -299,31 +399,50 @@ syn keyword ngxDirective smtp_auth
syn keyword ngxDirective smtp_capabilities syn keyword ngxDirective smtp_capabilities
syn keyword ngxDirective smtp_client_buffer syn keyword ngxDirective smtp_client_buffer
syn keyword ngxDirective smtp_greeting_delay syn keyword ngxDirective smtp_greeting_delay
syn keyword ngxDirective so_keepalive
syn keyword ngxDirective source_charset syn keyword ngxDirective source_charset
syn keyword ngxDirective spdy_chunk_size
syn keyword ngxDirective spdy_headers_comp
syn keyword ngxDirective spdy_keepalive_timeout
syn keyword ngxDirective spdy_max_concurrent_streams
syn keyword ngxDirective spdy_pool_size
syn keyword ngxDirective spdy_recv_buffer_size
syn keyword ngxDirective spdy_recv_timeout
syn keyword ngxDirective spdy_streams_index_size
syn keyword ngxDirective ssi syn keyword ngxDirective ssi
syn keyword ngxDirective ssi_ignore_recycled_buffers syn keyword ngxDirective ssi_ignore_recycled_buffers
syn keyword ngxDirective ssi_last_modified
syn keyword ngxDirective ssi_min_file_chunk syn keyword ngxDirective ssi_min_file_chunk
syn keyword ngxDirective ssi_silent_errors syn keyword ngxDirective ssi_silent_errors
syn keyword ngxDirective ssi_types syn keyword ngxDirective ssi_types
syn keyword ngxDirective ssi_value_length syn keyword ngxDirective ssi_value_length
syn keyword ngxDirective ssl syn keyword ngxDirective ssl
syn keyword ngxDirective ssl_buffer_size
syn keyword ngxDirective ssl_certificate syn keyword ngxDirective ssl_certificate
syn keyword ngxDirective ssl_certificate_key syn keyword ngxDirective ssl_certificate_key
syn keyword ngxDirective ssl_ciphers syn keyword ngxDirective ssl_ciphers
syn keyword ngxDirective ssl_client_certificate syn keyword ngxDirective ssl_client_certificate
syn keyword ngxDirective ssl_crl syn keyword ngxDirective ssl_crl
syn keyword ngxDirective ssl_dhparam syn keyword ngxDirective ssl_dhparam
syn keyword ngxDirective ssl_ecdh_curve
syn keyword ngxDirective ssl_engine syn keyword ngxDirective ssl_engine
syn keyword ngxDirective ssl_password_file
syn keyword ngxDirective ssl_prefer_server_ciphers syn keyword ngxDirective ssl_prefer_server_ciphers
syn keyword ngxDirective ssl_protocols syn keyword ngxDirective ssl_protocols
syn keyword ngxDirective ssl_session_cache syn keyword ngxDirective ssl_session_cache
syn keyword ngxDirective ssl_session_ticket_key
syn keyword ngxDirective ssl_session_tickets
syn keyword ngxDirective ssl_session_timeout syn keyword ngxDirective ssl_session_timeout
syn keyword ngxDirective ssl_stapling
syn keyword ngxDirective ssl_stapling_file
syn keyword ngxDirective ssl_stapling_responder
syn keyword ngxDirective ssl_stapling_verify
syn keyword ngxDirective ssl_trusted_certificate
syn keyword ngxDirective ssl_verify_client syn keyword ngxDirective ssl_verify_client
syn keyword ngxDirective ssl_verify_depth syn keyword ngxDirective ssl_verify_depth
syn keyword ngxDirective starttls syn keyword ngxDirective starttls
syn keyword ngxDirective stub_status syn keyword ngxDirective stub_status
syn keyword ngxDirective sub_filter syn keyword ngxDirective sub_filter
syn keyword ngxDirective sub_filter_last_modified
syn keyword ngxDirective sub_filter_once syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay syn keyword ngxDirective tcp_nodelay
@@ -345,9 +464,59 @@ syn keyword ngxDirective userid_name
syn keyword ngxDirective userid_p3p syn keyword ngxDirective userid_p3p
syn keyword ngxDirective userid_path syn keyword ngxDirective userid_path
syn keyword ngxDirective userid_service syn keyword ngxDirective userid_service
syn keyword ngxDirective uwsgi_bind
syn keyword ngxDirective uwsgi_buffer_size
syn keyword ngxDirective uwsgi_buffering
syn keyword ngxDirective uwsgi_buffers
syn keyword ngxDirective uwsgi_busy_buffers_size
syn keyword ngxDirective uwsgi_cache
syn keyword ngxDirective uwsgi_cache_bypass
syn keyword ngxDirective uwsgi_cache_key
syn keyword ngxDirective uwsgi_cache_lock
syn keyword ngxDirective uwsgi_cache_lock_timeout
syn keyword ngxDirective uwsgi_cache_methods
syn keyword ngxDirective uwsgi_cache_min_uses
syn keyword ngxDirective uwsgi_cache_path
syn keyword ngxDirective uwsgi_cache_revalidate
syn keyword ngxDirective uwsgi_cache_use_stale
syn keyword ngxDirective uwsgi_cache_valid
syn keyword ngxDirective uwsgi_connect_timeout
syn keyword ngxDirective uwsgi_force_ranges
syn keyword ngxDirective uwsgi_hide_header
syn keyword ngxDirective uwsgi_ignore_client_abort
syn keyword ngxDirective uwsgi_ignore_headers
syn keyword ngxDirective uwsgi_intercept_errors
syn keyword ngxDirective uwsgi_max_temp_file_size
syn keyword ngxDirective uwsgi_modifier1
syn keyword ngxDirective uwsgi_modifier2
syn keyword ngxDirective uwsgi_next_upstream
syn keyword ngxDirective uwsgi_next_upstream_timeout
syn keyword ngxDirective uwsgi_next_upstream_tries
syn keyword ngxDirective uwsgi_no_cache
syn keyword ngxDirective uwsgi_param
syn keyword ngxDirective uwsgi_pass_header
syn keyword ngxDirective uwsgi_pass_request_body
syn keyword ngxDirective uwsgi_pass_request_headers
syn keyword ngxDirective uwsgi_read_timeout
syn keyword ngxDirective uwsgi_send_timeout
syn keyword ngxDirective uwsgi_ssl_ciphers
syn keyword ngxDirective uwsgi_ssl_crl
syn keyword ngxDirective uwsgi_ssl_name
syn keyword ngxDirective uwsgi_ssl_protocols
syn keyword ngxDirective uwsgi_ssl_server_name
syn keyword ngxDirective uwsgi_ssl_session_reuse
syn keyword ngxDirective uwsgi_ssl_trusted_certificate
syn keyword ngxDirective uwsgi_ssl_verify
syn keyword ngxDirective uwsgi_ssl_verify_depth
syn keyword ngxDirective uwsgi_store
syn keyword ngxDirective uwsgi_store_access
syn keyword ngxDirective uwsgi_string
syn keyword ngxDirective uwsgi_temp_file_write_size
syn keyword ngxDirective uwsgi_temp_path
syn keyword ngxDirective valid_referers syn keyword ngxDirective valid_referers
syn keyword ngxDirective variables_hash_bucket_size syn keyword ngxDirective variables_hash_bucket_size
syn keyword ngxDirective variables_hash_max_size syn keyword ngxDirective variables_hash_max_size
syn keyword ngxDirective worker_aio_requests
syn keyword ngxDirective worker_connections syn keyword ngxDirective worker_connections
syn keyword ngxDirective worker_cpu_affinity syn keyword ngxDirective worker_cpu_affinity
syn keyword ngxDirective worker_priority syn keyword ngxDirective worker_priority
@@ -359,6 +528,9 @@ syn keyword ngxDirective worker_threads
syn keyword ngxDirective working_directory syn keyword ngxDirective working_directory
syn keyword ngxDirective xclient syn keyword ngxDirective xclient
syn keyword ngxDirective xml_entities syn keyword ngxDirective xml_entities
syn keyword ngxDirective xslt_last_modified
syn keyword ngxDirective xslt_param
syn keyword ngxDirective xslt_string_param
syn keyword ngxDirective xslt_stylesheet syn keyword ngxDirective xslt_stylesheet
syn keyword ngxDirective xslt_types syn keyword ngxDirective xslt_types
@@ -370,7 +542,7 @@ syn keyword ngxDirective xslt_types
syn keyword ngxDirectiveThirdParty set_from_accept_language syn keyword ngxDirectiveThirdParty set_from_accept_language
" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule> " Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key. " Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveThirdParty accesskey syn keyword ngxDirectiveThirdParty accesskey
syn keyword ngxDirectiveThirdParty accesskey_arg syn keyword ngxDirectiveThirdParty accesskey_arg
syn keyword ngxDirectiveThirdParty accesskey_hashmethod syn keyword ngxDirectiveThirdParty accesskey_hashmethod
@@ -524,7 +696,7 @@ syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
syn keyword ngxDirectiveThirdParty mogilefs_tracker syn keyword ngxDirectiveThirdParty mogilefs_tracker
" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite> " MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL. " Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
syn keyword ngxDirectiveThirdParty mp4 syn keyword ngxDirectiveThirdParty mp4
" Nginx Notice Module <http://xph.us/software/nginx-notice/> " Nginx Notice Module <http://xph.us/software/nginx-notice/>

View File

@@ -424,7 +424,7 @@ if exists("perl_fold")
endif endif
if exists("perl_fold_blocks") if exists("perl_fold_blocks")
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
endif endif

View File

@@ -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

View File

@@ -88,6 +88,7 @@ syn keyword pythonStatement exec return
syn keyword pythonStatement pass raise syn keyword pythonStatement pass raise
syn keyword pythonStatement global assert syn keyword pythonStatement global assert
syn keyword pythonStatement lambda yield syn keyword pythonStatement lambda yield
syn keyword pythonStatement async await
syn keyword pythonStatement with nonlocal True False None syn keyword pythonStatement with nonlocal True False None
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained
@@ -210,7 +211,7 @@ if exists("python_highlight_builtins") && python_highlight_builtins != 0
syn keyword pythonBuiltinObj Ellipsis NotImplemented syn keyword pythonBuiltinObj Ellipsis NotImplemented
syn keyword pythonBuiltinFunc __import__ abs all any apply syn keyword pythonBuiltinFunc __import__ abs all any apply
syn keyword pythonBuiltinFunc basestring bool buffer callable syn keyword pythonBuiltinFunc basestring bool buffer bytearray bytes callable
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
syn keyword pythonBuiltinFunc execfile file filter float frozenset getattr syn keyword pythonBuiltinFunc execfile file filter float frozenset getattr

137
syntax/qml.vim Normal file
View File

@@ -0,0 +1,137 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim syntax file
" Language: QML
" Maintainer: Warwick Allison <warwick.allison@nokia.com>
" Updaters:
" URL:
" Changes:
" Last Change: 2009 Apr 30
" Based on javascript syntax (as is QML)
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'qml'
endif
" Drop fold if it set but vim doesn't support it.
if version < 600 && exists("qml_fold")
unlet qml_fold
endif
syn case ignore
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold
syn match qmlSpecial "\\\d\d\d\|\\."
syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc
syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc
syn match qmlCharacter "'\\.'"
syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
syn match qmlNonBindingColon "?[^;]*:"
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
syn keyword qmlConditional if else switch
syn keyword qmlRepeat while for do in
syn keyword qmlBranch break continue
syn keyword qmlOperator new delete instanceof typeof
syn keyword qmlJsType Array Boolean Date Function Number Object String RegExp
syn keyword qmlType action alias bool color date double enumeration font int list point real rect size string time url variant vector3d
syn keyword qmlStatement return with
syn keyword qmlBoolean true false
syn keyword qmlNull null undefined
syn keyword qmlIdentifier arguments this var
syn keyword qmlLabel case default
syn keyword qmlException try catch finally throw
syn keyword qmlMessage alert confirm prompt status
syn keyword qmlGlobal self
syn keyword qmlDeclaration property signal
syn keyword qmlReserved abstract boolean byte char class const debugger enum export extends final float goto implements import interface long native package pragma private protected public short static super synchronized throws transient volatile
if get(g:, 'qml_fold', 0)
syn match qmlFunction "\<function\>"
syn region qmlFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
syn sync match qmlSync grouphere qmlFunctionFold "\<function\>"
syn sync match qmlSync grouphere NONE "^}"
setlocal foldmethod=syntax
setlocal foldtext=getline(v:foldstart)
else
syn keyword qmlFunction function
syn match qmlBraces "[{}\[\]]"
syn match qmlParens "[()]"
endif
syn sync fromstart
syn sync maxlines=100
if main_syntax == "qml"
syn sync ccomment qmlComment
endif
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_qml_syn_inits")
if version < 508
let did_qml_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink qmlComment Comment
HiLink qmlLineComment Comment
HiLink qmlCommentTodo Todo
HiLink qmlSpecial Special
HiLink qmlStringS String
HiLink qmlStringD String
HiLink qmlCharacter Character
HiLink qmlNumber Number
HiLink qmlConditional Conditional
HiLink qmlRepeat Repeat
HiLink qmlBranch Conditional
HiLink qmlOperator Operator
HiLink qmlJsType Type
HiLink qmlType Type
HiLink qmlObjectLiteralType Type
HiLink qmlStatement Statement
HiLink qmlFunction Function
HiLink qmlBraces Function
HiLink qmlError Error
HiLink qmlNull Keyword
HiLink qmlBoolean Boolean
HiLink qmlRegexpString String
HiLink qmlIdentifier Identifier
HiLink qmlLabel Label
HiLink qmlException Exception
HiLink qmlMessage Keyword
HiLink qmlGlobal Keyword
HiLink qmlReserved Keyword
HiLink qmlDebug Debug
HiLink qmlConstant Label
HiLink qmlNonBindingColon NONE
HiLink qmlBindingProperty Label
HiLink qmlDeclaration Function
delcommand HiLink
endif
let b:current_syntax = "qml"
if main_syntax == 'qml'
unlet main_syntax
endif
endif

View File

@@ -32,7 +32,7 @@ endif
" Operators " Operators
if exists("ruby_operators") if exists("ruby_operators")
syn match rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::" syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
endif endif
@@ -82,13 +82,13 @@ syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedPare
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
" Numbers and ASCII Codes " Numbers and ASCII Codes
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\>" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\>" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*\>" display syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display
" Identifiers " Identifiers
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
@@ -98,7 +98,7 @@ syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>
syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)"
syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"
syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\="
@@ -125,20 +125,19 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|o
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
" Generalized Regular Expression " Generalized Regular Expression
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
" Normal String and Shell Command Output " Normal String
if exists('ruby_spellcheck_strings') let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" fold contains=@rubyStringSpecial' . s:spell_cluster
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" fold contains=rubyQuoteEscape' . s:spell_cluster
else
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold " Shell Command Output
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
endif
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
" Generalized Single Quoted String, Symbol and Array of Strings " Generalized Single Quoted String, Symbol and Array of Strings
@@ -147,12 +146,13 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
" Generalized Double Quoted String and Array of Strings and Shell Command Output " Generalized Double Quoted String and Array of Strings and Shell Command Output
" Note: %= is not matched here as the beginning of a double quoted string " Note: %= is not matched here as the beginning of a double quoted string
@@ -162,7 +162,7 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" en
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
" Array of Symbols " Array of Symbols
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
@@ -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
@@ -205,7 +205,7 @@ syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyC
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
@@ -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
@@ -289,7 +289,7 @@ syn match rubySharpBang "\%^#!.*" display
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
if !exists("ruby_no_comment_fold") if !exists("ruby_no_comment_fold")
syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
else else
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell

View File

@@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Maintainer: Patrick Walton <pcwalton@mozilla.com> " Maintainer: Patrick Walton <pcwalton@mozilla.com>
" Maintainer: Ben Blum <bblum@cs.cmu.edu> " Maintainer: Ben Blum <bblum@cs.cmu.edu>
" Maintainer: Chris Morgan <me@chrismorgan.info> " Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: January 5, 2015 " Last Change: January 29, 2015
if version < 600 if version < 600
syntax clear syntax clear
@@ -26,9 +26,9 @@ syn keyword rustKeyword continue
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword for in if impl let syn keyword rustKeyword for in if impl let
syn keyword rustKeyword loop once pub syn keyword rustKeyword loop pub
syn keyword rustKeyword return super syn keyword rustKeyword return super
syn keyword rustKeyword unsafe virtual where while syn keyword rustKeyword unsafe where while
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
" FIXME: Scoped impl's name is also fallen in this category " FIXME: Scoped impl's name is also fallen in this category
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
@@ -45,7 +45,6 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
syn keyword rustBoxPlacementExpr GC containedin=rustBoxPlacement
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since " Ideally we'd have syntax rules set up to match arbitrary expressions. Since
" we don't, we'll just define temporary contained rules to handle balancing " we don't, we'll just define temporary contained rules to handle balancing
" delimiters. " delimiters.
@@ -58,13 +57,13 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+" syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2 " Reserved (but not yet used) keywords {{{2
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro
" Built-in types {{{2 " Built-in types {{{2
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32 syn keyword rustType isize usize char bool u8 u16 u32 u64 f32
syn keyword rustType f64 i8 i16 i32 i64 str Self syn keyword rustType f64 i8 i16 i32 i64 str Self
" Things from the prelude (src/libstd/prelude.rs) {{{2 " Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
" This section is just straight transformation of the contents of the prelude, " This section is just straight transformation of the contents of the prelude,
" to make it easy to update. " to make it easy to update.
@@ -73,30 +72,27 @@ syn keyword rustTrait Copy Send Sized Sync
syn keyword rustTrait Drop Fn FnMut FnOnce syn keyword rustTrait Drop Fn FnMut FnOnce
" Reexported functions {{{3 " Reexported functions {{{3
syn keyword rustFunction drop " Theres no point in highlighting these; when one writes drop( or drop::< it
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
" dont really want *that* drop to be highlighted.
"syn keyword rustFunction drop
" Reexported types and traits {{{3 " Reexported types and traits {{{3
syn keyword rustTrait Box syn keyword rustTrait Box
syn keyword rustTrait CharExt syn keyword rustTrait ToOwned
syn keyword rustTrait Clone syn keyword rustTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord syn keyword rustTrait PartialEq PartialOrd Eq Ord
syn keyword rustTrait DoubleEndedIterator syn keyword rustTrait AsRef AsMut Into From
syn keyword rustTrait ExactSizeIterator syn keyword rustTrait Default
syn keyword rustTrait Iterator IteratorExt Extend syn keyword rustTrait Iterator Extend IntoIterator
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
syn keyword rustEnum Option syn keyword rustEnum Option
syn keyword rustEnumVariant Some None syn keyword rustEnumVariant Some None
syn keyword rustTrait PtrExt MutPtrExt
syn keyword rustEnum Result syn keyword rustEnum Result
syn keyword rustEnumVariant Ok Err syn keyword rustEnumVariant Ok Err
syn keyword rustTrait AsSlice syn keyword rustTrait SliceConcatExt
syn keyword rustTrait SliceExt SliceConcatExt
syn keyword rustTrait Str StrExt
syn keyword rustTrait String ToString syn keyword rustTrait String ToString
syn keyword rustTrait Vec syn keyword rustTrait Vec
" FIXME: remove when path reform lands
syn keyword rustTrait Path GenericPath
" FIXME: remove when I/O reform lands
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
" Other syntax {{{2 " Other syntax {{{2
syn keyword rustSelf self syn keyword rustSelf self
@@ -122,6 +118,9 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
" This isn't actually correct; a closure with no arguments can be `|| { }`. " This isn't actually correct; a closure with no arguments can be `|| { }`.
" Last, because the & in && isn't a sigil " Last, because the & in && isn't a sigil
syn match rustOperator display "&&\|||" syn match rustOperator display "&&\|||"
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
syn match rustArrowCharacter display "->"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
@@ -136,13 +135,16 @@ syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEs
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
syn region rustDerive start="derive(" end=")" contained contains=rustTrait syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
" This list comes from src/libsyntax/ext/deriving/mod.rs
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
" Number literals " Number literals
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\=" syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\=" syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
" Special case for numbers of the form "1." which are float literals, unless followed by " Special case for numbers of the form "1." which are float literals, unless followed by
" an identifier, which makes them integer literals with a method call or field access, " an identifier, which makes them integer literals with a method call or field access,
@@ -168,6 +170,7 @@ syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:g
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
syn match rustShebang /\%^#![^[].*/
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
@@ -200,6 +203,7 @@ hi def link rustOctNumber rustNumber
hi def link rustBinNumber rustNumber hi def link rustBinNumber rustNumber
hi def link rustIdentifierPrime rustIdentifier hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType hi def link rustTrait rustType
hi def link rustDeriveTrait rustTrait
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro hi def link rustMacroRepeatDelimiters Macro
@@ -220,6 +224,7 @@ hi def link rustEnumVariant rustConstant
hi def link rustConstant Constant hi def link rustConstant Constant
hi def link rustSelf Constant hi def link rustSelf Constant
hi def link rustFloat Float hi def link rustFloat Float
hi def link rustArrowCharacter rustOperator
hi def link rustOperator Operator hi def link rustOperator Operator
hi def link rustKeyword Keyword hi def link rustKeyword Keyword
hi def link rustReservedKeyword Error hi def link rustReservedKeyword Error
@@ -231,6 +236,7 @@ hi def link rustModPathSep Delimiter
hi def link rustFunction Function hi def link rustFunction Function
hi def link rustFuncName Function hi def link rustFuncName Function
hi def link rustFuncCall Function hi def link rustFuncCall Function
hi def link rustShebang Comment
hi def link rustCommentLine Comment hi def link rustCommentLine Comment
hi def link rustCommentLineDoc SpecialComment hi def link rustCommentLineDoc SpecialComment
hi def link rustCommentBlock rustCommentLine hi def link rustCommentBlock rustCommentLine
@@ -249,7 +255,6 @@ hi def link rustInvalidBareKeyword Error
hi def link rustExternCrate rustKeyword hi def link rustExternCrate rustKeyword
hi def link rustObsoleteExternMod Error hi def link rustObsoleteExternMod Error
hi def link rustBoxPlacementParens Delimiter hi def link rustBoxPlacementParens Delimiter
hi def link rustBoxPlacementExpr rustKeyword
" Other Suggestions: " Other Suggestions:
" hi rustAttribute ctermfg=cyan " hi rustAttribute ctermfg=cyan

8
syntax/semhl.vim Normal file
View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" syntax match javascriptIdentifierName /\<[^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^0-9][^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^]*/ nextgroup=javascriptDotNotation,javascriptFuncCallArg,javascriptComputedProperty,javascriptWSymbols contains=@_smantic
syntax cluster _semantic contains=_semantic0,_semantic1,_semantic2,_semantic3,_semantic4,_semantic5,_semantic6,_semantic7,_semantic8,_semantic9,_semantic10,_semantic11,_semantic12,_semantic13,_semantic14,_semantic15,_semantic16,_semantic17,_semantic18,_semantic19,_semantic20,_semantic21,_semantic22,_semantic23,_semantic24,_semantic25
endif

View File

@@ -1,68 +1,229 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
" Language: Swift<https://developer.apple.com/swift/> " File: swift.vim
" Maintainer: toyama satoshi <toyamarinyon@gmail.com> " Author: Keith Smiley
" URL: http://github.com/toyamarinyon/vim-swift " Description: Runtime files for Swift
" License: GPL " Last Modified: June 15, 2014
" Bail if our syntax is already loaded. if exists("b:current_syntax")
if exists('b:current_syntax') && b:current_syntax == 'swift'
finish finish
endif endif
" {{{ Whitespace and Comments " Comments
syntax region swiftComment start=#\/\*# end=#\*\/# " Shebang
syntax match swiftComment /\/\/.*/ syntax match swiftShebang "\v#!.*$"
" Comment contained keywords
syntax keyword swiftTodos contained TODO XXX FIXME NOTE
syntax keyword swiftMarker contained MARK
syntax match swiftDocString "\v^\s*-\s*parameter"hs=s+1 contained
syntax match swiftDocString "\v^\s*-\s*returns"hs=s+1 contained
" Literals
" Strings
syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper
syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString
syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper
" Numbers
syntax match swiftNumber "\v<\d+>"
syntax match swiftNumber "\v<(\d+_+)+\d+(\.\d+(_+\d+)*)?>"
syntax match swiftNumber "\v<\d+\.\d+>"
syntax match swiftNumber "\v<\d*\.?\d+([Ee]-?)?\d+>"
syntax match swiftNumber "\v<0x\x+([Pp]-?)?\x+>"
syntax match swiftNumber "\v<0b[01]+>"
syntax match swiftNumber "\v<0o\o+>"
" BOOLs
syntax keyword swiftBoolean
\ true
\ false
" Operators
syntax match swiftOperator "\v\~"
syntax match swiftOperator "\v\s+!"
syntax match swiftOperator "\v\%"
syntax match swiftOperator "\v\^"
syntax match swiftOperator "\v\&"
syntax match swiftOperator "\v\*"
syntax match swiftOperator "\v-"
syntax match swiftOperator "\v\+"
syntax match swiftOperator "\v\="
syntax match swiftOperator "\v\|"
syntax match swiftOperator "\v\/"
syntax match swiftOperator "\v\."
syntax match swiftOperator "\v\<"
syntax match swiftOperator "\v\>"
syntax match swiftOperator "\v\?\?"
" Methods/Functions
syntax match swiftMethod "\(\.\)\@<=\w\+\((\)\@="
" Swift closure arguments
syntax match swiftClosureArgument "\$\d\+\(\.\d\+\)\?"
syntax match swiftAvailability "\v((\*(\s*,\s*[a-zA-Z="0-9.]+)*)|(\w+\s+\d+(\.\d+(.\d+)?)?\s*,\s*)+\*)" contains=swiftString
syntax keyword swiftPlatforms OSX iOS watchOS OSXApplicationExtension iOSApplicationExtension contained containedin=swiftAvailability
syntax keyword swiftAvailabilityArg renamed unavailable introduced deprecated obsoleted message contained containedin=swiftAvailability
" Keywords {{{
syntax keyword swiftKeywords
\ as
\ atexit
\ break
\ case
\ catch
\ class
\ continue
\ convenience
\ default
\ defer
\ deinit
\ didSet
\ do
\ dynamic
\ else
\ extension
\ fallthrough
\ final
\ for
\ func
\ get
\ guard
\ if
\ import
\ in
\ indirect
\ infix
\ init
\ inout
\ internal
\ is
\ lazy
\ let
\ mutating
\ nil
\ nonmutating
\ operator
\ optional
\ override
\ postfix
\ prefix
\ private
\ protocol
\ public
\ repeat
\ required
\ rethrows
\ return
\ self
\ set
\ static
\ subscript
\ super
\ switch
\ throw
\ throws
\ try
\ typealias
\ unowned
\ var
\ weak
\ where
\ while
\ willSet
" }}}
" Names surrounded by backticks. This aren't limited to keywords because 1)
" Swift doesn't limit them to keywords and 2) I couldn't make the keywords not
" highlight at the same time
syntax region swiftEscapedReservedWord start="`" end="`" oneline
syntax keyword swiftAttributes
\ @assignment
\ @autoclosure
\ @available
\ @convention
\ @exported
\ @IBAction
\ @IBDesignable
\ @IBInspectable
\ @IBOutlet
\ @noescape
\ @nonobjc
\ @noreturn
\ @NSApplicationMain
\ @NSCopying
\ @NSManaged
\ @objc
\ @testable
\ @UIApplicationMain
\ @warn_unused_result
syntax keyword swiftConditionStatement #available
syntax keyword swiftStructure
\ struct
\ enum
syntax region swiftTypeWrapper start="\v:\s*" skip="\s*,\s*$*\s*" end="$" contains=swiftString,swiftBoolean,swiftNumber,swiftType,swiftGenericsWrapper transparent
syntax region swiftGenericsWrapper start="\v\<" end="\v\>" contains=swiftType transparent oneline
syntax region swiftLiteralWrapper start="\v\=\s*" skip="\v[^\[\]]\(\)" end="\v(\[\]|\(\))" contains=swiftType,swiftString transparent oneline
syntax region swiftReturnWrapper start="\v-\>\s*" end="\v(\{|$)" contains=swiftType transparent oneline
syntax match swiftType "\v<\u\w*" contained containedin=swiftGenericsWrapper,swiftTypeWrapper,swiftLiteralWrapper,swiftGenericsWrapper
syntax keyword swiftImports import
" 'preprocesor' stuff
syntax keyword swiftPreprocessor
\ #if
\ #elseif
\ #else
\ #endif
" Comment patterns
syntax match swiftComment "\v\/\/.*$"
\ contains=swiftTodos,swiftDocString,swiftMarker,@Spell oneline
syntax region swiftComment start="/\*" end="\*/"
\ contains=swiftTodos,swiftDocString,swiftMarker,swiftComment,@Spell fold
" Set highlights
highlight default link swiftTodos Todo
highlight default link swiftDocString String
highlight default link swiftShebang Comment
highlight default link swiftComment Comment highlight default link swiftComment Comment
" }}} highlight default link swiftMarker Comment
" {{{ Identifiers highlight default link swiftString String
syntax match swiftIdentifier /[[:alpha:]_][[:alnum:]_]*/ highlight default link swiftInterpolatedWrapper Delimiter
highlight default link swiftIdentifier Identifier highlight default link swiftNumber Number
" }}} highlight default link swiftBoolean Boolean
" {{{ Keywords highlight default link swiftOperator Operator
" Keywords used in declarations: highlight default link swiftKeywords Keyword
syntax keyword swiftDeclarationKeywords class deinit enum extension func import init let protocol static struct subscript typealias var highlight default link swiftEscapedReservedWord Normal
highlight default link swiftDeclarationKeywords Keyword highlight default link swiftClosureArgument Operator
" Keywords used in statements: highlight default link swiftAttributes PreProc
syntax keyword swiftStatementKeywords break case continue default do else fallthrough if in for return switch where while highlight default link swiftConditionStatement PreProc
highlight default link swiftStatementKeywords Keyword highlight default link swiftStructure Structure
" Keywords used in expressions and types: highlight default link swiftType Type
syntax keyword swiftExpressionTypeKeywords as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__ highlight default link swiftImports Include
highlight default link swiftExpressionTypeKeywords Keyword highlight default link swiftPreprocessor PreProc
" Keywords reserved in particular contexts: highlight default link swiftMethod Function
syntax keyword swiftReserveKeywords associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned unowned(safe) unowned(unsafe) weak willSet
highlight default link swiftReserveKeywords Keyword
" }}}
" {{{ Literals highlight default link swiftConditionStatement PreProc
" Integer literal highlight default link swiftAvailability Normal
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\>/ highlight default link swiftAvailabilityArg Normal
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>/ highlight default link swiftPlatforms Keyword
syntax match swiftIntegerLiteral /\<0x\x\+\%(_\x\+\)*\>/
syntax match swiftIntegerLiteral /\<0o\o\+\%(_\o\+\)*\>/
syntax match swiftIntegerLiteral /\<0b[01]\+\%(_[01]\+\)*\>/
highlight default link swiftIntegerLiteral Number
" String literal
syntax region swiftStringLiteral start=/"/ skip=/\\"/ end=/"/
highlight default link swiftStringLiteral String
" }}}
" {{{ Operators " Force vim to sync at least x lines. This solves the multiline comment not
syntax keyword swiftOperatorKeywords / = - + ! * % < > & \| ^ ~ . " being highlighted issue
highlight default link swiftOperatorKeywords Operator syn sync minlines=100
" }}}
" {{{ Type let b:current_syntax = "swift"
syntax match swiftTypeIdentifier /\<[[:alpha:]_][[:alnum:]_.]*/ contained
syntax match swiftType /: .*/ contains=swiftTypeIdentifier
highlight default link swiftType Operator
highlight default link swiftTypeIdentifier Type
" }}}
if !exists('b:current_syntax')
let b:current_syntax = 'swift'
endif
endif endif

View File

@@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
" Language: TOML " Language: TOML
" Maintainer: Caleb Spare <cespare@gmail.com> " Maintainer: Caleb Spare <cespare@gmail.com>
" URL: http://github.com/cespare/vim-toml " URL: https://github.com/cespare/vim-toml
" LICENSE: MIT " LICENSE: MIT
if exists("b:current_syntax") if exists("b:current_syntax")
@@ -27,16 +27,17 @@ 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
hi def link tomlBoolean Boolean hi def link tomlBoolean Boolean
" http://tools.ietf.org/html/rfc3339 " https://tools.ietf.org/html/rfc3339
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display
hi def link tomlDate Constant hi def link tomlDate Constant

110
syntax/vcl.vim Normal file
View File

@@ -0,0 +1,110 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
" Vim syntax file
" Filename: vcl.vim
" Language: Varnish configuation Language, http://www.varnish-cache.org/wiki/VCL
" Maintainer: Elan Ruusamäe <glen@delfi.ee>
" Version Info: $Revision: 1.7 $
" Last Change: $Date: 2010/04/06 08:24:28 $ UTC
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" TODO
" - sub ...
" - backend/director/...
" - acl ...
" - error when invalid operator used in if (...)
" - +=, = operators
" - functions
" Code Blocks
" sub NAME {
" backend NAME {
" director NAME FLAGS {
" acl NAME {
"syn region vclCodeBlock start="\s*\<sub\|backend\|director\|acl\>" end="{"he=e-1 contains=vclCodeBlockName,vclFunctionName
"syn match vclCodeBlockName "\<sub\|backend\|director\|acl\>" contained
"syn match vclFunctionName "\h[[:alnum:]_:]*" contained
"syn match vclFunctionName "\h\w*[^:]" contained
"
syn keyword vclOperator set call return error esi synthetic include remove unset
" return modes
syn keyword vclModes deliver pipe pass hash lookup discard fetch restart
" C strings
syn region vclString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=vclSpecial
syn match vclSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
syn match vclSpecialError "L\='\\[^'\"?\\abfnrtv]'"
syn match vclSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
syn match vclSpecialCharacter display "L\='\\\o\{1,3}'"
syn match vclSpecialCharacter display "'\\x\x\{1,2}'"
syn match vclSpecialCharacter display "L'\\x\x\+'"
syn keyword vclConditional if else elsif elseif
" Numbers
syn match vclNumbers display transparent "\<\d\|\.\d" contains=vclNumber,vclNumberTime
syn match vclNumber display contained "\d\+"
" set obj.ttl = 0s, 0m;
syn match vclNumberTime display contained "\d\+[dhsm]"
" client
syn match vclOption /client\.\(ip\|identity\)/
" server
syn match vclOption /server\.\(ip\|port\)/
" req
syn match vclOption /req\.\(hash\|request\|method\|url\|proto\|backend\healthy\|backend\|grace\|xid\|restarts\)/
" bereq
syn match vclOption /bereq\.\(request\|method\|url\|proto\|connect_timeout\|first_byte_timeout\|between_bytes_timeout\)/
" beresp
syn match vclOption /beresp\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\|saintmode\|keep\)/
" obj
syn match vclOption /obj\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\)/
" resp
syn match vclOption /resp\.\(proto\|status\|response\)/
" common: http.HEADERNAME
syn match vclOption /\(req\|bereq\|resp\|beresp\|obj\)\.http\.[A-Za-z][-_A-Za-z0-9]*/
" Highlight the C block
syn include @vclC syntax/c.vim
unlet b:current_syntax
" Mark block tags itself as comment
syn region vclCBlock matchgroup=vclComment start=/C{/ end=/}C/ contains=@vclC keepend
" Synthetic
syn region vclSynthetic start=/{"/hs=s+2 end=/"}/he=e-2 contains=@vclHTML keepend
" Allow html in synthetic
syn include @vclHTML syntax/html.vim
unlet b:current_syntax
syn match vclComment '#.*'
syn match vclComment "//.*"
syn region vclComment start="/\*" end="\*/"
syn sync ccomment vclComment
hi link vclCodeBlock Function
hi link vclComment Comment
hi link vclStatement Statement
hi link vclFunctionName Identifier
hi link vclCodeBlockName Statement
hi link vclSpecial SpecialChar
hi link vclString String
hi link vclConditional Conditional
hi link vclSynthetic vclString
hi link vclSpecialCharacter vclSpecialSpecial
hi link vclOperator Operator
hi link vclModes Operator
hi link vclOption Identifier
hi link vclNumber Number
hi link vclNumberTime Number
endif

5
syntax/yajs/ecma-402.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Intl
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Array nextgroup=javascriptGlobalArrayDot,javascriptFuncCallArg
syntax match javascriptGlobalArrayDot /\./ contained nextgroup=javascriptArrayStaticMethod
endif

6
syntax/yajs/es6-date.vim Normal file
View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Date nextgroup=javascriptGlobalDateDot,javascriptFuncCallArg
syntax match javascriptGlobalDateDot /\./ contained nextgroup=javascriptDateStaticMethod
endif

View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Function
endif

6
syntax/yajs/es6-json.vim Normal file
View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal JSON nextgroup=javascriptGlobalJSONDot,javascriptFuncCallArg
syntax match javascriptGlobalJSONDot /\./ contained nextgroup=javascriptJSONStaticMethod
endif

5
syntax/yajs/es6-map.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Map WeakMap
endif

6
syntax/yajs/es6-math.vim Normal file
View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Math nextgroup=javascriptGlobalMathDot,javascriptFuncCallArg
syntax match javascriptGlobalMathDot /\./ contained nextgroup=javascriptMathStaticProp,javascriptMathStaticMethod
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Number nextgroup=javascriptGlobalNumberDot,javascriptFuncCallArg
syntax match javascriptGlobalNumberDot /\./ contained nextgroup=javascriptNumberStaticProp,javascriptNumberStaticMethod
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Object nextgroup=javascriptGlobalObjectDot,javascriptFuncCallArg
syntax match javascriptGlobalObjectDot /\./ contained nextgroup=javascriptObjectStaticMethod
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Promise nextgroup=javascriptGlobalPromiseDot,javascriptFuncCallArg
syntax match javascriptGlobalPromiseDot /\./ contained nextgroup=javascriptPromiseStaticMethod
endif

View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Proxy
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal RegExp nextgroup=javascriptGlobalRegExpDot,javascriptFuncCallArg
syntax match javascriptGlobalRegExpDot /\./ contained nextgroup=javascriptRegExpStaticProp
endif

5
syntax/yajs/es6-set.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Set WeakSet
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal String nextgroup=javascriptGlobalStringDot,javascriptFuncCallArg
syntax match javascriptGlobalStringDot /\./ contained nextgroup=javascriptStringStaticMethod
endif

View File

@@ -0,0 +1,6 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Symbol nextgroup=javascriptGlobalSymbolDot,javascriptFuncCallArg
syntax match javascriptGlobalSymbolDot /\./ contained nextgroup=javascriptSymbolStaticProp,javascriptSymbolStaticMethod
endif

4
syntax/yajs/event.vim Normal file
View File

@@ -0,0 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
endif

View File

@@ -0,0 +1,17 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptGlobal Function Boolean Error EvalError InternalError RangeError
syntax keyword javascriptGlobal ReferenceError StopIteration SyntaxError TypeError
syntax keyword javascriptGlobal URIError Date Float32Array Float64Array Int16Array
syntax keyword javascriptGlobal Int32Array Int8Array Uint16Array Uint32Array Uint8Array
syntax keyword javascriptGlobal Uint8ClampedArray ParallelArray ArrayBuffer DataView
syntax keyword javascriptGlobal Iterator Generator Reflect Proxy arguments
if exists("did_javascript_hilink") | HiLink javascriptGlobal Structure
endif
syntax keyword javascriptGlobalMethod eval uneval isFinite isNaN parseFloat parseInt nextgroup=javascriptFuncCallArg
syntax keyword javascriptGlobalMethod decodeURI decodeURIComponent encodeURI encodeURIComponent nextgroup=javascriptFuncCallArg
syntax cluster props add=javascriptGlobalMethod
if exists("did_javascript_hilink") | HiLink javascriptGlobalMethod Structure
endif
endif

8
syntax/yajs/node.vim Normal file
View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax keyword javascriptNodeGlobal global process console Buffer module exports setTimeout
syntax keyword javascriptNodeGlobal clearTimeout setInterval clearInterval
if exists("did_javascript_hilink") | HiLink javascriptNodeGlobal Structure
endif
endif

4
syntax/yajs/web.vim Normal file
View File

@@ -0,0 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
endif