Compare commits

...

17 Commits

Author SHA1 Message Date
Adam Stankiewicz
6e9529be4e Change scss provider to cakebaker, closes #173 2017-02-02 23:23:52 +01:00
Adam Stankiewicz
462bb76e06 Change powershell provider to PProvost, closes #177 2017-02-02 22:22:41 +01:00
Adam Stankiewicz
8002795088 Fix elixir not opening with :Explore, closes #172 2017-02-02 22:11:43 +01:00
Adam Stankiewicz
7404993f0c Add i3 config support, closes #168 2017-02-02 21:54:55 +01:00
Adam Stankiewicz
b7e2b0cad3 Change vala provider to arrufat, closes #165 2017-02-02 21:53:26 +01:00
Adam Stankiewicz
cc868aee51 Add vue support, closes #160 2017-02-02 21:49:51 +01:00
Adam Stankiewicz
39036a553f Add terraform, closes #163 2017-02-02 21:44:42 +01:00
Adam Stankiewicz
e685e4b431 Update 2017-02-02 21:16:29 +01:00
Adam Stankiewicz
e404a658b1 Update 2016-12-20 20:57:20 +01:00
Adam Stankiewicz
74652b465d Update twig source 2016-09-11 13:50:56 +02:00
Adam Stankiewicz
7575da2064 Update 2016-09-11 13:42:21 +02:00
Adam Stankiewicz
9b23910103 Add raml syntax highlighting, closes #155 2016-09-11 13:38:46 +02:00
Adam Stankiewicz
98e021e969 Wrap ftdetect file in augroup, fixes #153 2016-09-11 13:34:02 +02:00
Adam Stankiewicz
b8d9939329 Add python compiler, closes #147 2016-09-11 13:25:03 +02:00
Adam Stankiewicz
0244e228fa Update 2016-09-11 13:24:17 +02:00
Adam Stankiewicz
ab61d2ac8e Update 2016-07-30 13:19:35 +02:00
Adam Stankiewicz
f42e1f477c Add note about non-completeness of plugins, #146 2016-07-27 19:48:12 +02:00
240 changed files with 10177 additions and 5693 deletions

View File

@@ -23,6 +23,10 @@ A collection of language packs for Vim.
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.
NOTE: Not all features of listed language packs are available. We strip them from functionality slowing vim startup in general (for example we ignore `plugins` folder that is loaded regardless of file type, use `ftplugin` instead).
If you need full functionality of any plugin, please use it directly with your plugin manager.
## Language packs ## Language packs
- [applescript](https://github.com/vim-scripts/applescript.vim) (syntax) - [applescript](https://github.com/vim-scripts/applescript.vim) (syntax)
@@ -41,7 +45,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [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, autoload, ftplugin, ftdetect) - [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect)
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, 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, autoload, ftplugin, ftdetect)
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect) - [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect) - [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect) - [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect)
@@ -51,13 +55,14 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect) - [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent, ftdetect) - [go](https://github.com/fatih/vim-go) (syntax, compiler, indent, ftdetect)
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax) - [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/sheerun/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin, ftdetect) - [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin, ftdetect)
- [haskell](https://github.com/neovimhaskell/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)
- [i3](https://github.com/PotatoesMaster/i3-vim-syntax) (syntax, 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, ftplugin, ftdetect, extras) - [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftdetect, ftplugin, extras)
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin, ftdetect) - [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin, 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) (ftdetect, after) - [jsx](https://github.com/mxw/vim-jsx) (ftdetect, after)
@@ -70,7 +75,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent) - [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect) - [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect)
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect) - [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect)
- [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftdetect) - [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftplugin, ftdetect)
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect)
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect) - [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent) - [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
@@ -80,36 +85,41 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect) - [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
- [pgsql](https://github.com/exu/pgsql.vim) (syntax, ftdetect) - [pgsql](https://github.com/exu/pgsql.vim) (syntax, ftdetect)
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect) - [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin, ftdetect)
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect) - [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent, ftdetect) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent, ftdetect)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect) - [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect) - [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect) - [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftplugin, ftdetect)
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent) - [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload, ftdetect)
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect) - [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin) - [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin, ftdetect)
- [ragel](https://github.com/jneen/ragel.vim) (syntax) - [ragel](https://github.com/jneen/ragel.vim) (syntax)
- [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/rust-lang/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)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin, ftdetect)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin, ftdetect) - [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin, 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) - [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)
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftdetect, ftplugin)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect) - [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect) - [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect)
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax) - [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/evidens/vim-twig) (syntax, ftplugin) - [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect) - [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect) - [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftdetect)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax) - [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax, ftdetect) - [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax, ftdetect)
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin, ftdetect)
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, 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)
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin) - [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)

View File

@@ -0,0 +1,16 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
" Vim filetype plugin file
" Language: JavaScript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
setlocal iskeyword+=$ suffixesadd+=.js
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
endif

View File

@@ -5,7 +5,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
" "
" Language: JSX (JavaScript) " Language: JSX (JavaScript)
" Maintainer: Max Wang <mxawng@gmail.com> " Maintainer: Max Wang <mxawng@gmail.com>
" Depends: pangloss/vim-javascript
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

View File

@@ -0,0 +1,21 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
if !exists('g:terraform_align')
let g:terraform_align = 0
endif
if g:terraform_align && exists(':Tabularize')
inoremap <buffer> <silent> = =<Esc>:call <SID>terraformalign()<CR>a
function! s:terraformalign()
let p = '^.*=[^>]*$'
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
Tabularize/=/l1
normal! 0
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
endfunction
endif
endif

5
after/ftplugin/vue.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
setlocal suffixesadd+=.vue
endif

View File

@@ -20,7 +20,7 @@ setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum)
function! GetCoffeeHtmlIndent(curlinenum) function! GetCoffeeHtmlIndent(curlinenum)
" See if we're inside a coffeescript block. " See if we're inside a coffeescript block.
let scriptlnum = searchpair('<script [^>]*type="text/coffeescript"[^>]*>', '', let scriptlnum = searchpair('<script [^>]*type=[''"]\?text/coffeescript[''"]\?[^>]*>', '',
\ '</script>', 'bWn') \ '</script>', 'bWn')
let prevlnum = prevnonblank(a:curlinenum) let prevlnum = prevnonblank(a:curlinenum)

View File

@@ -5,10 +5,12 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
" "
" Language: JSX (JavaScript) " Language: JSX (JavaScript)
" Maintainer: Max Wang <mxawng@gmail.com> " Maintainer: Max Wang <mxawng@gmail.com>
" Depends: pangloss/vim-javascript
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Save the current JavaScript indentexpr.
let b:jsx_js_indentexpr = &indentexpr
" 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
@@ -51,19 +53,31 @@ fu! SynXMLish(syns)
return SynAttrXMLish(get(a:syns, -1)) return SynAttrXMLish(get(a:syns, -1))
endfu endfu
" Check if a synstack has any XMLish attribute.
fu! SynXMLishAny(syns)
for synattr in a:syns
if SynAttrXMLish(synattr)
return 1
endif
endfor
return 0
endfu
" Check if a synstack denotes the end of a JSX block. " Check if a synstack denotes the end of a JSX block.
fu! SynJSXBlockEnd(syns) fu! SynJSXBlockEnd(syns)
return get(a:syns, -1) == 'jsBraces' && SynAttrXMLish(get(a:syns, -2)) return get(a:syns, -1) =~ '\%(js\|javascript\)Braces' &&
\ SynAttrXMLish(get(a:syns, -2))
endfu
" Determine how many jsxRegions deep a synstack is.
fu! SynJSXDepth(syns)
return len(filter(copy(a:syns), 'v:val ==# "jsxRegion"'))
endfu
" Check whether `cursyn' continues the same jsxRegion as `prevsyn'.
fu! SynJSXContinues(cursyn, prevsyn)
let curdepth = SynJSXDepth(a:cursyn)
let prevdepth = SynJSXDepth(a:prevsyn)
" In most places, we expect the nesting depths to be the same between any
" two consecutive positions within a jsxRegion (e.g., between a parent and
" child node, between two JSX attributes, etc.). The exception is between
" sibling nodes, where after a completed element (with depth N), we return
" to the parent's nesting (depth N - 1). This case is easily detected,
" since it is the only time when the top syntax element in the synstack is
" jsxRegion---specifically, the jsxRegion corresponding to the parent.
return prevdepth == curdepth ||
\ (prevdepth == curdepth + 1 && get(a:cursyn, -1) ==# 'jsxRegion')
endfu endfu
" Cleverly mix JS and XML indentation. " Cleverly mix JS and XML indentation.
@@ -71,9 +85,12 @@ fu! GetJsxIndent()
let cursyn = SynSOL(v:lnum) let cursyn = SynSOL(v:lnum)
let prevsyn = SynEOL(v:lnum - 1) let prevsyn = SynEOL(v:lnum - 1)
" Use XML indenting if the syntax at the end of the previous line was either " Use XML indenting iff:
" JSX or was the closing brace of a jsBlock whose parent syntax was JSX. " - the syntax at the end of the previous line was either JSX or was the
if (SynXMLish(prevsyn) || SynJSXBlockEnd(prevsyn)) && SynXMLishAny(cursyn) " closing brace of a jsBlock whose parent syntax was JSX; and
" - the current line continues the same jsxRegion as the previous line.
if (SynXMLish(prevsyn) || SynJSXBlockEnd(prevsyn)) &&
\ SynJSXContinues(cursyn, prevsyn)
let ind = XmlIndentGet(v:lnum, 0) let ind = XmlIndentGet(v:lnum, 0)
" Align '/>' and '>' with '<' for multiline tags. " Align '/>' and '>' with '<' for multiline tags.
@@ -86,7 +103,13 @@ fu! GetJsxIndent()
let ind = ind + &sw let ind = ind + &sw
endif endif
else else
let ind = GetJavascriptIndent() if len(b:jsx_js_indentexpr)
" Invoke the base JS package's custom indenter. (For vim-javascript,
" e.g., this will be GetJavascriptIndent().)
let ind = eval(b:jsx_js_indentexpr)
else
let ind = cindent(v:lnum)
endif
endif endif
return ind return ind

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script')
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL
if exists('b:current_syntax')
let s:current_syntax_save = b:current_syntax
endif
" Inherit coffee from html so coffeeComment isn't redefined and given higher " Inherit coffee from html so coffeeComment isn't redefined and given higher
" priority than hamlInterpolation. " priority than hamlInterpolation.
syn cluster hamlCoffeescript contains=@htmlCoffeeScript syn cluster hamlCoffeescript contains=@htmlCoffeeScript
@@ -14,4 +19,9 @@ syn region hamlCoffeescriptFilter matchgroup=hamlFilter
\ contains=@hamlCoffeeScript,hamlInterpolation \ contains=@hamlCoffeeScript,hamlInterpolation
\ keepend \ keepend
if exists('s:current_syntax_save')
let b:current_syntax = s:current_syntax_save
unlet s:current_syntax_save
endif
endif endif

View File

@@ -5,13 +5,22 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script')
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL
if exists('b:current_syntax')
let s:current_syntax_save = b:current_syntax
endif
" Syntax highlighting for text/coffeescript script tags " Syntax highlighting for text/coffeescript script tags
syn include @htmlCoffeeScript syntax/coffee.vim syn include @htmlCoffeeScript syntax/coffee.vim
syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*># syn region coffeeScript start=#<script [^>]*type=['"]\?text/coffeescript['"]\?[^>]*>#
\ end=#</script>#me=s-1 keepend \ end=#</script>#me=s-1 keepend
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc \ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
\ containedin=htmlHead \ containedin=htmlHead
if exists('s:current_syntax_save')
let b:current_syntax = s:current_syntax_save
unlet s:current_syntax_save
endif
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1

View File

@@ -48,7 +48,7 @@ syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock
" preceding it, to avoid conflicts with, respectively, the left shift operator " preceding it, to avoid conflicts with, respectively, the left shift operator
" and generic Flow type annotations (http://flowtype.org/). " and generic Flow type annotations (http://flowtype.org/).
syn region jsxRegion syn region jsxRegion
\ contains=@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock \ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock
\ start=+\%(<\|\w\)\@<!<\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\{-}>+

View File

@@ -40,7 +40,7 @@ syn keyword yamlConstant NULL Null null NONE None none NIL Nil nil
syn keyword yamlConstant TRUE True true YES Yes yes ON On on syn keyword yamlConstant TRUE True true YES Yes yes ON On on
syn keyword yamlConstant FALSE False false NO No no OFF Off off syn keyword yamlConstant FALSE False false NO No no OFF Off off
syn match yamlKey "\w\+\ze\s*:" syn match yamlKey "^\s*\zs\S\+\ze\s*:"
syn match yamlAnchor "&\S\+" syn match yamlAnchor "&\S\+"
syn match yamlAlias "*\S\+" syn match yamlAlias "*\S\+"

View File

@@ -20,18 +20,20 @@ endfunction
function! dart#fmt(q_args) abort function! dart#fmt(q_args) abort
if executable('dartfmt') if executable('dartfmt')
let path = expand('%:p:gs:\:/:') let buffer_content = join(getline(1, '$'), "\n")
if filereadable(path) let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content)
let joined_lines = system(printf('dartfmt %s %s', a:q_args, shellescape(path))) if 0 == v:shell_error
if 0 == v:shell_error let win_view = winsaveview()
silent % delete _ silent % delete _
silent put=joined_lines silent put=joined_lines
silent 1 delete _ silent 1 delete _
else call winrestview(win_view)
call s:cexpr('line %l\, column %c of %f: %m', joined_lines)
endif
else else
call s:error(printf('cannot read a file: "%s"', path)) let errors = split(joined_lines, "\n")[2:]
let file_path = expand('%')
call map(errors, 'file_path.":".v:val')
let error_format = '%A%f:line %l\, column %c of stdin: %m,%C%.%#'
call s:cexpr(error_format, join(errors, "\n"))
endif endif
else else
call s:error('cannot execute binary file: dartfmt') call s:error('cannot execute binary file: dartfmt')

219
autoload/elixir/indent.vim Normal file
View File

@@ -0,0 +1,219 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
let s:NO_COLON_BEFORE = ':\@<!'
let s:NO_COLON_AFTER = ':\@!'
let s:ENDING_SYMBOLS = '\]\|}\|)'
let s:ARROW = '->'
let s:END_WITH_ARROW = s:ARROW.'$'
let s:SKIP_SYNTAX = '\%(Comment\|String\)$'
let s:BLOCK_SKIP = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '".s:SKIP_SYNTAX."'"
let s:DEF = '^\s*def'
let s:FN = '\<fn\>'
let s:MULTILINE_FN = s:FN.'\%(.*end\)\@!'
let s:BLOCK_START = '\%(\<do\>\|'.s:FN.'\)\>'
let s:MULTILINE_BLOCK = '\%(\<do\>'.s:NO_COLON_AFTER.'\|'.s:MULTILINE_FN.'\)'
let s:BLOCK_MIDDLE = '\<\%(else\|match\|elsif\|catch\|after\|rescue\)\>'
let s:BLOCK_END = 'end'
let s:STARTS_WITH_PIPELINE = '^\s*|>.*$'
let s:QUERY_FROM = '^\s*\<from\>.*\<in\>.*,'
let s:ENDING_WITH_ASSIGNMENT = '=\s*$'
let s:INDENT_KEYWORDS = s:NO_COLON_BEFORE.'\%('.s:MULTILINE_BLOCK.'\|'.s:BLOCK_MIDDLE.'\)'
let s:DEINDENT_KEYWORDS = '^\s*\<\%('.s:BLOCK_END.'\|'.s:BLOCK_MIDDLE.'\)\>'
let s:PAIR_START = '\<\%('.s:NO_COLON_BEFORE.s:BLOCK_START.'\)\>'.s:NO_COLON_AFTER
let s:PAIR_MIDDLE = '^\s*\%('.s:BLOCK_MIDDLE.'\)\>'.s:NO_COLON_AFTER.'\zs'
let s:PAIR_END = '\<\%('.s:NO_COLON_BEFORE.s:BLOCK_END.'\)\>\zs'
let s:LINE_COMMENT = '^\s*#'
let s:MATCH_OPERATOR = '[^!><=]=[^~=>]'
function! s:pending_parenthesis(line)
if a:line.last_non_blank.text !~ s:ARROW
return elixir#util#count_indentable_symbol_diff(a:line.last_non_blank, '(', '\%(end\s*\)\@<!)')
end
endfunction
function! s:pending_square_brackets(line)
if a:line.last_non_blank.text !~ s:ARROW
return elixir#util#count_indentable_symbol_diff(a:line.last_non_blank, '[', ']')
end
endfunction
function! s:pending_brackets(line)
if a:line.last_non_blank.text !~ s:ARROW
return elixir#util#count_indentable_symbol_diff(a:line.last_non_blank, '{', '}')
end
endfunction
function! elixir#indent#deindent_case_arrow(ind, line)
if get(b:old_ind, 'arrow', 0) > 0
\ && (a:line.current.text =~ s:ARROW
\ || a:line.current.text =~ s:BLOCK_END)
let ind = b:old_ind.arrow
let b:old_ind.arrow = 0
return ind
else
return a:ind
end
endfunction
function! elixir#indent#deindent_ending_symbols(ind, line)
if a:line.current.text =~ '^\s*\('.s:ENDING_SYMBOLS.'\)'
return a:ind - &sw
else
return a:ind
end
endfunction
function! elixir#indent#deindent_keywords(ind, line)
if a:line.current.text =~ s:DEINDENT_KEYWORDS
let bslnum = searchpair(
\ s:PAIR_START,
\ s:PAIR_MIDDLE,
\ s:PAIR_END,
\ 'nbW',
\ s:BLOCK_SKIP
\ )
return indent(bslnum)
else
return a:ind
end
endfunction
function! elixir#indent#deindent_opened_symbols(ind, line)
let s:opened_symbol =
\ s:pending_parenthesis(a:line)
\ + s:pending_square_brackets(a:line)
\ + s:pending_brackets(a:line)
if s:opened_symbol < 0
let ind = get(b:old_ind, 'symbol', a:ind + (s:opened_symbol * &sw))
let ind = float2nr(ceil(floor(ind)/&sw)*&sw)
return ind <= 0 ? 0 : ind
else
return a:ind
end
endfunction
function! elixir#indent#indent_after_pipeline(ind, line)
if exists("b:old_ind.pipeline")
\ && elixir#util#is_blank(a:line.last.text)
\ && a:line.current.text !~ s:STARTS_WITH_PIPELINE
" Reset indentation in pipelines if there is a blank line between
" pipes
let ind = b:old_ind.pipeline
unlet b:old_ind.pipeline
return ind
elseif a:line.last_non_blank.text =~ s:STARTS_WITH_PIPELINE
if empty(substitute(a:line.current.text, ' ', '', 'g'))
\ || a:line.current.text =~ s:STARTS_WITH_PIPELINE
return indent(a:line.last_non_blank.num)
elseif a:line.last_non_blank.text !~ s:INDENT_KEYWORDS
let ind = b:old_ind.pipeline
unlet b:old_ind.pipeline
return ind
end
end
return a:ind
endfunction
function! elixir#indent#indent_assignment(ind, line)
if a:line.last_non_blank.text =~ s:ENDING_WITH_ASSIGNMENT
let b:old_ind.pipeline = indent(a:line.last_non_blank.num) " FIXME: side effect
return a:ind + &sw
else
return a:ind
end
endfunction
function! elixir#indent#indent_brackets(ind, line)
if s:pending_brackets(a:line) > 0
return a:ind + &sw
else
return a:ind
end
endfunction
function! elixir#indent#indent_case_arrow(ind, line)
if a:line.last_non_blank.text =~ s:END_WITH_ARROW && a:line.last_non_blank.text !~ '\<fn\>'
let b:old_ind.arrow = a:ind
return a:ind + &sw
else
return a:ind
end
endfunction
function! elixir#indent#indent_ending_symbols(ind, line)
if a:line.last_non_blank.text =~ '^\s*\('.s:ENDING_SYMBOLS.'\)\s*$'
return a:ind + &sw
else
return a:ind
end
endfunction
function! elixir#indent#indent_keywords(ind, line)
if a:line.last_non_blank.text =~ s:INDENT_KEYWORDS && a:line.last_non_blank.text !~ s:LINE_COMMENT
return a:ind + &sw
else
return a:ind
end
endfunction
function! elixir#indent#indent_parenthesis(ind, line)
if s:pending_parenthesis(a:line) > 0
\ && a:line.last_non_blank.text !~ s:DEF
\ && a:line.last_non_blank.text !~ s:END_WITH_ARROW
let b:old_ind.symbol = a:ind
return matchend(a:line.last_non_blank.text, '(')
else
return a:ind
end
endfunction
function! elixir#indent#indent_pipeline_assignment(ind, line)
if a:line.current.text =~ s:STARTS_WITH_PIPELINE
\ && a:line.last_non_blank.text =~ s:MATCH_OPERATOR
let b:old_ind.pipeline = indent(a:line.last_non_blank.num)
" if line starts with pipeline
" and last_non_blank line is an attribution
" indents pipeline in same level as attribution
let assign_pos = match(a:line.last_non_blank.text, '=\s*\zs[^ ]')
return (elixir#util#is_indentable_at(a:line.last_non_blank.num, assign_pos) ? assign_pos : a:ind)
else
return a:ind
end
endfunction
function! elixir#indent#indent_pipeline_continuation(ind, line)
if a:line.last_non_blank.text =~ s:STARTS_WITH_PIPELINE
\ && a:line.current.text =~ s:STARTS_WITH_PIPELINE
return indent(a:line.last_non_blank.num)
else
return a:ind
end
endfunction
function! elixir#indent#indent_square_brackets(ind, line)
if s:pending_square_brackets(a:line) > 0
if a:line.last_non_blank.text =~ '[\s*$'
return a:ind + &sw
else
" if start symbol is followed by a character, indent based on the
" whitespace after the symbol, otherwise use the default shiftwidth
" Avoid negative indentation index
return matchend(a:line.last_non_blank.text, '[\s*')
end
else
return a:ind
end
endfunction
function! elixir#indent#indent_ecto_queries(ind, line)
if a:line.last_non_blank.text =~ s:QUERY_FROM
return a:ind + &sw
else
return a:ind
end
endfunction
endif

52
autoload/elixir/util.vim Normal file
View File

@@ -0,0 +1,52 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
let s:SKIP_SYNTAX = '\%(Comment\|String\)$'
function! elixir#util#is_indentable_at(line, col)
if a:col == -1 " skip synID lookup for not found match
return 1
end
" TODO: Remove these 2 lines
" I don't know why, but for the test on spec/indent/lists_spec.rb:24.
" Vim is making some mess on parsing the syntax of 'end', it is being
" recognized as 'elixirString' when should be recognized as 'elixirBlock'.
call synID(a:line, a:col, 1)
" This forces vim to sync the syntax. Using fromstart is very slow on files
" over 1k lines
syntax sync minlines=20 maxlines=150
return synIDattr(synID(a:line, a:col, 1), "name")
\ !~ s:SKIP_SYNTAX
endfunction
function! elixir#util#count_indentable_symbol_diff(line, open, close)
return
\ s:match_count(a:line, a:open)
\ - s:match_count(a:line, a:close)
endfunction
function! s:match_count(line, pattern)
let size = strlen(a:line.text)
let index = 0
let counter = 0
while index < size
let index = match(a:line.text, a:pattern, index)
if index >= 0
let index += 1
if elixir#util#is_indentable_at(a:line.num, index)
let counter +=1
end
else
break
end
endwhile
return counter
endfunction
function elixir#util#is_blank(string)
return a:string =~ '^\s*$'
endfunction
endif

File diff suppressed because it is too large Load Diff

21
autoload/python/utils.vim Normal file
View File

@@ -0,0 +1,21 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
" Sometimes Python issues debugging messages
" which don't belong to a call stack context
" this function filters these messages
function! python#utils#fix_qflist() " {{{
let l:traceback = []
let l:qflist = getqflist()
for l:item in l:qflist
if !empty(l:item.type)
call add(l:traceback, l:item)
endif
endfor
if !empty(l:traceback)
call setqflist(l:traceback)
endif
endfunction " }}}
endif

View File

@@ -198,7 +198,7 @@ function! rubycomplete#Complete(findstart, base)
if c =~ '\w' if c =~ '\w'
continue continue
elseif ! c =~ '\.' elseif ! c =~ '\.'
idx = -1 let idx = -1
break break
else else
break break

View File

@@ -22,17 +22,20 @@ endif
let s:got_fmt_error = 0 let s:got_fmt_error = 0
function! rustfmt#Format() function! s:RustfmtCommandRange(filename, line1, line2)
let l:curw = winsaveview() let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt" return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
call writefile(getline(1, '$'), l:tmpname) endfunction
let command = g:rustfmt_command . " --write-mode=overwrite " function! s:RustfmtCommand(filename)
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
endfunction
function! s:RunRustfmt(command, curw, tmpname)
if exists("*systemlist") if exists("*systemlist")
let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname)) let out = systemlist(a:command)
else else
let out = split(system(command . g:rustfmt_options . " " . shellescape(l:tmpname)), '\r\?\n') let out = split(system(a:command), '\r\?\n')
endif endif
if v:shell_error == 0 || v:shell_error == 3 if v:shell_error == 0 || v:shell_error == 3
@@ -40,7 +43,7 @@ function! rustfmt#Format()
try | silent undojoin | catch | endtry try | silent undojoin | catch | endtry
" Replace current file with temp file, then reload buffer " Replace current file with temp file, then reload buffer
call rename(l:tmpname, expand('%')) call rename(a:tmpname, expand('%'))
silent edit! silent edit!
let &syntax = &syntax let &syntax = &syntax
@@ -78,10 +81,30 @@ function! rustfmt#Format()
let s:got_fmt_error = 1 let s:got_fmt_error = 1
lwindow lwindow
" We didn't use the temp file, so clean up " We didn't use the temp file, so clean up
call delete(l:tmpname) call delete(a:tmpname)
endif endif
call winrestview(l:curw) call winrestview(a:curw)
endfunction
function! rustfmt#FormatRange(line1, line2)
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
call writefile(getline(1, '$'), l:tmpname)
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction
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 = s:RustfmtCommand(l:tmpname)
call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction endfunction
endif endif

41
autoload/scss_indent.vim Normal file
View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1
" usage:
" set indentexpr=scss_indent#GetIndent(v:lnum)
fun! scss_indent#GetIndent(lnum)
" { -> increase indent
" } -> decrease indent
if a:lnum == 1
" start at 0 indentation
return 0
endif
" try to find last line ending with { or }
" ignoring // comments
let regex = '\([{}]\)\%(\/\/.*\)\?$'
let nr = search(regex, 'bnW')
if nr > 0
let last = indent(nr)
let m = matchlist(getline(nr), regex)
let m_curr = matchlist(getline(a:lnum), regex)
echoe string(m).string(m_curr)
if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
" last was open, current is close, use same indent
return last
elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
" } line and last line was }: decrease
return last - &sw
endif
if m[1] == '{'
" line after {: increase indent
return last + &sw
else
" line after } or { - same indent
return last
endif
else
return 0
endif
endfun
endif

View File

@@ -18,8 +18,10 @@ let default_role = {}
let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'slider', 'spinbutton', 'status', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'] let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'slider', 'spinbutton', 'status', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid']
let document_structure = ['article', 'columnheader', 'definition', 'directory', 'document', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator'] let document_structure = ['article', 'columnheader', 'definition', 'directory', 'document', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator']
let landmark_role = ['application', 'banner', 'complementary', 'contentinfo', 'form', 'main', 'navigation', 'search'] let landmark_role = ['application', 'banner', 'complementary', 'contentinfo', 'form', 'main', 'navigation', 'search']
let dpub_role = ['dpub-abstract', 'dpub-afterword', 'dpub-appendix', 'dpub-biblioentry', 'dpub-bibliography', 'dpub-biblioref', 'dpub-chapter', 'dpub-cover', 'dpub-epilogue', 'dpub-footnote', 'dpub-footnotes', 'dpub-foreword', 'dpub-glossary', 'dpub-glossdef', 'dpub-glossref', 'dpub-glossterm', 'dpub-index', 'dpub-locator', 'dpub-noteref', 'dpub-notice', 'dpub-pagebreak', 'dpub-pagelist', 'dpub-part', 'dpub-preface', 'dpub-prologue', 'dpub-pullquote', 'dpub-qna', 'dpub-subtitle', 'dpub-tip', 'dpub-title', 'dpub-toc']
let role = extend(widget_role, document_structure) let role = extend(widget_role, document_structure)
let role = extend(role, landmark_role) let role = extend(role, landmark_role)
let role = extend(role, dpub_role)
" http://www.w3.org/TR/wai-aria/states_and_properties#state_prop_taxonomy " http://www.w3.org/TR/wai-aria/states_and_properties#state_prop_taxonomy
"let global_states_and_properties = {'aria-atomic': ['true', 'false'], 'aria-busy': ['true', 'false'], 'aria-controls': [], 'aria-describedby': [], 'aria-disabled': ['true', 'false'], 'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'], 'aria-flowto': [], 'aria-grabbed': ['true', 'false', 'undefined'], 'aria-haspopup': ['true', 'false'], 'aria-hidden': ['true', 'false'], 'aria-invalid': ['grammar', 'spelling', 'true', 'false'], 'aria-label': [], 'aria-labelledby': [], 'aria-live': ['off', 'polite', 'assertive'], 'aria-owns': [], 'aria-relevant': ['additions', 'removals', 'text', 'all']} "let global_states_and_properties = {'aria-atomic': ['true', 'false'], 'aria-busy': ['true', 'false'], 'aria-controls': [], 'aria-describedby': [], 'aria-disabled': ['true', 'false'], 'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'], 'aria-flowto': [], 'aria-grabbed': ['true', 'false', 'undefined'], 'aria-haspopup': ['true', 'false'], 'aria-hidden': ['true', 'false'], 'aria-invalid': ['grammar', 'spelling', 'true', 'false'], 'aria-label': [], 'aria-labelledby': [], 'aria-live': ['off', 'polite', 'assertive'], 'aria-owns': [], 'aria-relevant': ['additions', 'removals', 'text', 'all']}

View File

@@ -62,6 +62,8 @@ let charset = [
\ 'windows-1256', 'windows-1257', 'windows-1258', 'TIS-620', ] \ 'windows-1256', 'windows-1257', 'windows-1258', 'TIS-620', ]
" }}} " }}}
let autofill_tokens = ['on', 'off', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo']
" Attributes_and_Settings: {{{ " Attributes_and_Settings: {{{
let core_attributes = {'accesskey': [], 'class': [], 'contenteditable': ['true', 'false', ''], 'contextmenu': [], 'dir': ['ltr', 'rtl'], 'draggable': ['true', 'false'], 'hidden': ['hidden', ''], 'id': [], 'is': [], 'lang': lang_tag, 'spellcheck': ['true', 'false', ''], 'style': [], 'tabindex': [], 'title': []} let core_attributes = {'accesskey': [], 'class': [], 'contenteditable': ['true', 'false', ''], 'contextmenu': [], 'dir': ['ltr', 'rtl'], 'draggable': ['true', 'false'], 'hidden': ['hidden', ''], 'id': [], 'is': [], 'lang': lang_tag, 'spellcheck': ['true', 'false', ''], 'style': [], 'tabindex': [], 'title': []}
let xml_attributes = {'xml:lang': lang_tag, 'xml:space': ['preserve'], 'xml:base': [], 'xmlns': ['http://www.w3.org/1999/xhtml', 'http://www.w3.org/1998/Math/MathML', 'http://www.w3.org/2000/svg', 'http://www.w3.org/1999/xlink']} let xml_attributes = {'xml:lang': lang_tag, 'xml:space': ['preserve'], 'xml:base': [], 'xmlns': ['http://www.w3.org/1999/xhtml', 'http://www.w3.org/1998/Math/MathML', 'http://www.w3.org/2000/svg', 'http://www.w3.org/1999/xlink']}
@@ -80,7 +82,7 @@ let attributes_value = {
\ 'action': ['URL', ''], \ 'action': ['URL', ''],
\ 'alt': ['Text', ''], \ 'alt': ['Text', ''],
\ 'async': ['Bool', ''], \ 'async': ['Bool', ''],
\ 'autocomplete': ['on/off', ''], \ 'autocomplete': ['*Token', ''],
\ 'autofocus': ['Bool', ''], \ 'autofocus': ['Bool', ''],
\ 'autoplay': ['Bool', ''], \ 'autoplay': ['Bool', ''],
\ 'border': ['1', ''], \ 'border': ['1', ''],
@@ -318,8 +320,10 @@ if g:html5_aria_attributes_complete == 1
let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'slider', 'spinbutton', 'status', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'] let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'slider', 'spinbutton', 'status', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid']
let document_structure = ['article', 'columnheader', 'definition', 'directory', 'document', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator'] let document_structure = ['article', 'columnheader', 'definition', 'directory', 'document', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator']
let landmark_role = ['application', 'banner', 'complementary', 'contentinfo', 'form', 'main', 'navigation', 'search'] let landmark_role = ['application', 'banner', 'complementary', 'contentinfo', 'form', 'main', 'navigation', 'search']
let dpub_role = ['dpub-abstract', 'dpub-afterword', 'dpub-appendix', 'dpub-biblioentry', 'dpub-bibliography', 'dpub-biblioref', 'dpub-chapter', 'dpub-cover', 'dpub-epilogue', 'dpub-footnote', 'dpub-footnotes', 'dpub-foreword', 'dpub-glossary', 'dpub-glossdef', 'dpub-glossref', 'dpub-glossterm', 'dpub-index', 'dpub-locator', 'dpub-noteref', 'dpub-notice', 'dpub-pagebreak', 'dpub-pagelist', 'dpub-part', 'dpub-preface', 'dpub-prologue', 'dpub-pullquote', 'dpub-qna', 'dpub-subtitle', 'dpub-tip', 'dpub-title', 'dpub-toc']
let role = extend(widget_role, document_structure) let role = extend(widget_role, document_structure)
let role = extend(role, landmark_role) let role = extend(role, landmark_role)
let role = extend(role, dpub_role)
let global_attributes = extend(global_attributes, {'role': role}) let global_attributes = extend(global_attributes, {'role': role})
endif endif
" }}} " }}}
@@ -347,7 +351,7 @@ let g:xmldata_html5 = {
\ 'vimxmlroot': ['html', 'head', 'body'] + flow_elements, \ 'vimxmlroot': ['html', 'head', 'body'] + flow_elements,
\ 'a': [ \ 'a': [
\ filter(copy(flow_elements), "!(v:val =~ '". abutton_dec ."')"), \ filter(copy(flow_elements), "!(v:val =~ '". abutton_dec ."')"),
\ extend(copy(global_attributes), {'name': [], 'href': [], 'target': [], 'rel': linktypes, 'hreflang': lang_tag, 'media': [], 'type': []}) \ extend(copy(global_attributes), {'name': [], 'href': [], 'target': [], 'rel': linktypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ], \ ],
\ 'abbr': [ \ 'abbr': [
\ phrasing_elements, \ phrasing_elements,
@@ -359,7 +363,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'area': [ \ 'area': [
\ [], \ [],
\ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': []}) \ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': [], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ], \ ],
\ 'article': [ \ 'article': [
\ flow_elements + ['style'], \ flow_elements + ['style'],
@@ -495,7 +499,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'form': [ \ 'form': [
\ flow_elements, \ flow_elements,
\ extend(copy(global_attributes), {'name': [], 'action': [], 'enctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'method': ['get', 'post', 'put', 'delete'], 'target': [], 'novalidate': ['novalidate', ''], 'accept-charset': charset, 'autocomplete': ['on', 'off']}) \ extend(copy(global_attributes), {'name': [], 'action': [], 'enctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'method': ['get', 'post', 'put', 'delete'], 'target': [], 'novalidate': ['novalidate', ''], 'accept-charset': charset, 'autocomplete': autofill_tokens})
\ ], \ ],
\ 'h1': [ \ 'h1': [
\ phrasing_elements, \ phrasing_elements,
@@ -547,15 +551,15 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'iframe': [ \ 'iframe': [
\ [], \ [],
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']}) \ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ], \ ],
\ 'img': [ \ 'img': [
\ [], \ [],
\ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'usemap': [], 'ismap': ['ismap', '']}) \ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ], \ ],
\ 'input': [ \ 'input': [
\ [], \ [],
\ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'color'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': ['on', 'off'], 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']}) \ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'color'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': autofill_tokens, 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']})
\ ], \ ],
\ 'ins': [ \ 'ins': [
\ flow_elements, \ flow_elements,
@@ -583,7 +587,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'link': [ \ 'link': [
\ [], \ [],
\ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any']}) \ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any'], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ], \ ],
\ 'main': [ \ 'main': [
\ flow_elements + ['style'], \ flow_elements + ['style'],
@@ -691,7 +695,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'script': [ \ 'script': [
\ [], \ [],
\ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset}) \ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset, 'nonce': []})
\ ], \ ],
\ 'section': [ \ 'section': [
\ flow_elements + ['style'], \ flow_elements + ['style'],
@@ -723,7 +727,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'style': [ \ 'style': [
\ [], \ [],
\ extend(copy(global_attributes), {'type': [], 'media': [], 'scoped': ['scoped', '']}) \ extend(copy(global_attributes), {'type': [], 'media': [], 'scoped': ['scoped', ''], 'nonce': []})
\ ], \ ],
\ 'sub': [ \ 'sub': [
\ phrasing_elements, \ phrasing_elements,

19
build
View File

@@ -7,6 +7,7 @@ DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftde
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after" DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect" DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
DIRS_JAVASCRIPT="${DIRS} extras" DIRS_JAVASCRIPT="${DIRS} extras"
DIRS_RM="$DIRS_JAVASCRIPT"
OUTPUT="" OUTPUT=""
@@ -76,8 +77,10 @@ copy_dir() {
} }
concat_ftdetect() { concat_ftdetect() {
echo "augroup filetypedetect" > tmp/polyglot.vim
cat config.vim >> tmp/polyglot.vim cat config.vim >> tmp/polyglot.vim
for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done
echo "augroup END" >> tmp/polyglot.vim
rm -f ftdetect/* rm -f ftdetect/*
mv tmp/polyglot.vim ftdetect/ mv tmp/polyglot.vim ftdetect/
} }
@@ -125,11 +128,12 @@ PACKS="
glsl:tikhomirov/vim-glsl glsl:tikhomirov/vim-glsl
go:fatih/vim-go:_BASIC go:fatih/vim-go:_BASIC
groovy:vim-scripts/groovy.vim groovy:vim-scripts/groovy.vim
haml:tpope/vim-haml haml:sheerun/vim-haml
handlebars:mustache/vim-mustache-handlebars handlebars:mustache/vim-mustache-handlebars
haskell:neovimhaskell/haskell-vim haskell:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe haxe:yaymukund/vim-haxe
html5:othree/html5.vim html5:othree/html5.vim
i3:PotatoesMaster/i3-vim-syntax
jasmine:glanotte/vim-jasmine jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript:_JAVASCRIPT javascript:pangloss/vim-javascript:_JAVASCRIPT
json:elzr/vim-json json:elzr/vim-json
@@ -155,35 +159,40 @@ PACKS="
pgsql:exu/pgsql.vim pgsql:exu/pgsql.vim
php:StanAngeloff/php.vim php:StanAngeloff/php.vim
plantuml:aklt/plantuml-syntax plantuml:aklt/plantuml-syntax
powershell:Persistent13/vim-ps1 powershell:PProvost/vim-ps1
protobuf:uarun/vim-protobuf protobuf:uarun/vim-protobuf
pug:digitaltoad/vim-pug pug:digitaltoad/vim-pug
puppet:voxpupuli/vim-puppet puppet:voxpupuli/vim-puppet
purescript:raichoo/purescript-vim purescript:raichoo/purescript-vim
python:mitsuhiko/vim-python-combined python:mitsuhiko/vim-python-combined
python-compiler:aliev/vim-compiler-python
qml:peterhoeg/vim-qml qml:peterhoeg/vim-qml
r-lang:vim-scripts/R.vim r-lang:vim-scripts/R.vim
raml:IN3D/vim-raml
ragel:jneen/ragel.vim ragel:jneen/ragel.vim
rspec:sheerun/rspec.vim rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby ruby:vim-ruby/vim-ruby
rust:rust-lang/rust.vim rust:rust-lang/rust.vim
sbt:derekwyatt/vim-sbt sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala scala:derekwyatt/vim-scala
scss:cakebaker/scss-syntax.vim
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 swift:keith/swift.vim
systemd:kurayama/systemd-vim-syntax systemd:kurayama/systemd-vim-syntax
terraform:hashivim/vim-terraform
textile:timcharper/textile.vim textile:timcharper/textile.vim
thrift:solarnz/thrift.vim thrift:solarnz/thrift.vim
tmux:keith/tmux.vim tmux:keith/tmux.vim
tomdoc:wellbredgrapefruit/tomdoc.vim tomdoc:wellbredgrapefruit/tomdoc.vim
toml:cespare/vim-toml toml:cespare/vim-toml
twig:evidens/vim-twig twig:lumiliet/vim-twig
typescript:leafgarland/typescript-vim typescript:leafgarland/typescript-vim
vala:tkztmk/vim-vala vala:arrufat/vala.vim
vbnet:vim-scripts/vbnet.vim vbnet:vim-scripts/vbnet.vim
vcl:smerrill/vcl-vim-plugin vcl:smerrill/vcl-vim-plugin
vue:posva/vim-vue
vm:lepture/vim-velocity vm:lepture/vim-velocity
xls:vim-scripts/XSLT-syntax xls:vim-scripts/XSLT-syntax
yaml:stephpy/vim-yaml yaml:stephpy/vim-yaml
@@ -191,7 +200,7 @@ PACKS="
" "
rm -rf tmp rm -rf tmp
rm -rf $DIRS_ALL rm -rf $DIRS_RM
mkdir tmp mkdir tmp
printf "Downloading packs..." printf "Downloading packs..."

View File

@@ -21,49 +21,12 @@ else
CompilerSet makeprg=cargo\ $* CompilerSet makeprg=cargo\ $*
endif endif
" Allow a configurable global Cargo.toml name. This makes it easy to " Ignore general cargo progress messages
" support variations like 'cargo.toml'. CompilerSet errorformat+=
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml') \%-G%\\s%#Downloading%.%#,
\%-G%\\s%#Compiling%.%#,
function! s:is_absolute(path) \%-G%\\s%#Finished%.%#,
return a:path[0] == '/' || a:path =~ '[A-Z]\+:' \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
endfunction \%-G%\\s%#To\ learn\ more\\,%.%#
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
if s:local_manifest != ''
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
augroup cargo
au!
au QuickfixCmdPost make call s:FixPaths()
augroup END
" FixPaths() is run after Cargo, and is used to change the file paths
" to be relative to the current directory instead of Cargo.toml.
function! s:FixPaths()
let qflist = getqflist()
let manifest = s:local_manifest
for qf in qflist
if !qf.valid
let m = matchlist(qf.text, '(file://\(.*\))$')
if !empty(m)
let manifest = m[1].'/'
" Manually strip another slash if needed; usually just an
" issue on Windows.
if manifest =~ '^/[A-Z]\+:/'
let manifest = manifest[1:]
endif
endif
continue
endif
let filename = bufname(qf.bufnr)
if s:is_absolute(filename)
continue
endif
let qf.filename = simplify(manifest.filename)
call remove(qf, 'bufnr')
endfor
call setqflist(qflist, 'r')
endfunction
endif
endif endif

15
compiler/eslint.vim Normal file
View File

@@ -0,0 +1,15 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
if exists("current_compiler")
finish
endif
let current_compiler = "eslint"
if exists(":CompilerSet") != 2
command! -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=eslint\ -f\ compact\ %
CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m
endif

71
compiler/python.vim Normal file
View File

@@ -0,0 +1,71 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
" Vim compiler file
" Compiler: Unit testing tool for Python
" Maintainer: Ali Aliev <ali@aliev.me>
" Last Change: 2015 Nov 2
if exists("current_compiler")
finish
endif
let current_compiler = "python"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
" Disable Python warnings
if !exists('$PYTHONWARNINGS')
let $PYTHONWARNINGS="ignore"
endif
" For Flake8 first
CompilerSet efm =%E%f:%l:\ could\ not\ compile,
CompilerSet efm +=%-Z%p^,
CompilerSet efm +=%A%f:%l:%c:\ %t%n\ %m,
CompilerSet efm +=%A%f:%l:\ %t%n\ %m,
" Python errors are multi-lined. They often start with 'Traceback', so
" we want to capture that (with +G) and show it in the quickfix window
" because it explains the order of error messages.
CompilerSet efm +=%+GTraceback%.%#,
" The error message itself starts with a line with 'File' in it. There
" are a couple of variations, and we need to process a line beginning
" with whitespace followed by File, the filename in "", a line number,
" and optional further text. %E here indicates the start of a multi-line
" error message. The %\C at the end means that a case-sensitive search is
" required.
CompilerSet efm +=%E\ \ File\ \"%f\"\\,\ line\ %l\\,%m%\\C,
CompilerSet efm +=%E\ \ File\ \"%f\"\\,\ line\ %l%\\C,
" The possible continutation lines are idenitifed to Vim by %C. We deal
" with these in order of most to least specific to ensure a proper
" match. A pointer (^) identifies the column in which the error occurs
" (but will not be entirely accurate due to indention of Python code).
CompilerSet efm +=%C%p^,
" Any text, indented by more than two spaces contain useful information.
" We want this to appear in the quickfix window, hence %+.
CompilerSet efm +=%+C\ \ \ \ %.%#,
CompilerSet efm +=%+C\ \ %.%#,
" The last line (%Z) does not begin with any whitespace. We use a zero
" width lookahead (\&) to check this. The line contains the error
" message itself (%m)
CompilerSet efm +=%Z%\\S%\\&%m,
" We can ignore any other lines (%-G)
CompilerSet efm +=%-G%.%#
if filereadable("Makefile")
CompilerSet makeprg=make
else
CompilerSet makeprg=python
endif
" vim:foldmethod=marker:foldlevel=0
endif

View File

@@ -23,6 +23,7 @@ else
CompilerSet makeprg=rustc\ \% CompilerSet makeprg=rustc\ \%
endif endif
" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat= CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m, \%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m, \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
@@ -31,6 +32,17 @@ CompilerSet errorformat=
\%-G%*[\ ]^%*[~], \%-G%*[\ ]^%*[~],
\%-G%*[\ ]... \%-G%*[\ ]...
" New errorformat (after nightly 2016/08/10)
CompilerSet errorformat+=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

@@ -1,34 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim compiler file
" Compiler: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
if exists("current_compiler")
finish
endif
let current_compiler = "sass"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=sass
CompilerSet errorformat=
\%f:%l:%m\ (Sass::Syntax%trror),
\%ESyntax\ %trror:%m,
\%C%\\s%\\+on\ line\ %l\ of\ %f,
\%Z%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2:
endif

View File

@@ -13,6 +13,10 @@ if !exists("g:typescript_compiler_options")
let g:typescript_compiler_options = "" let g:typescript_compiler_options = ""
endif endif
if exists(":CompilerSet") != 2
command! -nargs=* CompilerSet setlocal <args>
endif
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %' let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m

View File

@@ -7,3 +7,5 @@ endif
if !exists('g:vim_json_syntax_conceal') if !exists('g:vim_json_syntax_conceal')
let g:vim_json_syntax_conceal = 0 let g:vim_json_syntax_conceal = 0
endif endif
let g:filetype_euphoria = 'elixir'

View File

@@ -1,23 +1,53 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject syntax region jsFlowDefinition contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster containedin=jsParen
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass syntax region jsFlowArgumentDef contained start=/:/ end=/\%(\s*[,)]\|=>\@!\)\@=/ contains=@jsFlowCluster
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend syntax region jsFlowParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
syntax keyword jsFlowDeclareKeyword contained declare
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
syntax match jsFlowNoise contained /[:;,<>]/ syntax match jsFlowNoise contained /[:;,<>]/
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow syntax keyword jsFlowType contained boolean number string null void any mixed JSON array Function object array bool class
syntax keyword jsFlowStorageClass contained const var let syntax keyword jsFlowTypeof contained typeof skipempty skipempty nextgroup=jsFlowTypeCustom,jsFlowType
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue syntax match jsFlowTypeCustom contained /[0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup=jsFlowGroup
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock syntax region jsFlowGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster
syntax region jsFlowArrowArguments contained matchgroup=jsFlowNoise start=/(/ end=/)\%(\s*=>\)\@=/ oneline skipwhite skipempty nextgroup=jsFlowArrow contains=@jsFlowCluster
syntax match jsFlowArrow contained /=>/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens
syntax match jsFlowMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens,jsFlowArrowArguments,jsFlowObject,jsFlowReturnObject
syntax match jsFlowObjectKey contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ contains=jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup=jsObjectValue containedin=jsObject
syntax match jsFlowOrOperator contained /|/ skipwhite skipempty nextgroup=@jsFlowCluster
syntax keyword jsFlowImportType contained type skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup
syntax match jsFlowWildcard contained /*/
syntax match jsFlowReturn contained /:\s*/ contains=jsFlowNoise skipwhite skipempty nextgroup=@jsFlowReturnCluster
syntax region jsFlowReturnObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
syntax region jsFlowReturnArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
syntax region jsFlowReturnParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
syntax match jsFlowReturnKeyword contained /\k\+/ contains=jsFlowType,jsFlowTypeCustom skipwhite skipempty nextgroup=jsFlowReturnGroup,jsFuncBlock,jsFlowReturnOrOp
syntax match jsFlowReturnMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowReturnKeyword
syntax region jsFlowReturnGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
syntax match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock
syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
syntax region jsFlowTypeStatement start=/type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend
syntax region jsFlowTypeValue contained start=/=/ end=/[;\n]/ contains=@jsExpression,jsFlowGroup,jsFlowMaybe
syntax match jsFlowTypeOperator contained /=/
syntax keyword jsFlowTypeKeyword contained type
syntax keyword jsFlowDeclare declare skipwhite skipempty nextgroup=jsFlowTypeStatement,jsClassDefinition,jsStorageClass,jsFlowModule,jsFlowInterface
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlowClassDef containedin=jsClassBlock
syntax region jsFlowClassDef contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassValue
syntax region jsFlowModule contained start=/module/ end=/{\@=/ skipempty skipempty nextgroup=jsFlowDeclareBlock contains=jsString
syntax region jsFlowInterface contained start=/interface/ end=/{\@=/ skipempty skipempty nextgroup=jsFlowInterfaceBlock contains=@jsFlowCluster
syntax region jsFlowDeclareBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsFlowDeclare,jsFlowNoise
syntax region jsFlowInterfaceBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise keepend
syntax cluster jsFlowReturnCluster contains=jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup,jsFlowReturnMaybe,jsFlowReturnOrOp,jsFlowWildcardReturn
syntax cluster jsFlowCluster contains=jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGroup,jsFlowArrowArguments,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard
if version >= 508 || !exists("did_javascript_syn_inits") if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508 if version < 508
@@ -26,204 +56,40 @@ if version >= 508 || !exists("did_javascript_syn_inits")
else else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif endif
HiLink jsFlow PreProc HiLink jsFlowDefinition PreProc
HiLink jsFlowReturn PreProc HiLink jsFlowClassDef jsFlowDefinition
HiLink jsFlowArray PreProc HiLink jsFlowArgumentDef jsFlowDefinition
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowTypeObject PreProc
HiLink jsFlowTypeKey PreProc
HiLink jsFlowTypeValue PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type HiLink jsFlowTypeCustom PreProc
HiLink jsFlowNoise Noise HiLink jsFlowTypeof PreProc
delcommand HiLink HiLink jsFlowArray PreProc
endif HiLink jsFlowObject PreProc
HiLink jsFlowParens PreProc
endif HiLink jsFlowGroup PreProc
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 HiLink jsFlowReturn PreProc
HiLink jsFlowReturnObject jsFlowReturn
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject HiLink jsFlowReturnArray jsFlowArray
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass HiLink jsFlowReturnParens jsFlowParens
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock HiLink jsFlowReturnGroup jsFlowGroup
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend HiLink jsFlowFunctionGroup PreProc
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend HiLink jsFlowClassGroup PreProc
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue HiLink jsFlowArrowArguments PreProc
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster HiLink jsFlowArrow PreProc
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster HiLink jsFlowTypeStatement PreProc
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster HiLink jsFlowTypeKeyword PreProc
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster HiLink jsFlowTypeOperator PreProc
syntax keyword jsFlowDeclareKeyword contained declare HiLink jsFlowMaybe PreProc
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array HiLink jsFlowReturnMaybe PreProc
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow HiLink jsFlowClassProperty jsClassProperty
syntax match jsFlowNoise contained /[:;,<>]/ HiLink jsFlowDeclare PreProc
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow HiLink jsFlowModule PreProc
syntax keyword jsFlowStorageClass contained const var let HiLink jsFlowInterface PreProc
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsFlow PreProc
HiLink jsFlowReturn PreProc
HiLink jsFlowArray PreProc
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowTypeObject PreProc
HiLink jsFlowTypeKey PreProc
HiLink jsFlowTypeValue PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type
HiLink jsFlowNoise Noise
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
syntax keyword jsFlowDeclareKeyword contained declare
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
syntax match jsFlowNoise contained /[:;,<>]/
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
syntax keyword jsFlowStorageClass contained const var let
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsFlow PreProc
HiLink jsFlowReturn PreProc
HiLink jsFlowArray PreProc
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowTypeObject PreProc
HiLink jsFlowTypeKey PreProc
HiLink jsFlowTypeValue PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type
HiLink jsFlowNoise Noise
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
syntax keyword jsFlowDeclareKeyword contained declare
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
syntax match jsFlowNoise contained /[:;,<>]/
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
syntax keyword jsFlowStorageClass contained const var let
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsFlow PreProc
HiLink jsFlowReturn PreProc
HiLink jsFlowArray PreProc
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowTypeObject PreProc
HiLink jsFlowTypeKey PreProc
HiLink jsFlowTypeValue PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type
HiLink jsFlowNoise Noise
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
syntax keyword jsFlowDeclareKeyword contained declare
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
syntax match jsFlowNoise contained /[:;,<>]/
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
syntax keyword jsFlowStorageClass contained const var let
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsFlow PreProc
HiLink jsFlowReturn PreProc
HiLink jsFlowArray PreProc
HiLink jsFlowDeclareBlock PreProc
HiLink jsFlowObject PreProc
HiLink jsFlowParenRegion PreProc
HiLink jsFlowClass PreProc
HiLink jsFlowTypeObject PreProc
HiLink jsFlowTypeKey PreProc
HiLink jsFlowTypeValue PreProc
HiLink jsFlowClassProperty jsClassProperty
HiLink jsFlowType Type
HiLink jsFlowDeclareKeyword Type
HiLink jsFlowNoise Noise HiLink jsFlowNoise Noise
HiLink jsFlowObjectKey jsObjectKey
HiLink jsFlowOrOperator PreProc
HiLink jsFlowReturnOrOp jsFlowOrOperator
HiLink jsFlowWildcard PreProc
HiLink jsFlowWildcardReturn PreProc
delcommand HiLink delcommand HiLink
endif endif

View File

@@ -6,9 +6,9 @@ syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contai
" tags containing a param " tags containing a param
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
" tags containing type and param " tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\|typedef\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param " tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references " tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax) " other tags (no extra syntax)
@@ -20,179 +20,7 @@ syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRe
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+" syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.\{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeBrackets jsDocType
HiLink jsDocTypeRecord jsDocType
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
"" syntax coloring for javadoc comments (HTML)
syntax region jsComment 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\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
" tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeBrackets jsDocType
HiLink jsDocTypeRecord jsDocType
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
"" syntax coloring for javadoc comments (HTML)
syntax region jsComment 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\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
" tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeBrackets jsDocType
HiLink jsDocTypeRecord jsDocType
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
"" syntax coloring for javadoc comments (HTML)
syntax region jsComment 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\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
" tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits")
if version < 508
let did_javascript_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeBrackets jsDocType
HiLink jsDocTypeRecord jsDocType
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
delcommand HiLink
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
"" syntax coloring for javadoc comments (HTML)
syntax region jsComment 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\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
" tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits") if version >= 508 || !exists("did_javascript_syn_inits")

View File

@@ -5,31 +5,3 @@ syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" n
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+" syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
endif

View File

@@ -1,3 +1,4 @@
augroup filetypedetect
" Enable jsx syntax by default " Enable jsx syntax by default
if !exists('g:jsx_ext_required') if !exists('g:jsx_ext_required')
let g:jsx_ext_required = 0 let g:jsx_ext_required = 0
@@ -7,6 +8,8 @@ endif
if !exists('g:vim_json_syntax_conceal') if !exists('g:vim_json_syntax_conceal')
let g:vim_json_syntax_conceal = 0 let g:vim_json_syntax_conceal = 0
endif endif
let g:filetype_euphoria = 'elixir'
" ftdetect/ansible.vim " ftdetect/ansible.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
@@ -57,7 +60,7 @@ endif
" ftdetect/clojure.vim " ftdetect/clojure.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot setlocal filetype=clojure
endif endif
@@ -277,7 +280,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
" Language: OpenGL Shading Language " Language: OpenGL Shading Language
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io> " Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes,*.tesc,*.tese,*.comp set filetype=glsl
" vim:set sts=2 sw=2 : " vim:set sts=2 sw=2 :
@@ -323,7 +326,6 @@ endif
" ftdetect/haml.vim " ftdetect/haml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
autocmd BufNewFile,BufRead *.sass setf sass autocmd BufNewFile,BufRead *.sass setf sass
autocmd BufNewFile,BufRead *.scss setf scss autocmd BufNewFile,BufRead *.scss setf scss
@@ -333,6 +335,8 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
au BufRead,BufNewFile *.hsc set filetype=haskell au BufRead,BufNewFile *.hsc set filetype=haskell
au BufRead,BufNewFile *.bpk set filetype=haskell
au BufRead,BufNewFile *.hsig set filetype=haskell
endif endif
@@ -343,6 +347,16 @@ autocmd BufNewFile,BufRead *.hx setf haxe
endif endif
" ftdetect/i3.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
augroup i3_ftdetect
au!
au BufRead,BufNewFile *i3/config set ft=i3
augroup END
endif
" ftdetect/jasmine.vim " ftdetect/jasmine.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
@@ -356,6 +370,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
au BufNewFile,BufRead *.js setf javascript au BufNewFile,BufRead *.js setf javascript
au BufNewFile,BufRead *.jsm setf javascript au BufNewFile,BufRead *.jsm setf javascript
au BufNewFile,BufRead Jakefile setf javascript au BufNewFile,BufRead Jakefile setf javascript
au BufNewFile,BufRead *.es6 setf javascript
fun! s:SelectJavascript() fun! s:SelectJavascript()
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>' if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
@@ -611,11 +626,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -
" Vim ftdetect file " Vim ftdetect file
" Language: PlantUML " Language: PlantUML
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com> " Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
" Last Change: 19-Jun-2012
" Version: 0.1 " Version: 0.1
if did_filetype() if did_filetype()
finish finish
endif endif
autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif
@@ -643,6 +657,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') ==
au BufNewFile,BufRead *.ps1 set ft=ps1 au BufNewFile,BufRead *.ps1 set ft=ps1
au BufNewFile,BufRead *.psd1 set ft=ps1 au BufNewFile,BufRead *.psd1 set ft=ps1
au BufNewFile,BufRead *.psm1 set ft=ps1 au BufNewFile,BufRead *.psm1 set ft=ps1
au BufNewFile,BufRead *.pssc set ft=ps1
endif endif
@@ -658,7 +673,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') ==
au BufNewFile,BufRead *.ps1xml set ft=ps1xml au BufNewFile,BufRead *.ps1xml set ft=ps1xml
endif endif
" ftdetect/pug.vim " ftdetect/pug.vim
@@ -688,6 +702,18 @@ au FileType purescript let &l:commentstring='{--%s--}'
endif endif
" ftdetect/python.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
" Vim compiler file
" Compiler: Unit testing tool for Python
" Maintainer: Ali Aliev <ali@aliev.me>
" Last Change: 2015 Nov 2
autocmd FileType python compiler python
endif
" ftdetect/qml.vim " ftdetect/qml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
@@ -695,6 +721,13 @@ autocmd BufRead,BufNewFile *.qml setfiletype qml
endif endif
" ftdetect/raml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'raml') == -1
au BufRead,BufNewFile *.raml set ft=raml
endif
" ftdetect/ruby.vim " ftdetect/ruby.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
@@ -736,7 +769,6 @@ au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby') au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
" TODO: does anyone still use Rantfiles? Remove for Vim 8?
" Rantfile " Rantfile
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby') au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
@@ -849,10 +881,18 @@ au BufRead,BufNewFile *.sbt setfiletype sbt.scala
endif endif
" ftdetect/scss.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1
au BufRead,BufNewFile *.scss setfiletype scss
au BufEnter *.scss :syntax sync fromstart
endif
" ftdetect/slim.vim " ftdetect/slim.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
autocmd BufNewFile,BufRead *.slim setf slim autocmd BufNewFile,BufRead *.slim setfiletype slim
endif endif
@@ -904,6 +944,15 @@ au BufNewFile,BufRead *.timer set filetype=systemd
endif endif
" ftdetect/terraform.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
au BufRead,BufNewFile *.tf setlocal filetype=terraform
au BufRead,BufNewFile *.tfvars setlocal filetype=terraform
au BufRead,BufNewFile *.tfstate setlocal filetype=javascript
endif
" ftdetect/textile.vim " ftdetect/textile.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1
@@ -935,10 +984,8 @@ endif
" ftdetect/toml.vim " ftdetect/toml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
autocmd BufNewFile,BufRead *.toml set filetype=toml " Rust uses several TOML config files that are not named with .toml.
autocmd BufNewFile,BufRead *.toml,Cargo.lock,.cargo/config set filetype=toml
" Rust uses Cargo.toml and Cargo.lock (both are toml files).
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
endif endif
@@ -953,8 +1000,7 @@ 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,*.valadoc setfiletype vala
endif endif
@@ -972,3 +1018,26 @@ au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
endif endif
" ftdetect/vue.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
au BufNewFile,BufRead *.vue setf vue.html.javascript.css
endif
" ftdetect/xml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
" Vim ftdetect plugin file
" Language: Windows PowerShell
" Maintainer: Peter Provost <peter@provost.org>
" Version: 2.10
" Project Repository: https://github.com/PProvost/vim-ps1
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
au BufNewFile,BufRead *.cdxml set ft=xml
au BufNewFile,BufRead *.psc1 set ft=xml
endif
augroup END

View File

@@ -4,5 +4,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
if exists('+regexpengine') && ('&regexpengine' == 0) if exists('+regexpengine') && ('&regexpengine' == 0)
setlocal regexpengine=1 setlocal regexpengine=1
endif endif
set path+=./../templates,./../files
endif endif

View File

@@ -12,7 +12,7 @@ if exists('loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0 let b:match_ignorecase = 0
let b:match_words = let b:match_words =
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|fun\|begin\)\>=\@!' . \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|fun\|begin\|enum\)\>=\@!' .
\ ':' . \ ':' .
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ ':' . \ ':' .

View File

@@ -80,6 +80,23 @@ if exists("loaded_matchit")
let b:match_words = s:match_words let b:match_words = s:match_words
endif endif
if !exists('b:surround_45')
" When using surround `-` (ASCII 45) would provide `<% selection %>`
let b:surround_45 = "<% \r %>"
endif
if !exists('b:surround_61')
" When using surround `=` (ASCII 61) would provide `<%= selection %>`
let b:surround_61 = "<%= \r %>"
endif
if !exists('b:surround_35')
" When using surround `#` (ASCII 35) would provide `<%# selection %>`
let b:surround_35 = "<%# \r %>"
endif
if !exists('b:surround_5')
" When using surround `<C-e>` (ASCII 5 `ENQ`) would provide `<% selection %>\n<% end %>`
let b:surround_5 = "<% \r %>\n<% end %>"
endif
setlocal comments=:<%# setlocal comments=:<%#
setlocal commentstring=<%#\ %s\ %> setlocal commentstring=<%#\ %s\ %>

5
ftplugin/i3.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
setlocal commentstring=#\ %s
endif

View File

@@ -1,8 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
setlocal suffixesadd+=.js
if (v:version < 704 || (v:version == 704 && !has('patch002'))) && exists('&regexpengine')
set re=1
end
endif

5
ftplugin/nginx.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
setlocal commentstring=#\ %s
endif

View File

@@ -1,92 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Vim filetype plugin file
" Language: Perl 6
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: {{LAST_CHANGE}}
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com>
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
let s:save_cpo = &cpo
set cpo-=C
setlocal formatoptions-=t
setlocal formatoptions+=crqol
setlocal keywordprg=p6doc
setlocal comments=:#\|,:#=,:#
setlocal commentstring=#%s
" Change the browse dialog on Win32 to show mainly Perl-related files
if has("gui_win32")
let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
\ "Perl Modules (*.pm)\t*.pm\n" .
\ "Perl Documentation Files (*.pod)\t*.pod\n" .
\ "All Files (*.*)\t*.*\n"
endif
" Provided by Ned Konz <ned at bike-nomad dot com>
"---------------------------------------------
setlocal include=\\<\\(use\\\|require\\)\\>
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
setlocal define=[^A-Za-z_]
" The following line changes a global variable but is necessary to make
" gf and similar commands work. Thanks to Andrew Pimlott for pointing out
" the problem. If this causes a " problem for you, add an
" after/ftplugin/perl6.vim file that contains
" set isfname-=:
set isfname+=:
setlocal iskeyword=@,48-57,_,192-255,-
" Set this once, globally.
if !exists("perlpath")
if executable("perl6")
try
if &shellxquote != '"'
let perlpath = system('perl6 -e "@*INC.join(q/,/).say"')
else
let perlpath = system("perl6 -e '@*INC.join(q/,/).say'")
endif
let perlpath = substitute(perlpath,',.$',',,','')
catch /E145:/
let perlpath = ".,,"
endtry
else
" If we can't call perl to get its path, just default to using the
" current directory and the directory of the current file.
let perlpath = ".,,"
endif
endif
" Append perlpath to the existing path value, if it is set. Since we don't
" use += to do it because of the commas in perlpath, we have to handle the
" global / local settings, too.
if &l:path == ""
if &g:path == ""
let &l:path=perlpath
else
let &l:path=&g:path.",".perlpath
endif
else
let &l:path=&l:path.",".perlpath
endif
"---------------------------------------------
" Undo the stuff we changed.
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< isk< kp< path<" .
\ " | unlet! b:browsefilter"
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
endif

View File

@@ -3,20 +3,40 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -
" Vim plugin file " Vim plugin file
" Language: PlantUML " Language: PlantUML
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com> " Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
" Last Change: 19-Jun-2012
" Version: 0.1 " Version: 0.1
if exists("g:loaded_plantuml_plugin") if exists("b:loaded_plantuml_plugin")
finish finish
endif endif
let g:loaded_plantuml_plugin = 1 let b:loaded_plantuml_plugin = 1
let s:cpo_save = &cpo
set cpo&vim
if !exists("g:plantuml_executable_script") if !exists("g:plantuml_executable_script")
let g:plantuml_executable_script="plantuml" let g:plantuml_executable_script="plantuml"
endif endif
autocmd Filetype plantuml let &l:makeprg=g:plantuml_executable_script . " " . fnameescape(expand("%")) if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words =
\ '\(\<ref\>\|\<box\>\|\<opt\>\|\<alt\>\|\<group\>\|\<loop\>\|\<note\>\|\<legend\>\):\<else\>:\<end\>' .
\ ',\<if\>:\<elseif\>:\<else\>:\<endif\>' .
\ ',\<rnote\>:\<endrnote\>' .
\ ',\<hnote\>:\<endhnote\>' .
\ ',\<title\>:\<endtitle\>' .
\ ',\<\while\>:\<endwhile\>'
endif
let &l:makeprg=g:plantuml_executable_script . " " . fnameescape(expand("%"))
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
let b:endwise_addition = '\=index(["note","legend"], submatch(0))!=-1 ? "end " . submatch(0) : "end"'
let b:endwise_words = 'loop,group,alt,note,legend'
let b:endwise_pattern = '^\s*\zs\<\(loop\|group\|alt\|note\ze[^:]*$\|legend\)\>.*$'
let b:endwise_syngroups = 'plantumlKeyword'
let &cpo = s:cpo_save
unlet s:cpo_save
endif endif

5
ftplugin/purescript.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
endif

5
ftplugin/raml.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'raml') == -1
set ts=2 sts=2 sw=2 et
endif

View File

@@ -77,9 +77,9 @@ function! s:query_path(root) abort
let prefix = '' let prefix = ''
endif endif
if &shellxquote == "'" if &shellxquote == "'"
let path_check = prefix.'ruby -e --disable-gems"' . code . '"' let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
else else
let path_check = prefix."ruby -e --disable-gems'" . code . "'" let path_check = prefix."ruby --disable-gems -e '" . code . "'"
endif endif
let cd = haslocaldir() ? 'lcd' : 'cd' let cd = haslocaldir() ? 'lcd' : 'cd'

View File

@@ -48,7 +48,6 @@ endif
" This includeexpr isn't perfect, but it's a good start " This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g') setlocal includeexpr=substitute(v:fname,'::','/','g')
" NOT adding .rc as it's being phased out (0.7)
setlocal suffixesadd=.rs setlocal suffixesadd=.rs
if exists("g:ftplugin_rust_source_path") if exists("g:ftplugin_rust_source_path")
@@ -113,16 +112,6 @@ 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
@@ -143,6 +132,9 @@ command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
" See |:RustFmt| for docs " See |:RustFmt| for docs
command! -buffer RustFmt call rustfmt#Format() command! -buffer RustFmt call rustfmt#Format()
" See |:RustFmtRange| for docs
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
" Mappings {{{1 " Mappings {{{1
" Bind ⌘R in MacVim to :RustRun " Bind ⌘R in MacVim to :RustRun
@@ -190,13 +182,27 @@ let b:undo_ftplugin = "
\|ounmap <buffer> ]] \|ounmap <buffer> ]]
\|set matchpairs-=<:> \|set matchpairs-=<:>
\|unlet b:match_skip \|unlet b:match_skip
\|augroup! rust.vim
\" \"
" }}}1 " }}}1
" Code formatting on save
if get(g:, "rustfmt_autosave", 0)
autocmd BufWritePre *.rs silent! call rustfmt#Format()
endif
augroup END augroup END
" %-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
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@@ -1,27 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim filetype plugin
" Language: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
setlocal comments=://
setlocal commentstring=//\ %s
setlocal define=^\\s*\\%(@mixin\\\|=\\)
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
setlocal omnifunc=csscomplete#CompleteCSS
setlocal suffixesadd=.sass,.scss,.css
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
" vim:set sw=2:
endif

View File

@@ -18,7 +18,11 @@ silent! setlocal formatoptions+=j
" Just like c.vim, but additionally doesn't wrap text onto /** line when " Just like c.vim, but additionally doesn't wrap text onto /** line when
" formatting. Doesn't bungle bulleted lists when formatting. " formatting. Doesn't bungle bulleted lists when formatting.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,:// if get(g:, 'scala_scaladoc_indent', 0)
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
else
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
endif
setlocal commentstring=//\ %s setlocal commentstring=//\ %s
setlocal shiftwidth=2 softtabstop=2 expandtab setlocal shiftwidth=2 softtabstop=2 expandtab

View File

@@ -1,17 +1,17 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scss') == -1
" Vim filetype plugin if exists('b:did_indent') && b:did_indent
" Language: SCSS " be kind. allow users to override this. Does it work?
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26
if exists("b:did_ftplugin")
finish finish
endif endif
runtime! ftplugin/sass.vim setlocal indentexpr=scss_indent#GetIndent(v:lnum)
" Automatically insert the current comment leader after hitting <Enter>
" in Insert mode respectively after hitting 'o' or 'O' in Normal mode
setlocal formatoptions+=ro
" SCSS comments are either /* */ or //
setlocal comments=s1:/*,mb:*,ex:*/,:// setlocal comments=s1:/*,mb:*,ex:*/,://
" vim:set sw=2:
endif endif

14
ftplugin/vue.vim Normal file
View File

@@ -0,0 +1,14 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
" Vim filetype plugin
" Language: Vue.js
" Maintainer: Eduardo San Martin Morote
" Author: Adriaan Zonnenberg
if exists("b:did_ftplugin")
finish
endif
runtime! ftplugin/html.vim
endif

View File

@@ -89,7 +89,7 @@ if exists("*searchpairpos")
function! s:match_pairs(open, close, stopat) function! s:match_pairs(open, close, stopat)
" Stop only on vector and map [ resp. {. Ignore the ones in strings and " Stop only on vector and map [ resp. {. Ignore the ones in strings and
" comments. " comments.
if a:stopat == 0 if a:stopat == 0 && g:clojure_maxlines > 0
let stopat = max([line(".") - g:clojure_maxlines, 0]) let stopat = max([line(".") - g:clojure_maxlines, 0])
else else
let stopat = a:stopat let stopat = a:stopat
@@ -123,7 +123,7 @@ if exists("*searchpairpos")
if s:syn_id_name() !~? "string" if s:syn_id_name() !~? "string"
return -1 return -1
endif endif
if s:current_char() != '\\' if s:current_char() != '\'
return -1 return -1
endif endif
call cursor(0, col("$") - 1) call cursor(0, col("$") - 1)

View File

@@ -8,6 +8,32 @@ let b:did_indent = 1
setlocal cindent setlocal cindent
setlocal cinoptions+=j1,J1 setlocal cinoptions+=j1,J1
setlocal indentexpr=DartIndent()
let b:undo_indent = 'setl cin< cino<' let b:undo_indent = 'setl cin< cino<'
if exists("*DartIndent")
finish
endif
function! DartIndent()
" Default to cindent in most cases
let indentTo = cindent(v:lnum)
let previousLine = getline(prevnonblank(v:lnum - 1))
let currentLine = getline(v:lnum)
" Don't indent after an annotation
if previousLine =~# '^\s*@.*$'
let indentTo = indent(v:lnum - 1)
endif
" Indent after opening List literal
if previousLine =~# '\[$' && !(currentLine =~# '^\s*\]')
let indentTo = indent(v:lnum - 1) + &shiftwidth
endif
return indentTo
endfunction
endif endif

View File

@@ -8,6 +8,9 @@ runtime! indent/elixir.vim
unlet! b:did_indent unlet! b:did_indent
setlocal indentexpr= setlocal indentexpr=
let s:cpo_save = &cpo
set cpo&vim
if exists("b:eelixir_subtype") if exists("b:eelixir_subtype")
exe "runtime! indent/".b:eelixir_subtype.".vim" exe "runtime! indent/".b:eelixir_subtype.".vim"
else else
@@ -53,19 +56,21 @@ function! GetEelixirIndent(...)
let line = getline(lnum) let line = getline(lnum)
let cline = getline(v:lnum) let cline = getline(v:lnum)
if cline =~# '^\s*<%\s*\%(end\|else\|elsif\|catch\|after\|rescue\)\>.*%>' if cline =~# '^\s*<%\s*\%(end\|else\|elsif\|catch\|after\|rescue\)\>.*%>'
let ind = ind - &sw let ind -= &sw
elseif line =~# '\S\s*<%\s*end\s*%>' elseif line =~# '\S\s*<%\s*end\s*%>'
let ind = ind - &sw let ind -= &sw
endif endif
if line =~# '<%[=%]\=\s*.*\<do\s*%>' if line =~# '<%[=%]\=\s*.*\(\<do\|->\)\s*%>' ||
let ind = ind + &sw \ line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>'
elseif line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>' let ind += &sw
let ind = ind + &sw
endif endif
if cline =~# '^\s*%>\s*$' if cline =~# '^\s*%>\s*$'
let ind = ind - &sw let ind -= &sw
endif endif
return ind return ind
endfunction endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
endif endif

View File

@@ -1,144 +1,96 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal nosmartindent setlocal nosmartindent
setlocal indentexpr=elixir#indent()
setlocal indentkeys+=0),0],0=\|>,=->
setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
setlocal indentexpr=GetElixirIndent() if exists("b:did_indent") || exists("*elixir#indent")
setlocal indentkeys+=0),0],0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
if exists("*GetElixirIndent")
finish finish
endif end
let b:did_indent = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
let s:no_colon_before = ':\@<!' function! elixir#indent()
let s:no_colon_after = ':\@!' " initiates the `old_ind` dictionary
let s:symbols_end = '\]\|}\|)' let b:old_ind = get(b:, 'old_ind', {})
let s:symbols_start = '\[\|{\|(' " initiates the `line` dictionary
let s:arrow = '^.*->$' let line = s:build_line(v:lnum)
let s:skip_syntax = '\%(Comment\|String\)$'
let s:block_skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '".s:skip_syntax."'"
let s:block_start = '\<\%(do\|fn\)\>'
let s:block_middle = 'else\|match\|elsif\|catch\|after\|rescue'
let s:block_end = 'end'
let s:starts_with_pipeline = '^\s*|>.*$'
let s:ending_with_assignment = '=\s*$'
let s:indent_keywords = '\<'.s:no_colon_before.'\%('.s:block_start.'\|'.s:block_middle.'\)$'.'\|'.s:arrow if s:is_beginning_of_file(line)
let s:deindent_keywords = '^\s*\<\%('.s:block_end.'\|'.s:block_middle.'\)\>'.'\|'.s:arrow " Reset `old_ind` dictionary at the beginning of the file
let b:old_ind = {}
let s:pair_start = '\<\%('.s:no_colon_before.s:block_start.'\)\>'.s:no_colon_after " At the start of the file use zero indent.
let s:pair_middle = '\<\%('.s:block_middle.'\)\>'.s:no_colon_after.'\zs'
let s:pair_end = '\<\%('.s:no_colon_before.s:block_end.'\)\>\zs'
let s:inside_block = 0
function! GetElixirIndent()
let lnum = prevnonblank(v:lnum - 1)
" At the start of the file use zero indent.
if lnum == 0
return 0 return 0
endif elseif !s:is_indentable_line(line)
" Keep last line indentation if the current line does not have an
let opened_symbol = 0 " indentable syntax
let current_line = getline(v:lnum) return indent(line.last_non_blank.num)
let last_line = getline(lnum) else
let ind = indent(lnum) " Calculates the indenation level based on the rules
" All the rules are defined in `autoload/elixir/indent.vim`
" TODO: Remove these 2 lines let ind = indent(line.last_non_blank.num)
" I don't know why, but for the test on spec/indent/lists_spec.rb:24. call s:debug('>>> line = ' . string(line.current))
" Vim is making some mess on parsing the syntax of 'end', it is being call s:debug('>>> ind = ' . ind)
" recognized as 'elixirString' when should be recognized as 'elixirBlock'. let ind = s:indent('deindent_case_arrow', ind, line)
" This forces vim to sync the syntax. let ind = s:indent('indent_parenthesis', ind, line)
call synID(v:lnum, 1, 1) let ind = s:indent('indent_square_brackets', ind, line)
syntax sync fromstart let ind = s:indent('indent_brackets', ind, line)
let ind = s:indent('deindent_opened_symbols', ind, line)
if synIDattr(synID(v:lnum, 1, 1), "name") !~ s:skip_syntax let ind = s:indent('indent_pipeline_assignment', ind, line)
let ind = s:indent('indent_pipeline_continuation', ind, line)
if last_line !~ s:arrow let ind = s:indent('indent_after_pipeline', ind, line)
let split_line = split(last_line, '\zs') let ind = s:indent('indent_assignment', ind, line)
let opened_symbol += count(split_line, '(') - count(split_line, ')') let ind = s:indent('indent_ending_symbols', ind, line)
let opened_symbol += count(split_line, '[') - count(split_line, ']') let ind = s:indent('indent_keywords', ind, line)
let opened_symbol += count(split_line, '{') - count(split_line, '}') let ind = s:indent('deindent_keywords', ind, line)
end let ind = s:indent('deindent_ending_symbols', ind, line)
let ind = s:indent('indent_case_arrow', ind, line)
" if start symbol is followed by a character, indent based on the let ind = s:indent('indent_ecto_queries', ind, line)
" whitespace after the symbol, otherwise use the default shiftwidth call s:debug('<<< final = ' . ind)
if last_line =~ '\('.s:symbols_start.'\).' return ind
let opened_prefix = matchlist(last_line, '\('.s:symbols_start.'\)\s*')[0] end
let ind += (opened_symbol * strlen(opened_prefix)) endfunction
else
let ind += (opened_symbol * &sw)
endif
if last_line =~ '^\s*\('.s:symbols_end.'\)' || last_line =~ s:indent_keywords
let ind += &sw
endif
if current_line =~ '^\s*\('.s:symbols_end.'\)'
let ind -= &sw
endif
if last_line =~ s:ending_with_assignment && opened_symbol == 0
let b:old_ind = indent(lnum)
let ind += &sw
end
" if line starts with pipeline
" and last line ends with a pipeline,
" align them
if last_line =~ '|>.*$' &&
\ current_line =~ s:starts_with_pipeline
let ind = float2nr(match(last_line, '|>') / &sw) * &sw
" if line starts with pipeline
" and last line is an attribution
" indents pipeline in same level as attribution
elseif current_line =~ s:starts_with_pipeline &&
\ last_line =~ '^[^=]\+=.\+$'
if !exists('b:old_ind') || b:old_ind == 0
let b:old_ind = indent(lnum)
end
let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw
endif
" if last line starts with pipeline
" and current line doesn't start with pipeline
" returns the indentation before the pipeline
if last_line =~ s:starts_with_pipeline &&
\ current_line !~ s:starts_with_pipeline
let ind = b:old_ind
endif
if current_line =~ s:deindent_keywords
let bslnum = searchpair(
\ s:pair_start,
\ s:pair_middle,
\ s:pair_end,
\ 'nbW',
\ s:block_skip
\ )
let ind = indent(bslnum)
endif
" indent case statements '->'
if current_line =~ s:arrow
let ind += &sw
endif
endif
function s:indent(rule, ind, line)
let Fn = function('elixir#indent#'.a:rule)
let ind = Fn(a:ind, a:line)
call s:debug(a:rule . ' = ' . ind)
return ind return ind
endfunction endfunction
function s:debug(message)
if get(g:, 'elixir_indent_debug', 0)
echom a:message
end
endfunction
function! s:is_beginning_of_file(line)
return a:line.last_non_blank.num == 0
endfunction
function! s:is_indentable_line(line)
return elixir#util#is_indentable_at(a:line.current.num, 1)
endfunction
function! s:build_line(line)
let line = { 'current': {}, 'last': {}, 'last_non_blank': {} }
let line.current = s:new_line(a:line)
let line.last = s:new_line(line.current.num - 1)
let line.last_non_blank = s:new_line(prevnonblank(line.current.num - 1))
return line
endfunction
function! s:new_line(num)
return {
\ "num": a:num,
\ "text": getline(a:num)
\ }
endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

@@ -43,6 +43,10 @@ if exists("*GetErubyIndent")
finish finish
endif endif
" this file uses line continuations
let s:cpo_sav = &cpo
set cpo&vim
function! GetErubyIndent(...) function! GetErubyIndent(...)
" The value of a single shift-width " The value of a single shift-width
if exists('*shiftwidth') if exists('*shiftwidth')
@@ -101,6 +105,9 @@ function! GetErubyIndent(...)
return ind return ind
endfunction endfunction
let &cpo = s:cpo_sav
unlet! s:cpo_sav
" vim:set sw=2 sts=2 ts=8 noet: " vim:set sw=2 sts=2 ts=8 noet:
endif endif

View File

@@ -32,13 +32,13 @@ function! GetGoHTMLTmplIndent(lnum)
" If need to indent based on last line " If need to indent based on last line
let last_line = getline(a:lnum-1) let last_line = getline(a:lnum-1)
if last_line =~ '^\s*{{\s*\%(if\|else\|range\|with\|define\|block\).*}}' if last_line =~ '^\s*{{-\=\s*\%(if\|else\|range\|with\|define\|block\).*}}'
let ind += sw let ind += sw
endif endif
" End of FuncMap block " End of FuncMap block
let current_line = getline(a:lnum) let current_line = getline(a:lnum)
if current_line =~ '^\s*{{\s*\%(else\|end\).*}}' if current_line =~ '^\s*{{-\=\s*\%(else\|end\).*}}'
let ind -= sw let ind -= sw
endif endif

View File

@@ -15,6 +15,10 @@ endif
let b:did_indent = 1 let b:did_indent = 1
if !exists('g:haskell_indent_disable')
let g:haskell_indent_disable = 0
endif
if !exists('g:haskell_indent_if') if !exists('g:haskell_indent_if')
" if x " if x
" >>>then ... " >>>then ...
@@ -59,19 +63,42 @@ if !exists('g:haskell_indent_guard')
let g:haskell_indent_guard = 2 let g:haskell_indent_guard = 2
endif endif
setlocal indentexpr=GetHaskellIndent() if exists("g:haskell_indent_disable") && g:haskell_indent_disable == 0
setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,0\,,<space> setlocal indentexpr=GetHaskellIndent()
setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,<space>
else
setlocal nocindent
setlocal nosmartindent
setlocal autoindent
endif
function! s:isInBlock(hlstack) function! s:isInBlock(hlstack)
return index(a:hlstack, 'haskellParens') > -1 || index(a:hlstack, 'haskellBrackets') > -1 || index(a:hlstack, 'haskellBlock') > -1 return index(a:hlstack, 'haskellParens') > -1 || index(a:hlstack, 'haskellBrackets') > -1 || index(a:hlstack, 'haskellBlock') > -1 || index(a:hlstack, 'haskellBlockComment') > -1 || index(a:hlstack, 'haskellPragma') > -1
endfunction
function! s:stripTrailingComment(line)
if a:line =~ '^\s*--\(-\+\|\s\+\)' || a:line =~ '^\s*{-'
return a:line
else
let l:stripped = split(a:line, '-- ')
if len(l:stripped) > 1
return substitute(l:stripped[0], '\s*$', '', '')
else
return a:line
endif
endif
endfunction
function! s:isSYN(grp, line, col)
return index(s:getHLStack(a:line, a:col), a:grp) != -1
endfunction endfunction
function! s:getNesting(hlstack) function! s:getNesting(hlstack)
return filter(a:hlstack, 'v:val == "haskellBlock" || v:val == "haskellBrackets" || v:val == "haskellParens"') return filter(a:hlstack, 'v:val == "haskellBlock" || v:val == "haskellBrackets" || v:val == "haskellParens" || v:val == "haskellBlockComment" || v:val == "haskellPragma" ')
endfunction endfunction
function! s:getHLStack() function! s:getHLStack(line, col)
return map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') return map(synstack(a:line, a:col), 'synIDattr(v:val, "name")')
endfunction endfunction
" indent matching character " indent matching character
@@ -110,14 +137,14 @@ function! s:indentGuard(pos, prevline)
endfunction endfunction
function! GetHaskellIndent() function! GetHaskellIndent()
let l:hlstack = s:getHLStack() let l:hlstack = s:getHLStack(line('.'), col('.'))
" do not indent in strings and quasiquotes " do not indent in strings and quasiquotes
if index(l:hlstack, 'haskellQuasiQuote') > -1 || index(l:hlstack, 'haskellBlockComment') > -1 if index(l:hlstack, 'haskellQuasiQuote') > -1 || index(l:hlstack, 'haskellBlockComment') > -1
return -1 return -1
endif endif
let l:prevline = getline(v:lnum - 1) let l:prevline = s:stripTrailingComment(getline(v:lnum - 1))
let l:line = getline(v:lnum) let l:line = getline(v:lnum)
" indent multiline strings " indent multiline strings
@@ -135,10 +162,43 @@ function! GetHaskellIndent()
endif endif
" comment indentation " comment indentation
if l:line =~ '^\s*--'
return match(l:prevline, '-- ')
endif
if l:prevline =~ '^\s*--' if l:prevline =~ '^\s*--'
return match(l:prevline, '\S') return match(l:prevline, '\S')
endif endif
" { foo :: Int
" >>,
"
" |
" ...
" >>,
if l:line =~ '^\s*,'
if s:isInBlock(l:hlstack)
normal! 0
call search(',', 'cW')
let l:n = s:getNesting(s:getHLStack(line('.'), col('.')))
call search('[([{]', 'bW')
let l:cl = line('.')
let l:cc = col('.')
while l:n != s:getNesting(s:getHLStack(l:cl, l:cc)) || s:isSYN('haskellString', l:cl, l:cc) || s:isSYN('haskellChar', l:cl, l:cc)
call search('[([{]', 'bW')
let l:cl = line('.')
let l:cc = col('.')
endwhile
return l:cc - 1
else
let l:s = s:indentGuard(match(l:line, ','), l:prevline)
if l:s > -1
return l:s
end
endif
endif
" operator at end of previous line " operator at end of previous line
if l:prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$' if l:prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
return match(l:prevline, '\S') + &shiftwidth return match(l:prevline, '\S') + &shiftwidth
@@ -166,11 +226,20 @@ function! GetHaskellIndent()
" >>>>y = 2 " >>>>y = 2
if l:prevline =~ '\C\<let\>\s\+.\+$' if l:prevline =~ '\C\<let\>\s\+.\+$'
if l:line =~ '\C^\s*\<let\>' if l:line =~ '\C^\s*\<let\>'
return match(l:prevline, '\C\<let\>') let l:s = match(l:prevline, '\C\<let\>')
if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
return l:s
endif
elseif l:line =~ '\C^\s*\<in\>' elseif l:line =~ '\C^\s*\<in\>'
return match(l:prevline, '\C\<let\>') + g:haskell_indent_in let l:s = match(l:prevline, '\C\<let\>')
if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
return l:s + g:haskell_indent_in
endif
else else
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let let l:s = match(l:prevline, '\C\<let\>')
if s:isSYN('haskellLet', v:lnum - 1, l:s + 1)
return l:s + g:haskell_indent_let
endif
endif endif
endif endif
@@ -199,26 +268,36 @@ function! GetHaskellIndent()
return match(l:prevline, '\S') + &shiftwidth return match(l:prevline, '\S') + &shiftwidth
endif endif
" do foo
" >>>bar
if l:prevline =~ '\C\<do\>\s\+\S\+.*$'
let l:s = match(l:prevline, '\C\<do\>')
if s:isSYN('haskellKeyword', v:lnum - 1, l:s + 1)
return l:s + g:haskell_indent_do
endif
endif
" case foo of
" >>bar -> quux
if l:prevline =~ '\C\<case\>.\+\<of\>\s*$'
if exists('g:haskell_indent_case_alternative') && g:haskell_indent_case_alternative
return match(l:prevline, '\S') + &shiftwidth
else
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
endif
endif
"" where foo "" where foo
"" >>>>>>bar "" >>>>>>bar
if l:prevline =~ '\C\<where\>\s\+\S\+.*$' if l:prevline =~ '\C\<where\>\s\+\S\+.*$'
if l:line =~ '^\s*[=-]>\s' && l:prevline =~ ' :: ' if l:line =~ '^\s*[=-]>\s' && l:prevline =~ ' :: '
return match(l:prevline, ':: ') return match(l:prevline, ':: ')
else else
return match(l:prevline, '\C\<where\>') + g:haskell_indent_where let l:s = match(l:prevline, '\C\<where\>')
endif if s:isSYN('haskellWhere', v:lnum - 1, l:s + 1)
endif return l:s + g:haskell_indent_where
endif
" do foo endif
" >>>bar
if l:prevline =~ '\C\<do\>\s\+\S\+.*$'
return match(l:prevline, '\C\<do\>') + g:haskell_indent_do
endif
" case foo of
" >>bar -> quux
if l:prevline =~ '\C\<case\>.\+\<of\>\s*$'
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
endif endif
" newtype Foo = Foo " newtype Foo = Foo
@@ -259,8 +338,8 @@ function! GetHaskellIndent()
while v:lnum != l:c while v:lnum != l:c
" fun decl " fun decl
let l:s = match(l:l, l:m) if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)')
if l:s >= 0 let l:s = match(l:l, l:m)
if match(l:l, '\C^\s*\<default\>') > -1 if match(l:l, '\C^\s*\<default\>') > -1
return l:s - 8 return l:s - 8
else else
@@ -362,32 +441,6 @@ function! GetHaskellIndent()
endif endif
endif endif
" { foo :: Int
" >>,
"
" |
" ...
" >>,
if l:line =~ '^\s*,'
if s:isInBlock(l:hlstack)
normal! 0
call search(',', 'cW')
let l:n = s:getNesting(s:getHLStack())
call search('[(\[{]', 'bW')
while l:n != s:getNesting(s:getHLStack())
call search('[(\[{]', 'bW')
endwhile
return col('.') - 1
else
let l:s = s:indentGuard(match(l:line, ','), l:prevline)
if l:s > -1
return l:s
end
endif
endif
" | " |
" ... " ...
" >>| " >>|
@@ -423,11 +476,6 @@ function! GetHaskellIndent()
if l:line =~ '^\s*]' if l:line =~ '^\s*]'
return s:indentMatching(']') return s:indentMatching(']')
endif endif
"
" indent import
if l:line =~ '\C^\s*import'
return 0
endif
" do not reindent indented lines " do not reindent indented lines
if match(l:prevline, '\S') < match(l:line, '\S') if match(l:prevline, '\S') < match(l:line, '\S')

View File

@@ -42,6 +42,7 @@ setlocal indentkeys=o,O,*<Return>,<>>,{,},!^F
let s:tags = [] let s:tags = []
let s:no_tags = []
" [-- <ELEMENT ? - - ...> --] " [-- <ELEMENT ? - - ...> --]
call add(s:tags, 'a') call add(s:tags, 'a')
@@ -165,6 +166,44 @@ call add(s:tags, 'text')
call add(s:tags, 'textPath') call add(s:tags, 'textPath')
call add(s:tags, 'tref') call add(s:tags, 'tref')
call add(s:tags, 'tspan') call add(s:tags, 'tspan')
" Common self closing SVG elements
call add(s:no_tags, 'animate')
call add(s:no_tags, 'animateTransform')
call add(s:no_tags, 'circle')
call add(s:no_tags, 'ellipse')
call add(s:no_tags, 'feBlend')
call add(s:no_tags, 'feColorMatrix')
call add(s:no_tags, 'feComposite')
call add(s:no_tags, 'feConvolveMatrix')
call add(s:no_tags, 'feDisplacementMap')
call add(s:no_tags, 'feFlood')
call add(s:no_tags, 'feFuncR')
call add(s:no_tags, 'feFuncG')
call add(s:no_tags, 'feFuncB')
call add(s:no_tags, 'feFuncA')
call add(s:no_tags, 'feGaussianBlur')
call add(s:no_tags, 'feImage')
call add(s:no_tags, 'feMergeNode')
call add(s:no_tags, 'feMorphology')
call add(s:no_tags, 'feOffset')
call add(s:no_tags, 'fePointLight')
call add(s:no_tags, 'feSpotLight')
call add(s:no_tags, 'feTile')
call add(s:no_tags, 'feTurbulence')
call add(s:no_tags, 'hatchpath')
call add(s:no_tags, 'hkern')
call add(s:no_tags, 'image')
call add(s:no_tags, 'line')
call add(s:no_tags, 'mpath')
call add(s:no_tags, 'polygon')
call add(s:no_tags, 'polyline')
call add(s:no_tags, 'path')
call add(s:no_tags, 'rect')
call add(s:no_tags, 'solidColor')
call add(s:no_tags, 'stop')
call add(s:no_tags, 'use')
call add(s:no_tags, 'view')
call add(s:no_tags, 'vkern')
call add(s:tags, 'html') call add(s:tags, 'html')
call add(s:tags, 'head') call add(s:tags, 'head')
@@ -177,8 +216,6 @@ call add(s:tags, 'tr')
call add(s:tags, 'th') call add(s:tags, 'th')
call add(s:tags, 'td') call add(s:tags, 'td')
let s:no_tags = []
call add(s:no_tags, 'base') call add(s:no_tags, 'base')
call add(s:no_tags, 'link') call add(s:no_tags, 'link')
call add(s:no_tags, 'meta') call add(s:no_tags, 'meta')

View File

@@ -2,27 +2,25 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
" Vim indent file " Vim indent file
" Language: Javascript " Language: Javascript
" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org " Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript
" 0. Initialization {{{1 " Last Change: January 24, 2017
" =================
" Only load this indent file when no other was loaded. " 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
setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it. " Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent() setlocal indentexpr=GetJavascriptIndent()
setlocal formatexpr=Fixedgq(v:lnum,v:count) setlocal autoindent nolisp nosmartindent
setlocal indentkeys=0{,0},0),0],0\,*<Return>,:,!^F,o,O,e setlocal indentkeys+=0],0)
setlocal cinoptions+=j1,J1,c1
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Only define the function once. " Only define the function once.
if exists("*GetJavascriptIndent") if exists('*GetJavascriptIndent')
finish finish
endif endif
@@ -31,536 +29,333 @@ set cpo&vim
" Get shiftwidth value " Get shiftwidth value
if exists('*shiftwidth') if exists('*shiftwidth')
func s:sw() function s:sw()
return shiftwidth() return shiftwidth()
endfunc endfunction
else else
func s:sw() function s:sw()
return &sw return &sw
endfunc endfunction
endif endif
" 1. Variables {{{1 " searchpair() wrapper
" ============ if has('reltime')
function s:GetPair(start,end,flags,skip,time,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
endfunction
else
function s:GetPair(start,end,flags,skip,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
endfunction
endif
let s:line_pre = '^\s*\%(\/\*.*\*\/\s*\)*'
let s:js_keywords = s:line_pre . '\%(break\|import\|export\|catch\|const\|continue\|debugger\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)\>\C'
let s:expr_case = s:line_pre . '\%(\%(case\>.*\)\|default\)\s*:\C'
" Regex of syntax group names that are or delimit string or are comments. " Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c' let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
let s:syng_str = 'string\|template'
" Regex of syntax group names that are strings. let s:syng_com = 'comment\|doc'
let s:syng_string = 'regex\c'
" Regex of syntax group names that are strings or documentation.
let s:syng_comment = '\%(comment\|doc\)\c'
" Expression used to check whether we should skip a match with searchpair(). " Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'" let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
func s:lookForParens(start,end,flags,stop) function s:skip_func()
try if !s:free || search('\m`\|\${\|\*\/','nW',s:looksyn)
return searchpair(a:start,'',a:end,a:flags,s:skip_expr,a:stop,300) let s:free = !eval(s:skip_expr)
catch /E118/ let s:looksyn = line('.')
return searchpair(a:start,'',a:end,a:flags,0,a:stop) return !s:free
endtry endif
endfunc let s:looksyn = line('.')
return getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$' &&
let s:line_term = '\s*\%(\%(\/\/.*\)\=\|\%(\/\*.*\*\/\s*\)*\)$' \ eval(s:skip_expr)
" Regex that defines continuation lines, not including (, {, or [.
let s:continuation_regex = '\%([*.?:]\|+\@<!+\|-\@<!-\|\*\@<!\/\|=\|||\|&&\)' . s:line_term
let s:one_line_scope_regex = '\%(\<else\>\|=>\)\C' . s:line_term
function s:Onescope(lnum)
if getline(a:lnum) =~ s:one_line_scope_regex
return 1
end
let mypos = col('.')
call cursor(a:lnum, 1)
if search('.*\zs\<\%(while\|for\|if\)\>\s*(\C', 'ce', a:lnum) > 0 &&
\ s:lookForParens('(', ')', 'W', a:lnum) > 0 &&
\ col('.') == strlen(s:RemoveTrailingComments(getline(a:lnum)))
call cursor(a:lnum, mypos)
return 1
else
call cursor(a:lnum, mypos)
return 0
end
endfunction endfunction
" Regex that defines blocks. function s:alternatePair(stop)
let s:block_regex = '[{([]' . s:line_term let pos = getpos('.')[1:2]
while search('\m[][(){}]','bW',a:stop)
let s:operator_first = s:line_pre . '\%([,:?]\|\([-/.+*]\)\%(\1\|\*\|\/\)\@!\|||\|&&\)' if !s:skip_func()
let idx = stridx('])}',s:looking_at())
let s:var_stmt = s:line_pre . '\%(const\|let\|var\)\s\+\C' if idx + 1
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
let s:comma_last = ',' . s:line_term break
endif
" 2. Auxiliary Functions {{{1 else
" ====================== return
endif
" Check if the character at lnum:col is inside a string, comment, or is ascii. endif
function s:IsInStringOrComment(lnum, col) endwhile
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom call call('cursor',pos)
endfunction endfunction
" Check if the character at lnum:col is inside a string. function s:save_pos(f,...)
function s:IsInString(lnum, col) let l:pos = getpos('.')[1:2]
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string let ret = call(a:f,a:000)
call call('cursor',l:pos)
return ret
endfunction endfunction
" Check if the character at lnum:col is inside a multi-line comment. function s:syn_at(l,c)
function s:IsInComment(lnum, col) return synIDattr(synID(a:l,a:c,0),'name')
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_comment
endfunction endfunction
" Find line above 'lnum' that isn't empty, in a comment, or in a string. function s:looking_at()
function s:PrevNonBlankNonString(lnum) return getline('.')[col('.')-1]
let lnum = prevnonblank(a:lnum) endfunction
while lnum > 0
let line = getline(lnum) function s:token()
let com = match(line, '\%(\/\*.*\)\@<!\*\/') + 1 return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
if s:IsInComment(lnum, com) endfunction
call cursor(lnum, com)
let parlnum = search('\%(\/\/.*\)\@<!\/\*', 'nbW') function s:previous_token()
if parlnum > 0 let l:n = line('.')
let lnum = parlnum if (s:looking_at() !~ '\k' || search('\m\<','cbW')) && search('\m\S','bW')
end if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:n &&
elseif line !~ '^' . s:line_term && !s:IsInStringOrComment(lnum,1) \ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
while search('\m\/\ze[/*]','cbW')
if !search('\m\S','bW')
break
elseif s:syn_at(line('.'),col('.')) !~? s:syng_com
return s:token()
endif
endwhile
else
return s:token()
endif
endif
return ''
endfunction
function s:others(p)
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr
endfunction
function s:tern_skip(p)
return s:GetPair('{','}','nbW',s:others(a:p),200,a:p[0]) > 0
endfunction
function s:tern_col(p)
return s:GetPair('?',':\@<!::\@!','nbW',s:others(a:p)
\ .' || s:tern_skip('.string(a:p).')',200,a:p[0]) > 0
endfunction
function s:label_col()
let pos = getpos('.')[1:2]
let [s:looksyn,s:free] = pos
call s:alternatePair(0)
if s:save_pos('s:IsBlock')
let poss = getpos('.')[1:2]
return call('cursor',pos) || !s:tern_col(poss)
elseif s:looking_at() == ':'
return !s:tern_col([0,0])
endif
endfunction
" configurable regexes that define continuation lines, not including (, {, or [.
let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
let s:continuation = get(g:,'javascript_continuation',
\ '\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
function s:continues(ln,con)
return !cursor(a:ln, match(' '.a:con,s:continuation)) &&
\ eval( (['s:syn_at(line("."),col(".")) !~? "regex"'] +
\ repeat(['getline(".")[col(".")-2] != tr(s:looking_at(),">","=")'],3) +
\ repeat(['s:previous_token() != "."'],5) + [1])[
\ index(split('/ > - + typeof in instanceof void delete'),s:token())])
endfunction
" get the line of code stripped of comments and move cursor to the last
" non-comment char.
function s:Trim(ln)
call cursor(a:ln+1,1)
call s:previous_token()
return strpart(getline('.'),0,col('.'))
endfunction
" Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum)
let l:n = prevnonblank(a:lnum)
while l:n
if getline(l:n) =~ '^\s*\/[/*]'
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
\ s:syn_at(l:n,1) =~? s:syng_str
return l:n
endif
let l:n = prevnonblank(l:n-1)
elseif s:syn_at(l:n,1) =~? s:syng_com
let l:n = s:save_pos('eval',
\ 'cursor('.l:n.',1) + search(''\m\/\*'',"bW")')
else
return l:n
endif
endwhile
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
let l:open = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
while pos != -1
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
let l:open += match(' ' . l:line[pos],'[[({]')
if l:open < 0
return
endif
endif
let pos = match(l:line, '[][(){}]', pos + 1)
endwhile
return !l:open
endfunction
function s:OneScope(lnum)
let pline = s:Trim(a:lnum)
let kw = 'else do'
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
call s:previous_token()
let kw = 'for if let while with'
if index(split('await each'),s:token()) + 1
call s:previous_token()
let kw = 'for'
endif
endif
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
\ s:save_pos('s:previous_token') != '.'
endfunction
" returns braceless levels started by 'i' and above lines * &sw. 'num' is the
" lineNr which encloses the entire context, 'cont' if whether line 'i' + 1 is
" a continued expression, which could have started in a braceless context
function s:iscontOne(i,num,cont)
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
let pind = a:num ? indent(l:num) + s:W : 0
let ind = indent(l:i) + (a:cont ? 0 : s:W)
while l:i >= l:num && (ind > pind || l:i == l:num)
if indent(l:i) < ind && s:OneScope(l:i)
let bL += s:W
let l:i = line('.')
elseif !a:cont || bL || ind < indent(a:i)
break break
endif endif
let lnum = prevnonblank(lnum - 1) let ind = min([ind, indent(l:i)])
let l:i = s:PrevCodeLine(l:i - 1)
endwhile endwhile
return lnum return bL
endfunction endfunction
" Find line above 'lnum' that started the continuation 'lnum' may be part of. " https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
function s:GetMSL(lnum, in_one_line_scope) function s:IsBlock()
" Start on the line we're at and use its indent. if s:looking_at() == '{'
let msl = a:lnum let l:n = line('.')
let lnum = s:PrevNonBlankNonString(a:lnum - 1) let char = s:previous_token()
while lnum > 0 && !s:Match(msl,s:line_pre . '[])}]') let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
" If we have a continuation line, or we're in a string, use line as MSL. if syn =~? 'xml\|jsx'
" Otherwise, terminate search as we have found our MSL already. return char != '{'
let line = getline(lnum) elseif char =~ '\k'
let line2 = getline(msl) return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
if ((s:Match(lnum,s:continuation_regex) || s:Match(lnum, s:comma_last)) && \ ,char) < (line('.') != l:n) || s:previous_token() == '.'
\ !s:Match(lnum, s:expr_case)) || s:IsInString(lnum, strlen(line)) elseif char == '>'
let msl = lnum return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
if s:Match(lnum, s:line_pre . '[]})]') && !a:in_one_line_scope elseif char == ':'
call cursor(lnum,1) return getline('.')[col('.')-2] != ':' && s:label_col()
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
if parlnum > 0
let lnum = parlnum
continue
end
end
else
" Don't use lines that are part of a one line scope as msl unless the
" flag in_one_line_scope is set to 1
"
if a:in_one_line_scope
break
end
let msl_one_line = s:Onescope(lnum)
if msl_one_line == 0
break
endif
end
let lnum = s:PrevNonBlankNonString(lnum - 1)
endwhile
return msl
endfunction
function s:RemoveTrailingComments(content)
let single = '\/\/\%(.*\)\s*$'
let multi = '\/\*\%(.*\)\*\/\s*$'
return substitute(substitute(substitute(a:content, single, '', ''), multi, '', ''), '\s\+$', '', '')
endfunction
" Find if the string is inside var statement (but not the first string)
function s:InMultiVarStatement(lnum, cont, prev)
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
let cont = a:cont
let prev = a:prev
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
" loop through previous expressions to find a var statement
while lnum > 0 && (s:Match(lnum, s:comma_last) ||(cont && getline(lnum) =~ s:line_pre . '[]})]') ||
\ s:Match(lnum,s:continuation_regex)) || (prev && (s:Match(prev, s:comma_last) ||
\ s:Match(prev,s:continuation_regex)))
" if the line is a js keyword
if cont
let cont = 0
call cursor(lnum,1)
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
if parlnum > 0
let lnum = parlnum
end
end
if s:Match(lnum, s:js_keywords)
" check if the line is a var stmt
" if the line has a comma first or comma last then we can assume that we
" are in a multiple var statement
if s:Match(lnum, s:var_stmt) && (s:Match(lnum, s:comma_last)||s:Match(lnum,s:continuation_regex))
return lnum
endif
" other js keywords, not a var
if !s:Match(lnum, s:comma_last)||!s:Match(lnum,s:continuation_regex)
return 0
end
endif
let lnum = s:PrevNonBlankNonString(lnum - 1)
let prev = prev && lnum > 0 ? prev : 0
endwhile
" beginning of program, not a var
return 0
endfunction
" Check if line 'lnum' has more opening brackets than closing ones.
function s:LineHasOpeningBrackets(lnum)
let open_0 = 0
let open_2 = 0
let open_4 = 0
let line = getline(a:lnum)
let pos = match(line, '[][(){}]', 0)
while pos != -1
if !s:IsInStringOrComment(a:lnum, pos + 1)
let idx = stridx('(){}[]', line[pos])
if idx % 2 == 0
let open_{idx} = open_{idx} + 1
else
let open_{idx - 1} = open_{idx - 1} - 1
endif
endif
let pos = match(line, '[][(){}]', pos + 1)
endwhile
return (open_0 > 0 ? 1 : (open_0 == 0 ? 0 : 2)) . (open_2 > 0 ? 1 : (open_2 == 0 ? 0 : 2)) . (open_4 > 0 ? 1 : (open_4 == 0 ? 0 : 2))
endfunction
function s:Match(lnum, regex)
let col = match(getline(a:lnum), a:regex) + 1
return col > 0 && !s:IsInStringOrComment(a:lnum, col) ? col : 0
endfunction
function s:IndentWithContinuation(lnum, ind, width)
" Set up variables to use and search for MSL to the previous line.
let p_lnum = a:lnum
let lnum = s:GetMSL(a:lnum, 1)
let line = getline(lnum)
" If the previous line wasn't a MSL and is continuation return its indent.
" TODO: the || s:IsInString() thing worries me a bit.
if p_lnum != lnum
if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line))
return a:ind
endif endif
return syn =~? 'regex' || char !~ '[=~!<*,/?^%|&([]' &&
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
endif endif
" Set up more variables now that we know we aren't continuation bound.
let msl_ind = indent(lnum)
" If the previous line ended with [*+/.-=], start a continuation that
" indents an extra level.
if s:Match(lnum, s:continuation_regex)
if lnum == p_lnum
return msl_ind + a:width
else
return msl_ind
end
elseif s:InMultiVarStatement(p_lnum, 0, s:PrevNonBlankNonString(p_lnum - 1))
return indent(p_lnum) - s:sw()
endif
return a:ind
endfunction endfunction
function s:InOneLineScope(lnum)
let msl = s:GetMSL(a:lnum, 1)
if msl > 0 && s:Onescope(msl)
return msl
endif
return 0
endfunction
function s:ExitingOneLineScope(lnum)
let msl = s:GetMSL(a:lnum, 1)
if msl > 0
" if the current line is in a one line scope ..
if s:Onescope(msl)
return 0
else
let prev_msl = s:GetMSL(msl - 1, 1)
if s:Onescope(prev_msl)
return prev_msl
endif
endif
endif
return 0
endfunction
" 3. GetJavascriptIndent Function {{{1
" =========================
function GetJavascriptIndent() function GetJavascriptIndent()
" 3.1. Setup {{{1 let b:js_cache = get(b:,'js_cache',[0,0,0])
" ----------
" Set up variables for restoring position in file. Could use v:lnum here.
" Avoid use of line('.')/col('.') type functions as the curpos can change
let vcol = col('.')
" 3.2. Work on the current line {{{1
" -----------------------------
let ind = -1
" Get the current line. " Get the current line.
let line = getline(v:lnum) call cursor(v:lnum,1)
" previous nonblank line number let l:line = getline('.')
let prevline = prevnonblank(v:lnum - 1) let syns = s:syn_at(v:lnum, 1)
" previous line of code
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
" to not change multiline string values " start with strings,comments,etc.
if line !~ '^[''"`]' && synIDattr(synID(v:lnum, 1, 1), 'name') =~? 'string\|template' if syns =~? s:syng_com
if l:line =~ '^\s*\*'
return cindent(v:lnum)
elseif l:line !~ '^\s*\/[/*]'
return -1
endif
elseif syns =~? s:syng_str && l:line !~ '^[''"]'
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
let b:js_cache[0] = v:lnum
endif
return -1 return -1
endif endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
" If we are in a multi-line comment, cindent does the right thing. if !l:lnum
if line !~ '^\%(\/\*\|\s*\/\/\)' && s:IsInComment(v:lnum, 1) return
return cindent(v:lnum)
endif endif
" single opening bracket will assume you want a c style of indenting let l:line = substitute(l:line,'^\s*','','')
if line =~ s:line_pre . '{' && !s:Match(lnum,s:block_regex) && if l:line[:1] == '/*'
\ !s:Match(lnum,s:comma_last) let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
return cindent(v:lnum) endif
if l:line =~ '^\/[/*]'
let l:line = ''
endif endif
" cindent each line which has a switch label " the containing paren, bracket, or curly. Many hacks for performance
if (line =~ s:expr_case) let idx = index([']',')','}'],l:line[0])
let s:cpo_switch = &cpo if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
set cpo+=% \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
let ind = cindent(v:lnum) call call('cursor',b:js_cache[1:])
let &cpo = s:cpo_switch
return ind
endif
" If we got a closing bracket on an empty line, find its match and indent
" according to it.
let col = line =~ s:line_pre . '[]})]'
if col > 0
let parlnum = v:lnum
while col
call cursor(parlnum, 1)
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
let col = s:Match(parlnum, s:line_pre . '[]})]')
if col
continue
end
if parlnum > 0
let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' ?
\ indent(parlnum) : indent(s:GetMSL(parlnum, 0))
endif
endwhile
return ind
endif
" If line starts with an operator...
if (line =~ s:operator_first)
if (s:Match(lnum, s:operator_first) || (s:Match(lnum, s:line_pre . '[])}]') &&
\ !(s:Match(v:lnum,s:line_pre . '\.') && s:Match(lnum, ')' . s:line_term))))
" and so does previous line, don't indent
return indent(lnum)
end
let counts = s:LineHasOpeningBrackets(lnum)
if counts =~ '2'
call cursor(lnum, 1)
" Search for the opening tag
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
if parlnum > 0
return !s:Match(parlnum, s:operator_first) &&
\ synIDattr(synID(v:lnum, 1, 1), 'name') !~? 'jsbracket\|jsparen\|jsobject' ?
\ indent(lnum) + s:sw() : indent(parlnum)
end
elseif synIDattr(synID(v:lnum, 1, 1), 'name') !~? 'jsbracket\|jsparen\|jsobject'
" otherwise, if not in an key/val;array item;param, indent 1 level
return indent(lnum) + s:sw()
end
" If previous line starts with an operator...
elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex)) ||
\ getline(lnum) =~ '[]})];\=' . s:line_term
let counts = s:LineHasOpeningBrackets(lnum)
if counts =~ '2' && !s:Match(lnum, s:operator_first)
call cursor(lnum, 1)
" Search for the opening tag
let mnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
if mnum > 0 && (s:Match(mnum, s:operator_first) ||
\ (s:Onescope(s:PrevNonBlankNonString(mnum - 1))) && !s:Match(mnum, s:line_pre . '{'))
return indent(mnum) - s:sw()
end
elseif s:Match(lnum, s:operator_first)
if counts !~ '1'
return indent(lnum) - s:sw()
end
end
end
" 3.3. Work on the previous line. {{{1
" -------------------------------
" If the line is empty and the previous nonblank line was a multi-line
" comment, use that comment's indent. Deduct one char to account for the
" space in ' */'.
if line =~ '^\s*$' && getline(prevline) =~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' &&
\ s:IsInComment(prevline, 1)
return indent(prevline) - 1
endif
" Find a non-blank, non-multi-line string line above the current line.
" If the line is empty and inside a string, use the previous line.
if line =~ '^\s*$' && lnum != prevline
return indent(prevnonblank(v:lnum))
endif
" At the start of the file use zero indent.
if lnum == 0
return 0
endif
" If the previous line ended with a block opening, add a level of indent.
if s:Match(lnum, s:block_regex)
return s:InMultiVarStatement(lnum, 0, 0) || s:LineHasOpeningBrackets(lnum) !~ '2' ?
\ indent(lnum) + s:sw() : indent(s:GetMSL(lnum, 0)) + s:sw()
endif
" Set up variables for current line.
let line = getline(lnum)
let ind = indent(lnum)
" If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type.
if s:Match(lnum, '[[({})\]]')
let counts = s:LineHasOpeningBrackets(lnum)
if counts =~ '2'
call cursor(lnum,matchend(s:RemoveTrailingComments(line), '.*\zs[])}]'))
while s:lookForParens('(\|{\|\[', ')\|}\|\]', 'bW', 0) == lnum
call cursor(lnum, matchend(s:RemoveTrailingComments(strpart(line,0,col('.'))), '.*\zs[])}]'))
endwhile
let cur = line('.')
if cur < lnum && !s:InMultiVarStatement(cur,0,0)
return indent(s:GetMSL(cur, 0))
end
elseif counts =~ '1' || s:Onescope(lnum)
return ind + s:sw()
end
end
" 3.4. Work on the MSL line. {{{1
" --------------------------
if s:Match(lnum, s:comma_last) && !s:Match(lnum, s:continuation_regex)
return s:Match(lnum, s:var_stmt) ? indent(lnum) + s:sw() : indent(lnum)
elseif s:Match(s:PrevNonBlankNonString(lnum - 1), s:comma_last)
if !s:Match(lnum, s:comma_last) && s:InMultiVarStatement(lnum,1,0)
return indent(lnum) - s:sw()
end
end
let ind_con = ind
let ind = s:IndentWithContinuation(lnum, ind_con, s:sw())
" }}}2
"
"
let ols = s:InOneLineScope(lnum)
if ols > 0
let ind = ind + s:sw()
else else
let ols = s:ExitingOneLineScope(lnum) let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
while ols > 0 && ind > 0 \ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
let ind = ind - s:sw() if idx + 1
let ols = s:InOneLineScope(ols - 1) call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
endwhile elseif indent(v:lnum) && syns =~? 'block'
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
else
call s:alternatePair(top)
endif
endif endif
return ind let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
endfunction let num = b:js_cache[1]
" }}}1 let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
if !num || s:IsBlock()
let ilnum = line('.')
let pline = s:save_pos('s:Trim',l:lnum)
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
let num = ilnum == num ? line('.') : num
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
if &cino !~ ':'
let switch_offset = s:W
else
let cinc = matchlist(&cino,'.*:\zs\(-\)\=\(\d*\)\(\.\d\+\)\=\(s\)\=\C')
let switch_offset = max([cinc[0] is '' ? 0 : (cinc[1].1) *
\ ((strlen(cinc[2].cinc[3]) ? str2nr(cinc[2].str2nr(cinc[3][1])) : 10) *
\ (cinc[4] is '' ? 1 : s:W)) / 10, -indent(num)])
endif
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
return indent(num) + switch_offset
endif
endif
endif
if idx < 0 && pline !~ '[{;]$'
if pline =~# ':\@<!:$'
call cursor(l:lnum,strlen(pline))
let isOp = s:tern_col(b:js_cache[1:2]) * s:W
else
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
endif
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
let bL -= (bL && l:line[0] == '{') * s:W
endif
endif
" main return
if idx + 1 || l:line[:1] == '|}'
return indent(num)
elseif num
return indent(num) + s:W + switch_offset + bL + isOp
endif
return bL + isOp
endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" gq{{{2
function! Fixedgq(lnum, count)
let l:tw = &tw ? &tw : 80;
let l:count = a:count
let l:first_char = indent(a:lnum) + 1
if mode() == 'i' " gq was not pressed, but tw was set
return 1
endif
" This gq is only meant to do code with strings, not comments
if s:IsInComment(a:lnum, l:first_char)
return 1
endif
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
return 1
endif
" Put all the lines on one line and do normal spliting after that
if l:count > 1
while l:count > 1
let l:count -= 1
normal J
endwhile
endif
let l:winview = winsaveview()
call cursor(a:lnum, l:tw + 1)
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
" No need for special treatment, normal gq handles edgecases better
if breakpoint[1] == orig_breakpoint[1]
call winrestview(l:winview)
return 1
endif
" Try breaking after string
if breakpoint[1] <= indent(a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
endif
if breakpoint[1] != 0
call feedkeys("r\<CR>")
else
let l:count = l:count - 1
endif
" run gq on new lines
if l:count == 1
call feedkeys("gqq")
endif
return 0
endfunction
"}}}
" vim: foldmethod=marker:foldlevel=1
endif endif

View File

@@ -1,131 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Vim indent file
" Language: Perl 6
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: {{LAST_CHANGE}}
" Contributors: Andy Lester <andy@petdance.com>
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
" Adapted from indent/perl.vim by Rafael Garcia-Suarez <rgarciasuarez@free.fr>
" Suggestions and improvements by :
" Aaron J. Sherman (use syntax for hints)
" Artem Chuprina (play nice with folding)
" TODO:
" This file still relies on stuff from the Perl 5 syntax file, which Perl 6
" does not use.
"
" Things that are not or not properly indented (yet) :
" - Continued statements
" print "foo",
" "bar";
" print "foo"
" if bar();
" - Multiline regular expressions (m//x)
" (The following probably needs modifying the perl syntax file)
" - qw() lists
" - Heredocs with terminators that don't match \I\i*
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" Is syntax highlighting active ?
let b:indent_use_syntax = has("syntax")
setlocal indentexpr=GetPerl6Indent()
" we reset it first because the Perl 5 indent file might have been loaded due
" to a .pl/pm file extension, and indent files don't clean up afterwards
setlocal indentkeys&
setlocal indentkeys+=0=,0),0],0>,0»,0=or,0=and
if !b:indent_use_syntax
setlocal indentkeys+=0=EO
endif
let s:cpo_save = &cpo
set cpo-=C
function! GetPerl6Indent()
" Get the line to be indented
let cline = getline(v:lnum)
" Indent POD markers to column 0
if cline =~ '^\s*=\L\@!'
return 0
endif
" Get current syntax item at the line's first char
let csynid = ''
if b:indent_use_syntax
let csynid = synIDattr(synID(v:lnum,1,0),"name")
endif
" Don't reindent POD and heredocs
if csynid =~ "^p6Pod"
return indent(v:lnum)
endif
" Now get the indent of the previous perl line.
" Find a non-blank line above the current line.
let lnum = prevnonblank(v:lnum - 1)
" Hit the start of the file, use zero indent.
if lnum == 0
return 0
endif
let line = getline(lnum)
let ind = indent(lnum)
" Skip heredocs, POD, and comments on 1st column
if b:indent_use_syntax
let skippin = 2
while skippin
let synid = synIDattr(synID(lnum,1,0),"name")
if (synid =~ "^p6Pod" || synid =~ "p6Comment")
let lnum = prevnonblank(lnum - 1)
if lnum == 0
return 0
endif
let line = getline(lnum)
let ind = indent(lnum)
let skippin = 1
else
let skippin = 0
endif
endwhile
endif
if line =~ '[<«\[{(]\s*\(#[^)}\]»>]*\)\=$'
let ind = ind + &sw
endif
if cline =~ '^\s*[)}\]»>]'
let ind = ind - &sw
endif
" Indent lines that begin with 'or' or 'and'
if cline =~ '^\s*\(or\|and\)\>'
if line !~ '^\s*\(or\|and\)\>'
let ind = ind + &sw
endif
elseif line =~ '^\s*\(or\|and\)\>'
let ind = ind - &sw
endif
return ind
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:ts=8:sts=4:sw=4:expandtab:ft=vim
endif

59
indent/plantuml.vim Normal file
View File

@@ -0,0 +1,59 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetPlantUMLIndent()
setlocal indentkeys=o,O,<CR>,<:>,!^F,0end,0else,}
" only define the indent code once
if exists("*GetPlantUMLIndent")
finish
endif
let s:incIndent =
\ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\)\>\|' .
\ '^\s*ref\>[^:]*$\|' .
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
\ '^\s*title\s*$\|' .
\ '^\s*skinparam\>.*{\s*$\|' .
\ '^\s*\%(state\|class\|partition\|rectangle\|enum\|interface\|namespace\)\>.*{'
let s:decIndent = '^\s*\%(end\|else\|}\)'
function! GetPlantUMLIndent(...) abort
"for current line, use arg if given or v:lnum otherwise
let clnum = a:0 ? a:1 : v:lnum
if !s:insidePlantUMLTags(clnum)
return indent(clnum)
endif
let pnum = prevnonblank(clnum-1)
let pindent = indent(pnum)
let pline = getline(pnum)
let cline = getline(clnum)
if cline =~ s:decIndent
if pline =~ s:incIndent
return pindent
else
return pindent - shiftwidth()
endif
elseif pline =~ s:incIndent
return pindent + shiftwidth()
endif
return pindent
endfunction
function! s:insidePlantUMLTags(lnum) abort
call cursor(a:lnum, 1)
return search('@startuml', 'Wbn') && search('@enduml', 'Wn')
endfunction
endif

View File

@@ -51,11 +51,11 @@ let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
" Regex of syntax group names that are strings. " Regex of syntax group names that are strings.
let s:syng_string = let s:syng_string =
\ '\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\)\>' \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\)\>'
" Regex of syntax group names that are strings or documentation. " Regex of syntax group names that are strings or documentation.
let s:syng_stringdoc = let s:syng_stringdoc =
\'\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\|Documentation\)\>' \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\|Documentation\)\>'
" Expression used to check whether we should skip a match with searchpair(). " Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = let s:skip_expr =
@@ -94,11 +94,12 @@ let s:end_skip_expr = s:skip_expr .
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")' \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
" Regex that defines continuation lines, not including (, {, or [. " Regex that defines continuation lines, not including (, {, or [.
let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' let s:non_bracket_continuation_regex =
\ '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuation lines. " Regex that defines continuation lines.
let s:continuation_regex = let s:continuation_regex =
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' \ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuable keywords " Regex that defines continuable keywords
let s:continuable_regex = let s:continuable_regex =
@@ -108,6 +109,12 @@ let s:continuable_regex =
" Regex that defines bracket continuations " Regex that defines bracket continuations
let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$' let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
" Regex that defines dot continuations
let s:dot_continuation_regex = '%\@<!\.\s*\%(#.*\)\=$'
" Regex that defines backslash continuations
let s:backslash_continuation_regex = '%\@<!\\\s*$'
" Regex that defines end of bracket continuation followed by another continuation " Regex that defines end of bracket continuation followed by another continuation
let s:bracket_switch_continuation_regex = '^\([^(]\+\zs).\+\)\+'.s:continuation_regex let s:bracket_switch_continuation_regex = '^\([^(]\+\zs).\+\)\+'.s:continuation_regex
@@ -196,7 +203,17 @@ function s:GetMSL(lnum)
" Otherwise, terminate search as we have found our MSL already. " Otherwise, terminate search as we have found our MSL already.
let line = getline(lnum) let line = getline(lnum)
if s:Match(msl, s:leading_operator_regex) if !s:Match(msl, s:backslash_continuation_regex) &&
\ s:Match(lnum, s:backslash_continuation_regex)
" If the current line doesn't end in a backslash, but the previous one
" does, look for that line's msl
"
" Example:
" foo = "bar" \
" "baz"
"
let msl = lnum
elseif s:Match(msl, s:leading_operator_regex)
" If the current line starts with a leading operator, keep its indent " If the current line starts with a leading operator, keep its indent
" and keep looking for an MSL. " and keep looking for an MSL.
let msl = lnum let msl = lnum
@@ -221,18 +238,30 @@ function s:GetMSL(lnum)
" three " three
" "
let msl = lnum let msl = lnum
elseif s:Match(lnum, s:dot_continuation_regex) &&
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
" If the current line is a bracket continuation or a block-starter, but
" the previous is a dot, keep going to see if the previous line is the
" start of another continuation.
"
" Example:
" parent.
" method_call {
" three
"
let msl = lnum
elseif s:Match(lnum, s:non_bracket_continuation_regex) && elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
" If the current line is a bracket continuation or a block-starter, but " If the current line is a bracket continuation or a block-starter, but
" the previous is a non-bracket one, keep going to see if the previous " the previous is a non-bracket one, respect the previous' indentation,
" line is a part of another continuation. " and stop here.
" "
" Example: " Example:
" method_call one, " method_call one,
" two { " two {
" three " three
" "
let msl = lnum return lnum
elseif s:Match(lnum, s:bracket_continuation_regex) && elseif s:Match(lnum, s:bracket_continuation_regex) &&
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex)) \ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
" If both lines are bracket continuations (the current may also be a " If both lines are bracket continuations (the current may also be a
@@ -363,7 +392,7 @@ function! s:FindContainingClass()
call setpos('.', saved_position) call setpos('.', saved_position)
return found_lnum return found_lnum
endif endif
endif endwhile
call setpos('.', saved_position) call setpos('.', saved_position)
return 0 return 0

View File

@@ -1,42 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim indent file
" Language: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal autoindent sw=2 et
setlocal indentexpr=GetSassIndent()
setlocal indentkeys=o,O,*<Return>,<:>,!^F
" Only define the function once.
if exists("*GetSassIndent")
finish
endif
let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)'
let s:extend = '^\s*\%(@extend\|@include\|+\)'
function! GetSassIndent()
let lnum = prevnonblank(v:lnum-1)
let line = substitute(getline(lnum),'\s\+$','','')
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
let lastcol = strlen(line)
let line = substitute(line,'^\s\+','','')
let indent = indent(lnum)
let cindent = indent(v:lnum)
if line !~ s:property && line !~ s:extend && cline =~ s:property
return indent + (exists('*shiftwidth') ? shiftwidth() : &sw)
else
return -1
endif
endfunction
" vim:set sw=2:
endif

View File

@@ -378,12 +378,17 @@ function! GetScalaIndent()
let prevline = scala#GetLine(prevlnum) let prevline = scala#GetLine(prevlnum)
let curlnum = v:lnum let curlnum = v:lnum
let curline = scala#GetLine(curlnum) let curline = scala#GetLine(curlnum)
if get(g:, 'scala_scaladoc_indent', 0)
let star_indent = 2
else
let star_indent = 1
end
if prevline =~ '^\s*/\*\*' if prevline =~ '^\s*/\*\*'
if prevline =~ '\*/\s*$' if prevline =~ '\*/\s*$'
return ind return ind
else else
return ind + 1 return ind + star_indent
endif endif
endif endif
@@ -538,7 +543,7 @@ function! GetScalaIndent()
if prevline =~ '^\s*\*/' if prevline =~ '^\s*\*/'
\ || prevline =~ '*/\s*$' \ || prevline =~ '*/\s*$'
call scala#ConditionalConfirm("18") call scala#ConditionalConfirm("18")
let ind = ind - 1 let ind = ind - star_indent
endif endif
if scala#LineEndsInIncomplete(prevline) if scala#LineEndsInIncomplete(prevline)

View File

@@ -1,16 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim indent file
" Language: SCSS
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Jul 26
if exists("b:did_indent")
finish
endif
runtime! indent/css.vim
" vim:set sw=2:
endif

48
indent/terraform.vim Normal file
View File

@@ -0,0 +1,48 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal nolisp
setlocal autoindent
setlocal indentexpr=TerraformIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=)
if exists("*TerraformIndent")
finish
endif
function! TerraformIndent(lnum)
" previous non-blank line
let prevlnum = prevnonblank(a:lnum-1)
" beginning of file?
if prevlnum == 0
return 0
endif
" previous line without comments
let prevline = substitute(getline(prevlnum), '//.*$', '', '')
let previndent = indent(prevlnum)
let thisindent = previndent
" block open?
if prevline =~ '[\[{]\s*$'
let thisindent += &sw
endif
" current line without comments
let thisline = substitute(getline(a:lnum), '//.*$', '', '')
" block close?
if thisline =~ '^\s*[\]}]'
let thisindent -= &sw
endif
return thisindent
endfunction
endif

80
indent/twig.vim Normal file
View File

@@ -0,0 +1,80 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1
if exists("b:ran_once")
finish
endif
let b:ran_once = 1
let s:baseIndentExpr=&indentexpr
setlocal indentexpr=GetTwigIndent(v:lnum)
fun! GetTwigIndent(currentLineNumber)
let currentLine = getline(a:currentLineNumber)
let previousLineNumber = prevnonblank(a:currentLineNumber - 1)
let previousLine = getline(previousLineNumber)
if (previousLine =~ s:startStructures || previousLine =~ s:middleStructures) && (currentLine !~ s:endStructures && currentLine !~ s:middleStructures)
return indent(previousLineNumber) + &shiftwidth
elseif currentLine =~ s:endStructures || currentLine =~ s:middleStructures
let previousOpenStructureNumber = s:FindPreviousOpenStructure(a:currentLineNumber)
let previousOpenStructureLine = getline(previousOpenStructureNumber)
return indent(previousOpenStructureNumber)
endif
return s:CallBaseIndent()
endf
function! s:CallBaseIndent()
exe 'redir => s:outputOfBaseIndent'
exe 'silent echo ' . s:baseIndentExpr
exe 'redir END'
return split(s:outputOfBaseIndent)[0]
endf
function! s:FindPreviousOpenStructure(lineNumber)
let countOpen = 0
let countClosed = 0
let lineNumber = a:lineNumber
while lineNumber != 1 && countOpen <= countClosed
let lineNumber -= 1
let currentLine = getline(lineNumber)
if currentLine =~ s:startStructures
let countOpen += 1
elseif currentLine =~ s:endStructures
let countClosed += 1
endif
endwhile
return lineNumber
endfunction
function! s:StartStructure(name)
return '^\s*{%\s*' . a:name . '.*%}'
endfunction
function! s:EndStructure(name)
return '^\s*{%\s*end' . a:name . '.*%}'
endfunction
function! s:Map(Fun, list)
if len(a:list) == 0
return []
else
return [a:Fun(a:list[0])] + s:Map(a:Fun, a:list[1:])
endif
endfunction
fun! s:BuildStructures()
let structures = ['if','for','block']
let mStructures = ['elseif','else']
let s:startStructures = join(s:Map(function('s:StartStructure'), structures), '\|')
let s:endStructures = join(s:Map(function('s:EndStructure'), structures), '\|')
let s:middleStructures = join(s:Map(function('s:StartStructure'), mStructures), '\|')
endfun
call s:BuildStructures()
endif

View File

@@ -1,36 +1,87 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
" Copyright (c) 2012 Takezoe Tomoaki <tkztmk@outlook.com> " Vim indent file
" " Language: Vala
" Permission is hereby granted, free of charge, to any person obtaining a copy " Author: Adrià Arrufat <adria.arrufat@protonmail.ch>
" of " Last Change: 2016 Dec 04
" this software and associated documentation files (the "Software"), to deal in
" the Software without restriction, including without limitation the rights to
" use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
" of
" the Software, and to permit persons to whom the Software is furnished to do
" so,
" subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in all
" copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" Vim indent file for Vala. " Only load this indent file when no other was loaded.
" It just sets cindent for Vala files...
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
let b:did_indent = 1 let b:did_indent = 1
setl cin
let b:undo_indent = "setl cin<"
setlocal cindent
setlocal cinoptions=L0,(0,Ws,J1,j1
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
" Some preliminary settings
setlocal nolisp " Make sure lisp indenting doesn't supersede us
setlocal autoindent " indentexpr isn't much help otherwise
setlocal indentexpr=GetValaIndent(v:lnum)
" Only define the function once.
if exists("*GetValaIndent")
finish
endif
" Come here when loading the script the first time.
function GetValaIndent(lnum)
" Hit the start of the file, use zero indent.
if a:lnum == 0
return 0
endif
" Starting assumption: cindent (called at the end) will do it right
" normally. We just want to fix up a few cases.
let line = getline(a:lnum)
" Search backwards for the previous non-empty line.
let prevlinenum = prevnonblank(a:lnum - 1)
let prevline = getline(prevlinenum)
while prevlinenum > 1 && prevline !~ '[^[:blank:]]'
let prevlinenum = prevnonblank(prevlinenum - 1)
let prevline = s:getline(prevlinenum)
endwhile
" If previous line contains a code attribute (e.g. [CCode (...)])
" don't increase the indentation
if prevline =~? '^\s*\[[A-Za-z]' && prevline =~? '\]$'
return indent(prevlinenum)
endif
" cindent gets lambda body wrong, as it treats the comma as indicating an
" unfinished statement (fix borrowed from rust.vim indent file):
"
" list.foreach ((entry) => {
" stdout.puts (entry);
" stdout.putc ('\n');
" if (entry == null) {
" print ("empty entry\n");
" }
" });
"
" and we want it to be:
" list.foreach ((entry) => {
" stdout.puts (entry);
" stdout.putc ('\n');
" if (entry == null) {
" print ("empty entry\n");
" }
" });
if prevline[len(prevline) - 1] == ","
\ && line !~ '^\s*[\[\]{}]'
\ && prevline !~ '([^()]\+,$'
\ && line !~ '^\s*\S\+\s*=>'
return indent(prevlinenum)
endif
" Fall back on cindent, which does it mostly right
return cindent(a:lnum)
endfunction
endif endif

45
indent/vue.vim Normal file
View File

@@ -0,0 +1,45 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
" Vim indent file
" Language: Vue.js
" Maintainer: Eduardo San Martin Morote
" Author: Adriaan Zonnenberg
if exists("b:did_indent")
finish
endif
" Load indent files for required languages
for language in ['stylus', 'pug', 'css', 'javascript', 'html', 'coffee']
unlet! b:did_indent
exe "runtime! indent/".language.".vim"
exe "let s:".language."indent = &indentexpr"
endfor
let b:did_indent = 1
setlocal indentexpr=GetVueIndent()
if exists("*GetVueIndent")
finish
endif
function! GetVueIndent()
if searchpair('<template lang="pug"', '', '</template>', 'bWr')
exe "let indent = ".s:pugindent
elseif searchpair('<style lang="stylus"', '', '</style>', 'bWr')
exe "let indent = ".s:stylusindent
elseif searchpair('<style', '', '</style>', 'bWr')
exe "let indent = ".s:cssindent
elseif searchpair('<script lang="coffee"', '', '</script>', 'bWr')
exe "let indent = ".s:coffeeindent
elseif searchpair('<script', '', '</script>', 'bWr')
exe "let indent = ".s:javascriptindent
else
exe "let indent = ".s:htmlindent
endif
return indent > -1 ? indent : s:htmlindent
endfunction
endif

View File

@@ -31,8 +31,15 @@ syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}"
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue @unset @lang @choice nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim containedin=ALLBUT,@bladeExempt \ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue
\ @unset @lang @choice @component @slot
\ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan
\ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent
\ @endslot
\ containedin=ALLBUT,@bladeExempt
if exists('g:blade_custom_directives') if exists('g:blade_custom_directives')
exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt" exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"

View File

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
" Vim syntax file " Vim syntax file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Apr 10 " Last Change: 2016 Nov 17
" 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")
@@ -184,11 +184,6 @@ syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumbe
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
"hex number "hex number
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
if s:ft ==# 'cpp' && !exists("cpp_no_cpp14")
syn match cNumber display contained "\d\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cNumber display contained "0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cNumber display contained "0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
endif
" Flag the first zero of an octal number as something special " Flag the first zero of an octal number as something special
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
syn match cOctalZero display contained "\<0" syn match cOctalZero display contained "\<0"
@@ -365,36 +360,36 @@ if !exists("c_no_c99") " ISO C99
endif endif
" Accept %: for # (C99) " Accept %: for # (C99)
syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
syn match cPreConditMatch display "^\s*\(%:\|#\)\s*\(else\|endif\)\>" syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
if !exists("c_no_if0") if !exists("c_no_if0")
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
syn region cCppOutWrapper start="^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
if !exists("c_no_if0_fold") if !exists("c_no_if0_fold")
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
else else
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
endif endif
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
syn region cCppInWrapper start="^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
if !exists("c_no_if0_fold") if !exists("c_no_if0_fold")
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
else else
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
endif endif
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
endif endif
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>" syn match cIncluded display contained "<[^>]*>"
syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
"syn match cLineSkip "\\$" "syn match cLineSkip "\\$"
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
" Highlight User Labels " Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
@@ -403,21 +398,21 @@ if s:ft ==# 'c' || exists("cpp_no_cpp11")
endif endif
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':' " Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn cluster cLabelGroup contains=cUserLabel syn cluster cLabelGroup contains=cUserLabel
syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
if s:ft ==# 'cpp' if s:ft ==# 'cpp'
syn match cUserCont display "^\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
syn match cUserCont display ";\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
else else
syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display "^\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup syn match cUserCont display ";\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
endif endif
syn match cUserLabel display "\I\i*" contained syn match cUserLabel display "\I\i*" contained
" Avoid recognizing most bitfields as labels " Avoid recognizing most bitfields as labels
syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
if exists("c_minlines") if exists("c_minlines")
let b:c_minlines = c_minlines let b:c_minlines = c_minlines

View File

@@ -34,7 +34,7 @@ hi def link coffeeConditional Conditional
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
hi def link coffeeException Exception hi def link coffeeException Exception
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\)\>/ syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\)\>/
\ display \ display
" The `own` keyword is only a keyword after `for`. " The `own` keyword is only a keyword after `for`.
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
@@ -109,7 +109,7 @@ hi def link coffeeFloat Float
" An error for reserved keywords, taken from the RESERVED array: " An error for reserved keywords, taken from the RESERVED array:
" http://coffeescript.org/documentation/docs/lexer.html#section-67 " http://coffeescript.org/documentation/docs/lexer.html#section-67
syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\)\>/ syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|native\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
\ display \ display
hi def link coffeeReservedError Error hi def link coffeeReservedError Error

View File

@@ -4,23 +4,16 @@ 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 Nov 10 " Last Change: 2016 Oct 28
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C syntax to start with " Read the C syntax to start with
if version < 600 runtime! syntax/c.vim
so <sfile>:p:h/c.vim unlet b:current_syntax
else
runtime! syntax/c.vim
unlet b:current_syntax
endif
" C++ extensions " C++ extensions
syn keyword cppStatement new delete this friend using syn keyword cppStatement new delete this friend using
@@ -39,8 +32,8 @@ syn keyword cppConstant __cplusplus
" C++ 11 extensions " C++ 11 extensions
if !exists("cpp_no_cpp11") if !exists("cpp_no_cpp11")
syn keyword cppModifier override final auto syn keyword cppModifier override final
syn keyword cppType nullptr_t syn keyword cppType nullptr_t auto
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
@@ -55,36 +48,31 @@ endif
" C++ 14 extensions " C++ 14 extensions
if !exists("cpp_no_cpp14") if !exists("cpp_no_cpp14")
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>" syn case ignore
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn case match
endif endif
" The minimum and maximum operators in GNU C++ " The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?" syn match cppMinMax "[<>]?"
" Default highlighting " Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits") hi def link cppAccess cppStatement
if version < 508 hi def link cppCast cppStatement
let did_cpp_syntax_inits = 1 hi def link cppExceptions Exception
command -nargs=+ HiLink hi link <args> hi def link cppOperator Operator
else hi def link cppStatement Statement
command -nargs=+ HiLink hi def link <args> hi def link cppModifier Type
endif hi def link cppType Type
HiLink cppAccess cppStatement hi def link cppStorageClass StorageClass
HiLink cppCast cppStatement hi def link cppStructure Structure
HiLink cppExceptions Exception hi def link cppBoolean Boolean
HiLink cppOperator Operator hi def link cppConstant Constant
HiLink cppStatement Statement hi def link cppRawStringDelimiter Delimiter
HiLink cppModifier Type hi def link cppRawString String
HiLink cppType Type hi def link cppNumber Number
HiLink cppStorageClass StorageClass
HiLink cppStructure Structure
HiLink cppBoolean Boolean
HiLink cppConstant Constant
HiLink cppRawStringDelimiter Delimiter
HiLink cppRawString String
HiLink cppNumber Number
delcommand HiLink
endif
let b:current_syntax = "cpp" let b:current_syntax = "cpp"

View File

@@ -4,6 +4,9 @@ if exists("b:current_syntax")
finish finish
endif endif
let s:cpo_save = &cpo
set cpo&vim
if !exists("main_syntax") if !exists("main_syntax")
let main_syntax = 'eelixir' let main_syntax = 'eelixir'
endif endif
@@ -62,4 +65,7 @@ if main_syntax == 'eelixir'
unlet main_syntax unlet main_syntax
endif endif
let &cpo = s:cpo_save
unlet s:cpo_save
endif endif

View File

@@ -4,25 +4,29 @@ if exists("b:current_syntax")
finish finish
endif endif
let s:cpo_save = &cpo
set cpo&vim
" syncing starts 2000 lines before top line so docstrings don't screw things up " syncing starts 2000 lines before top line so docstrings don't screw things up
syn sync minlines=2000 syn sync minlines=2000
syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition,elixirUnusedVariable,elixirStructDelimiter
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
syn match elixirComment '#.*' contains=elixirTodo,@Spell syn match elixirComment '#.*' contains=elixirTodo,@Spell
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 with cond for if unless try receive send syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
syn keyword elixirKeyword exit raise throw after rescue catch else
syn keyword elixirKeyword quote unquote super spawn spawn_link spawn_monitor
" Functions used on guards syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|send\)\>'
syn keyword elixirKeyword contained is_atom is_binary is_bitstring is_boolean syn match elixirKeyword '\(\.\)\@<!\<\(exit\|raise\|throw\|after\|rescue\|catch\|else\)\>'
syn keyword elixirKeyword contained is_float is_function is_integer is_list syn match elixirKeyword '\(\.\)\@<!\<\(quote\|unquote\|super\|spawn\|spawn_link\|spawn_monitor\)\>'
syn keyword elixirKeyword contained is_map is_nil is_number is_pid is_port
syn keyword elixirKeyword contained is_record is_reference is_tuple is_exception " Kernel functions
syn keyword elixirKeyword contained abs bit_size byte_size div elem hd length syn match elixirKernelFunction contained containedin=elixirGuard '\<\(is_atom\|is_binary\|is_bitstring\|is_boolean\|is_float\|is_function\|is_integer\|is_list\|is_map\|is_nil\|is_number\|is_pid\|is_port\)\>\([ (]\)\@='
syn keyword elixirKeyword contained map_size node rem round tl trunc tuple_size syn match elixirKernelFunction contained containedin=elixirGuard '\<\(is_record\|is_reference\|is_tuple\|is_exception\|abs\|bit_size\|byte_size\|div\|elem\|hd\|length\|map_size\|node\|rem\|round\|tl\|trunc\|tuple_size\)\>\([ (]\)\@='
syn match elixirGuard '.*when.*' contains=ALLBUT,@elixirNotTop syn match elixirGuard '.*when.*' contains=ALLBUT,@elixirNotTop
@@ -30,12 +34,10 @@ syn keyword elixirInclude import require alias use
syn keyword elixirSelf self syn keyword elixirSelf self
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
" This unfortunately also matches function names in function calls " This unfortunately also matches function names in function calls
syn match elixirUnusedVariable '\(([^)]*\)\@<=\<_\w*\>' syn match elixirUnusedVariable contained '\<_\w*\>'
syn keyword elixirOperator and not or when xor in syn keyword elixirOperator and not or in
syn match elixirOperator '!==\|!=\|!' syn match elixirOperator '!==\|!=\|!'
syn match elixirOperator '=\~\|===\|==\|=' syn match elixirOperator '=\~\|===\|==\|='
syn match elixirOperator '<<<\|<<\|<=\|<-\|<' syn match elixirOperator '<<<\|<<\|<=\|<-\|<'
@@ -52,7 +54,9 @@ syn match elixirAtom '\(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\
syn match elixirAtom '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)' syn match elixirAtom '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)'
syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!" syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!"
syn match elixirAlias '\<[!]\?[A-Z]\w*\(\.[A-Z]\w*\)*\>' syn match elixirBlockInline "\<\(do\|else\)\>:\@="
syn match elixirAlias '\([a-z]\)\@<![A-Z]\w*'
syn keyword elixirBoolean true false nil syn keyword elixirBoolean true false nil
@@ -73,25 +77,27 @@ syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|
syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation syn region elixirTuple matchgroup=elixirTupleDelimiter start="\(\w\|#\)\@<!{" end="}" contains=ALLBUT,@elixirNotTop
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'\|\\\\" contains=@elixirStringContained syn match elixirStructDelimiter '{' contained containedin=elixirStruct
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained syn region elixirStruct matchgroup=elixirStructDelimiter start="%\(\w\+{\)\@=" end="}" contains=ALLBUT,@elixirNotTop
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop syn region elixirMap matchgroup=elixirMapDelimiter start="%{" end="}" contains=ALLBUT,@elixirNotTop
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell keepend fold syn region elixirString matchgroup=elixirStringDelimiter start=+\z('\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirStringContained
syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell keepend fold syn region elixirString matchgroup=elixirStringDelimiter start=+\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirStringContained
syn region elixirString matchgroup=elixirStringDelimiter start=+\z('''\)+ end=+^\s*\z1+ contains=@elixirStringContained
syn region elixirString matchgroup=elixirStringDelimiter start=+\z("""\)+ end=+^\s*\z1+ contains=@elixirStringContained
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirKernelFunction,elixirComment,@elixirNotTop
syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)" syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigilDelimiter syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigilDelimiter,elixirAnonymousFunction
syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE
@@ -106,26 +112,49 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l{"
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" contains=@elixirStringContained,elixirRegexEscapePunctuation fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" contains=@elixirStringContained,elixirRegexEscapePunctuation fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" contains=@elixirStringContained,elixirRegexEscapePunctuation fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" end="\/" skip="\\\\\|\\\/" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
" Sigils surrounded with docString " Sigils surrounded with heredoc
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1\s*$+ skip=+\\"+ fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1\s*$+ skip=+\\'+ fold
" Documentation
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
syn include @markdown syntax/markdown.vim
syn cluster elixirDocStringContained contains=@markdown,@Spell
else
let g:elixir_use_markdown_for_docs = 0
syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell
" doctests
syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained
endif
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend
syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend
" Defines " Defines
syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn keyword elixirPrivateDefine defp nextgroup=elixirFunctionDeclaration skipwhite skipnl syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
syn keyword elixirModuleDefine defmodule nextgroup=elixirModuleDeclaration skipwhite skipnl syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
syn keyword elixirProtocolDefine defprotocol nextgroup=elixirProtocolDeclaration skipwhite skipnl syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
syn keyword elixirImplDefine defimpl nextgroup=elixirImplDeclaration skipwhite skipnl syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
syn keyword elixirRecordDefine defrecord nextgroup=elixirRecordDeclaration skipwhite skipnl syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
syn keyword elixirPrivateRecordDefine defrecordp nextgroup=elixirRecordDeclaration skipwhite skipnl syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
syn keyword elixirMacroDefine defmacro nextgroup=elixirMacroDeclaration skipwhite skipnl syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
syn keyword elixirPrivateMacroDefine defmacrop nextgroup=elixirMacroDeclaration skipwhite skipnl syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
syn keyword elixirDelegateDefine defdelegate nextgroup=elixirDelegateDeclaration skipwhite skipnl syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
syn keyword elixirStructDefine defstruct skipwhite skipnl syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl
" Declarations " Declarations
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirBlock skipwhite skipnl syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirBlock skipwhite skipnl
@@ -140,8 +169,12 @@ syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained con
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration " ExUnit
syn match elixirExUnitMacro "\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all\|on_exit\|doctest\)\>"
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>"
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>"
hi def link elixirBlockInline Keyword
hi def link elixirBlockDefinition Keyword hi def link elixirBlockDefinition Keyword
hi def link elixirDefine Define hi def link elixirDefine Define
hi def link elixirPrivateDefine Define hi def link elixirPrivateDefine Define
@@ -157,12 +190,16 @@ hi def link elixirOverridableDefine Define
hi def link elixirExceptionDefine Define hi def link elixirExceptionDefine Define
hi def link elixirCallbackDefine Define hi def link elixirCallbackDefine Define
hi def link elixirStructDefine Define hi def link elixirStructDefine Define
hi def link elixirExUnitMacro Define
hi def link elixirModuleDeclaration Type
hi def link elixirFunctionDeclaration Function hi def link elixirFunctionDeclaration Function
hi def link elixirMacroDeclaration Macro hi def link elixirMacroDeclaration Macro
hi def link elixirInclude Include hi def link elixirInclude Include
hi def link elixirComment Comment hi def link elixirComment Comment
hi def link elixirTodo Todo hi def link elixirTodo Todo
hi def link elixirKeyword Keyword hi def link elixirKeyword Keyword
hi def link elixirExUnitAssert Keyword
hi def link elixirKernelFunction Keyword
hi def link elixirOperator Operator hi def link elixirOperator Operator
hi def link elixirAtom Constant hi def link elixirAtom Constant
hi def link elixirPseudoVariable Constant hi def link elixirPseudoVariable Constant
@@ -172,7 +209,8 @@ hi def link elixirVariable Identifier
hi def link elixirSelf Identifier hi def link elixirSelf Identifier
hi def link elixirUnusedVariable Comment hi def link elixirUnusedVariable Comment
hi def link elixirNumber Number hi def link elixirNumber Number
hi def link elixirDocString String hi def link elixirDocString Comment
hi def link elixirDocTest elixirKeyword
hi def link elixirAtomInterpolated elixirAtom hi def link elixirAtomInterpolated elixirAtom
hi def link elixirRegex elixirString hi def link elixirRegex elixirString
hi def link elixirRegexEscape elixirSpecial hi def link elixirRegexEscape elixirSpecial
@@ -189,4 +227,7 @@ hi def link elixirSigilDelimiter Delimiter
let b:current_syntax = "elixir" let b:current_syntax = "elixir"
let &cpo = s:cpo_save
unlet s:cpo_save
endif endif

View File

@@ -23,7 +23,7 @@ syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit 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 "^\s*#.*" contains=gitrebaseHash
syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite
hi def link gitrebaseCommit gitrebaseHash hi def link gitrebaseCommit gitrebaseHash

View File

@@ -8,7 +8,7 @@ if exists("b:current_syntax") && b:current_syntax == "glsl"
endif endif
" Statements " Statements
syn keyword glslConditional if else syn keyword glslConditional if else switch case default
syn keyword glslRepeat for while do syn keyword glslRepeat for while do
syn keyword glslStatement discard return break continue syn keyword glslStatement discard return break continue

View File

@@ -12,9 +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 off:
" At present, all options default to on, except highlight of:
" functions, methods, structs, operators, build constraints and interfaces.
" "
" - go_highlight_array_whitespace_error " - go_highlight_array_whitespace_error
" Highlights white space after "[]". " Highlights white space after "[]".
@@ -38,23 +36,23 @@ if exists("b:current_syntax")
endif endif
if !exists("g:go_highlight_array_whitespace_error") if !exists("g:go_highlight_array_whitespace_error")
let g:go_highlight_array_whitespace_error = 1 let g:go_highlight_array_whitespace_error = 0
endif endif
if !exists("g:go_highlight_chan_whitespace_error") if !exists("g:go_highlight_chan_whitespace_error")
let g:go_highlight_chan_whitespace_error = 1 let g:go_highlight_chan_whitespace_error = 0
endif endif
if !exists("g:go_highlight_extra_types") if !exists("g:go_highlight_extra_types")
let g:go_highlight_extra_types = 1 let g:go_highlight_extra_types = 0
endif endif
if !exists("g:go_highlight_space_tab_error") if !exists("g:go_highlight_space_tab_error")
let g:go_highlight_space_tab_error = 1 let g:go_highlight_space_tab_error = 0
endif endif
if !exists("g:go_highlight_trailing_whitespace_error") if !exists("g:go_highlight_trailing_whitespace_error")
let g:go_highlight_trailing_whitespace_error = 1 let g:go_highlight_trailing_whitespace_error = 0
endif endif
if !exists("g:go_highlight_operators") if !exists("g:go_highlight_operators")
@@ -127,12 +125,14 @@ hi def link goComplexes Type
" Predefined functions and values " Predefined functions and values
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/ syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/
syn keyword goBoolean iota true false nil syn keyword goBoolean true false
syn keyword goPredefinedIdentifiers nil iota
hi def link goBuiltins Keyword hi def link goBuiltins Keyword
hi def link goBoolean Boolean hi def link goBoolean Boolean
hi def link goPredefinedIdentifiers goBoolean
" Comments; their contents " Comments; their contents
syn keyword goTodo contained TODO FIXME XXX BUG syn keyword goTodo contained TODO FIXME XXX BUG
@@ -177,7 +177,7 @@ else
endif endif
if g:go_highlight_format_strings != 0 if g:go_highlight_format_strings != 0
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString syn match goFormatSpecifier /\([^%]\(%%\)*\)\@<=%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
hi def link goFormatSpecifier goSpecialString hi def link goFormatSpecifier goSpecialString
endif endif
@@ -273,6 +273,7 @@ hi def link goSpaceError Error
syn keyword goTodo contained NOTE syn keyword goTodo contained NOTE
hi def link goTodo Todo hi def link goTodo Todo
syn match goVarArgs /\.\.\./
" Operators; " Operators;
if g:go_highlight_operators != 0 if g:go_highlight_operators != 0
@@ -287,9 +288,9 @@ if g:go_highlight_operators != 0
" match remaining two-char operators: := && || <- ++ -- " match remaining two-char operators: := && || <- ++ --
syn match goOperator /:=\|||\|<-\|++\|--/ syn match goOperator /:=\|||\|<-\|++\|--/
" match ... " match ...
syn match goOperator /\.\.\./
hi def link goPointerOperator Operator hi def link goPointerOperator goOperator
hi def link goVarArgs goOperator
endif endif
hi def link goOperator Operator hi def link goOperator Operator
@@ -301,21 +302,22 @@ if g:go_highlight_functions != 0
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
syn match goReceiverType /\w\+/ contained syn match goReceiverType /\w\+/ contained
syn match goFunction /\w\+/ contained syn match goFunction /\w\+/ contained
syn match goFunctionCall /\w\+\ze(/ contains=GoBuiltins,goDeclaration
else else
syn keyword goDeclaration func syn keyword goDeclaration func
endif endif
hi def link goFunction Function hi def link goFunction Function
hi def link goFunctionCall Type
" Methods; " Methods;
if g:go_highlight_methods != 0 if g:go_highlight_methods != 0
syn match goMethod /\.\w\+\ze(/hs=s+1 syn match goMethodCall /\.\w\+\ze(/hs=s+1
endif endif
hi def link goMethod Type hi def link goMethodCall Type
" Fields; " Fields;
if g:go_highlight_fields != 0 if g:go_highlight_fields != 0
syn match goVarArgs /\.\.\.\w\+\>/ syn match goField /\.\w\+\([.\ \n\r\:\)\[,]\)\@=/hs=s+1
syn match goField /\.\a\+\([\ \n\r\:\)\[]\)\@=/hs=s+1
endif endif
hi def link goField Identifier hi def link goField Identifier
@@ -324,7 +326,7 @@ if g:go_highlight_types != 0
syn match goTypeConstructor /\<\w\+{/he=e-1 syn match goTypeConstructor /\<\w\+{/he=e-1
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl syn match goDeclType /\<interface\|struct\>/ skipwhite skipnl
hi def link goReceiverType Type hi def link goReceiverType Type
else else
syn keyword goDeclType struct interface syn keyword goDeclType struct interface
@@ -368,13 +370,22 @@ if g:go_highlight_build_constraints != 0
hi def link goPackageComment Comment hi def link goPackageComment Comment
endif endif
" :GoSameIds
hi def goSameId term=bold cterm=bold ctermbg=white ctermfg=black
" :GoCoverage commands " :GoCoverage commands
hi def link goCoverageNormalText Comment hi def link goCoverageNormalText Comment
hi def goCoverageCovered ctermfg=green
hi def goCoverageUncover ctermfg=red function! s:hi()
hi def link goSameId Search
" :GoCoverage commands
hi def goCoverageCovered ctermfg=green guifg=#A6E22E
hi def goCoverageUncover ctermfg=red guifg=#F92672
endfunction
augroup vim-go-hi
autocmd!
autocmd ColorScheme * call s:hi()
augroup end
call s:hi()
" Search backwards for a global declaration to start processing the syntax. " Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/

View File

@@ -13,6 +13,15 @@ elseif exists("b:current_syntax")
finish finish
endif endif
if !exists('g:haskell_disable_TH')
let g:haskell_disable_TH = 0
endif
if exists('g:haskell_backpack') && g:haskell_backpack == 1
syn keyword haskellBackpackStructure unit signature
syn keyword haskellBackpackDependency dependency
endif
syn spell notoplevel syn spell notoplevel
syn match haskellRecordField contained containedin=haskellBlock syn match haskellRecordField contained containedin=haskellBlock
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
@@ -31,7 +40,7 @@ syn match haskellTypeSig
\ haskellOperators, \ haskellOperators,
\ haskellSeparator, \ haskellSeparator,
\ haskellParens \ haskellParens
syn keyword haskelLWhere where syn keyword haskellWhere where
syn keyword haskellLet let syn keyword haskellLet let
syn keyword haskellDeclKeyword module class instance newtype deriving in syn keyword haskellDeclKeyword module class instance newtype deriving in
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?" syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
@@ -44,7 +53,7 @@ syn region haskellForeignImport start="\<foreign\>" end="::" keepend
\ haskellOperators, \ haskellOperators,
\ haskellForeignKeywords, \ haskellForeignKeywords,
\ haskellIdentifier \ haskellIdentifier
syn match haskellImport "^\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+\)\?.\+\(\s\+\<as\>\s\+.\+\)\?\(\s\+\<hiding\>\)\?" syn match haskellImport "^\s*\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+\)\?.\+\(\s\+\<as\>\s\+.\+\)\?\(\s\+\<hiding\>\)\?"
\ contains= \ contains=
\ haskellParens, \ haskellParens,
\ haskellOperators, \ haskellOperators,
@@ -82,7 +91,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
\ contains= \ contains=
\ haskellTodo, \ haskellTodo,
\ @Spell \ @Spell
syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*`" syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*#\?`"
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+ 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
@@ -94,14 +103,16 @@ syn region haskellBlockComment start="{-" end="-}"
\ 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 haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" 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 " Treat a shebang line at the start of the file as a comment
syn match haskellShebang "\%^#!.*$" syn match haskellShebang "\%^#!.*$"
if exists('g:haskell_disable_TH') && g:haskell_disable_TH == 0
syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]"
syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
endif
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
@@ -145,26 +156,21 @@ highlight def link haskellChar String
highlight def link haskellBacktick Operator highlight def link haskellBacktick Operator
highlight def link haskellQuasiQuoted String highlight def link haskellQuasiQuoted String
highlight def link haskellTodo Todo highlight def link haskellTodo Todo
highlight def link haskellPreProc PreProc
highlight def link haskellAssocType Type
highlight def link haskellQuotedType Type
highlight def link haskellType Type
highlight def link haskellImportKeywords Include
if exists('g:haskell_classic_highlighting') && g:haskell_classic_highlighting == 1 if exists('g:haskell_classic_highlighting') && g:haskell_classic_highlighting == 1
highlight def link haskellPreProc PreProc
highlight def link haskellAssocType Type
highlight def link haskellImportKeywords Include
highlight def link haskellDeclKeyword Keyword highlight def link haskellDeclKeyword Keyword
highlight def link haskellDecl Keyword highlight def link haskellDecl Keyword
highlight def link haskellWhere Keyword highlight def link haskellWhere Keyword
highlight def link haskellLet Keyword highlight def link haskellLet Keyword
highlight def link haskellQuotedType Type
highlight def link haskellType Type
else else
highlight def link haskellPreProc Macro
highlight def link haskellAssocType Structure
highlight def link haskellImportKeywords Structure
highlight def link haskellDeclKeyword Structure highlight def link haskellDeclKeyword Structure
highlight def link haskellDecl Structure highlight def link haskellDecl Structure
highlight def link haskellWhere Structure highlight def link haskellWhere Structure
highlight def link haskellLet Structure highlight def link haskellLet Structure
highlight def link haskellQuotedType Include
highlight def link haskellType Include
endif endif
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1 if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
@@ -195,6 +201,10 @@ else
endif endif
endif endif
if exists('g:haskell_backpack') && g:haskell_backpack == 1
highlight def link haskellBackpackStructure Structure
highlight def link haskellBackpackDependency Include
endif
let b:current_syntax = "haskell" let b:current_syntax = "haskell"
endif endif

View File

@@ -44,8 +44,31 @@ syn keyword htmlTagName contained missing-glyph mpath
syn keyword htmlTagName contained text textPath tref tspan vkern syn keyword htmlTagName contained text textPath tref tspan vkern
syn keyword htmlTagName contained metadata title syn keyword htmlTagName contained metadata title
" MathML tags
" https://www.w3.org/TR/MathML3/appendixi.html#index.elem
syn keyword htmlTagName contained abs and annotation annotation-xml apply approx arccos arccosh arccot arccoth
syn keyword htmlTagName contained arccsc arccsch arcsec arcsech arcsin arcsinh arctan arctanh arg bind
syn keyword htmlTagName contained bvar card cartesianproduct cbytes ceiling cerror ci cn codomain complexes
syn keyword htmlTagName contained compose condition conjugate cos cosh cot coth cs csc csch
syn keyword htmlTagName contained csymbol curl declare degree determinant diff divergence divide domain domainofapplication
syn keyword htmlTagName contained emptyset eq equivalent eulergamma exists exp exponentiale factorial factorof false
syn keyword htmlTagName contained floor fn forall gcd geq grad gt ident image imaginary
syn keyword htmlTagName contained imaginaryi implies in infinity int integers intersect interval inverse lambda
syn keyword htmlTagName contained laplacian lcm leq limit list ln log logbase lowlimit lt
syn keyword htmlTagName contained maction maligngroup malignmark math matrix matrixrow max mean median menclose
syn keyword htmlTagName contained merror mfenced mfrac mglyph mi mi" min minus mlabeledtr mlongdiv
syn keyword htmlTagName contained mmultiscripts mn mo mode moment momentabout mover mpadded mphantom mprescripts
syn keyword htmlTagName contained mroot mrow ms mscarries mscarry msgroup msline mspace msqrt msrow
syn keyword htmlTagName contained mstack mstyle msub msubsup msup mtable mtd mtext mtr munder
syn keyword htmlTagName contained munderover naturalnumbers neq none not notanumber notin notprsubset notsubset or
syn keyword htmlTagName contained otherwise outerproduct partialdiff pi piece piecewise plus power primes product
syn keyword htmlTagName contained prsubset quotient rationals real reals reln rem root scalarproduct sdev
syn keyword htmlTagName contained sec sech selector semantics sep set setdiff share sin sinh
syn keyword htmlTagName contained span subset sum tan tanh tendsto times transpose true union
syn keyword htmlTagName contained uplimit variance vector vectorproduct xor
" Custom Element " Custom Element
syn match htmlTagName contained "\<[a-z_]\([a-z0-9_.]\+\)\?\(\-[a-z0-9_.]\+\)\+\>" syn match htmlTagName contained "\<[a-z][-.0-9_a-z]*-[-.0-9_a-z]*\>"
" HTML 5 arguments " HTML 5 arguments
" Core Attributes " Core Attributes
@@ -79,13 +102,26 @@ syn keyword htmlArg contained async
" <content> " <content>
syn keyword htmlArg contained select syn keyword htmlArg contained select
" <iframe> " <iframe>
syn keyword htmlArg contained seamless srcdoc sandbox syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen
" <picture> " <picture>
syn keyword htmlArg contained srcset sizes syn keyword htmlArg contained srcset sizes
" <a>
syn keyword htmlArg contained download media
" <script>, <style>
syn keyword htmlArg contained nonce
" <area>, <a>, <img>, <iframe>, <link>
syn keyword htmlArg contained referrerpolicy
" <script>
" https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute
syn keyword htmlArg contained integrity crossorigin
" Custom Data Attributes " Custom Data Attributes
" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data " http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\=\>" contained syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\{1,}\>" contained
" Vendor Extension Attributes
" http://w3c.github.io/html/single-page.html#conformance-requirements-extensibility
syn match htmlArg "\<\(x\-\([a-z_][a-z0-9_.\-]*\)\+\)\{2,}\>" contained
" Microdata " Microdata
" http://dev.w3.org/html5/md/ " http://dev.w3.org/html5/md/
@@ -120,4 +156,22 @@ syn keyword htmlArg contained y y1 y2 yChannelSelector
syn keyword htmlArg contained z zoomAndPan syn keyword htmlArg contained z zoomAndPan
syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode
" MathML attributes
" https://www.w3.org/TR/MathML3/chapter2.html#interf.toplevel.atts
syn keyword htmlArg contained accent accentunder actiontype align alignmentscope altimg altimg-height altimg-valign altimg-width alttext
syn keyword htmlArg contained annotation-xml background base baseline bevelled cd cdgroup charalign charspacing close
syn keyword htmlArg contained closure color columnalign columnalignment columnlines columnspacing columnspan columnwidth crossout decimalpoint
syn keyword htmlArg contained definitionURL denomalign depth display displaystyle edge encoding equalcolumns equalrows fence
syn keyword htmlArg contained fontfamily fontsize fontstyle fontweight form frame framespacing groupalign height indentalign
syn keyword htmlArg contained indentalignfirst indentalignlast indentshift indentshiftfirst indentshiftlast indenttarget index infixlinebreakstyle integer largeop
syn keyword htmlArg contained leftoverhang length linebreak linebreakmultchar linebreakstyle lineleading linethickness location longdivstyle lquote
syn keyword htmlArg contained lspace ltr macros math mathbackground mathcolor mathsize mathvariant maxsize maxwidth
syn keyword htmlArg contained mediummathspace menclose minlabelspacing minsize mode movablelimits msgroup mslinethickness name nargs
syn keyword htmlArg contained newline notation numalign number occurrence open order other overflow position
syn keyword htmlArg contained rightoverhang role rowalign rowlines rowspacing rowspan rquote rspace schemaLocation scope
syn keyword htmlArg contained scriptlevel scriptminsize scriptsize scriptsizemultiplier selection separator separators shift side stackalign
syn keyword htmlArg contained stretchy subscriptshift superscriptshift symmetric thickmathspace thinmathspace type valign verythickmathspace verythinmathspace
syn keyword htmlArg contained veryverythickmathspace veryverythinmathspace voffset width xref
endif endif

134
syntax/i3.vim Normal file
View File

@@ -0,0 +1,134 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
" Vim syntax file
" Language: i3-wm config file
" Maintainer: Emanuel Guével
" Latest Revision: 16 October 2012
if exists("b:current_syntax")
finish
endif
" Symbols
syn match i3Operators "+\|→"
syn match i3ChainDelimiter ";"
syn match i3Var "\$\w\+"
" Key modifiers
syn keyword i3KeyModifier Shift Control Ctrl Mod1 Mod2 Mod3 Mod4 Mod5 Mode_switch
" Strings
syn region i3SimpleString keepend start='[^ \t]' end='$\|;' contained contains=i3ChainDelimiter,i3Var
syn match i3QuotedString '"[^"]\+"' contained
syn cluster i3String contains=i3SimpleString,i3QuotedString
" Config commands
syn keyword i3ConfigCommand bind bindcode bindsym assign new_window popup_during_fullscreen font floating_modifier default_orientation workspace_layout for_window focus_follows_mouse bar position colors output tray_output workspace_buttons workspace_auto_back_and_forth binding_mode_indicator debuglog floating_minimum_size floating_maximum_size force_focus_wrapping force_xinerama force_display_urgency_hint hidden_state modifier new_float shmlog socket_path verbose mouse_warping strip_workspace_numbers focus_on_window_activation no_focus
syn match i3IpcSocket "ipc[-_]socket" nextgroup=@i3String skipwhite
" Command keywords
syn keyword i3Command exit reload restart kill fullscreen global layout border focus move open split append_layout mark unmark resize grow shrink show nop rename title_format sticky
syn keyword i3Param 1pixel default stacked tabbed normal none tiling stacking floating enable disable up down horizontal vertical auto up down left right parent child px or ppt leave_fullscreen toggle mode_toggle scratchpad width height top bottom client hide primary yes all active window container to absolute center on off x ms h v smart ignore pixel splith splitv output true
syn match i3DashedParam '--\(release\|border\|whole-window\|toggle\)' skipwhite
syn match i3NoStartupId '--no-startup-id' contained
syn keyword i3WsSpecialParam next prev next_on_output prev_on_output back_and_forth current number
syn keyword i3BordersSpecialParam none vertical horizontal both
syn keyword i3ModeParam dock hide invisible skipwhite
" these are not keywords but we add them for consistency
syn keyword i3PseudoParam no false inactive
" Exec commands
syn region i3ExecCommand keepend start='[^ \t]' end='$\|;' contained contains=i3ChainDelimiter,i3Var,i3NoStartupId
syn match i3QuotedExecCommand '"[^"]\+"' contained
syn keyword i3ExecKeyword exec exec_always i3bar_command nextgroup=i3QuotedExecCommand,i3ExecCommand skipwhite
" Status command
syn match i3StatusCommand ".*$" contained
syn keyword i3StatusCommandKeyword status_command nextgroup=i3StatusCommand skipwhite
" Font statement
syn keyword i3FontStatement font nextgroup=@i3String skipwhite
" Separator symbol
syn keyword i3SeparatorSymbol separator_symbol nextgroup=@i3String skipwhite
" Set statement
syn match i3SetVar "\$\w\+" contained nextgroup=@i3String skipwhite
syn keyword i3SetKeyword set nextgroup=i3SetVar skipwhite
" Workspaces
syn keyword i3WsKeyword workspace nextgroup=i3WsSpecialParam,@i3String skipwhite
" Hide edge borders
syn keyword i3BordersConfigCommand hide_edge_borders nextgroup=i3BordersSpecialParam skipwhite
" Mode
syn keyword i3ModeKeyword mode nextgroup=i3ModeParam,@i3String skipwhite
" Comments
syn keyword i3Todo contained TODO FIXME XXX NOTE
syn match i3Comment "^\s*#.*$" contains=i3Todo
" Error (at end of line)
syn match i3Error ".*$" contained
" Hex color code
syn match i3ColorLast "#[0-9a-fA-F]\{6\}" contained nextgroup=i3Error skipwhite
syn match i3Color2nd "#[0-9a-fA-F]\{6\}" contained nextgroup=i3ColorLast skipwhite
syn match i3Color1st "#[0-9a-fA-F]\{6\}" contained nextgroup=i3Color2nd skipwhite
syn match i3ColorDef1 "client\.background\|statusline\|background\|separator\|statusline" nextgroup=i3ColorLast skipwhite
syn match i3ColorDef3 "client\.\(focused_inactive\|focused\|unfocused\|urgent\)\|inactive_workspace\|urgent_workspace\|focused_workspace\|active_workspace" nextgroup=i3Color1st skipwhite
highlight link i3ChainDelimiter Operator
highlight link i3Operators Operator
highlight link i3ExecCommand Special
highlight link i3QuotedExecCommand Special
highlight link i3StatusCommand Special
highlight link i3Param Constant
highlight link i3PseudoParam Constant
highlight link i3DashedParam Constant
highlight link i3NoStartupId Constant
highlight link i3Color1st Constant
highlight link i3Color2nd Constant
highlight link i3ColorLast Constant
highlight link i3WsSpecialParam Constant
highlight link i3BordersSpecialParam Constant
highlight link i3ModeParam Constant
highlight link i3Var Identifier
highlight link i3SetVar Identifier
highlight link i3KeyModifier Function
highlight link i3SimpleString String
highlight link i3QuotedString String
highlight link i3WsName String
highlight link i3QuotedWsName String
highlight link i3SetValue String
highlight link i3Font String
highlight link i3ExecKeyword Keyword
highlight link i3Command Keyword
highlight link i3WsKeyword Keyword
highlight link i3ColorDef1 Define
highlight link i3ColorDef3 Define
highlight link i3ConfigCommand Define
highlight link i3IpcSocket Define
highlight link i3SetKeyword Define
highlight link i3ModeKeyword Define
highlight link i3FontStatement Define
highlight link i3SeparatorSymbol Define
highlight link i3StatusCommandKeyword Define
highlight link i3BordersConfigCommand Define
highlight link i3Todo Todo
highlight link i3Comment Comment
highlight link i3Error Error
endif

View File

@@ -11,7 +11,7 @@ endif
syntax case match syntax case match
" keywords " keywords
syntax keyword jasmineSuite describe it beforeEach afterEach syntax keyword jasmineSuite describe it beforeEach afterEach beforeAll afterAll
syntax keyword jasmine jasmine syntax keyword jasmine jasmine
" special " special
@@ -35,6 +35,9 @@ syntax match jasmineClock /\.mockDate/
" disabled " disabled
syntax keyword jasmineDisabled xdescribe xit syntax keyword jasmineDisabled xdescribe xit
" focused
syntax keyword jasmineFocused fdescribe fit
" expectation " expectation
syntax keyword jasmineExpectation expect syntax keyword jasmineExpectation expect
@@ -59,6 +62,7 @@ syntax cluster JavaScriptAll add=
\ jasmine, \ jasmine,
\ jasmineClock, \ jasmineClock,
\ jasmineDisabled, \ jasmineDisabled,
\ jasmineFocused,
\ jasmineExpectation, \ jasmineExpectation,
\ jasmineMatcher, \ jasmineMatcher,
\ jasmineNot, \ jasmineNot,
@@ -72,6 +76,7 @@ let b:current_syntax = "jasmine"
hi def link jasmine Special hi def link jasmine Special
hi def link jasmineClock Special hi def link jasmineClock Special
hi def link jasmineDisabled Error hi def link jasmineDisabled Error
hi def link jasmineFocused Special
hi def link jasmineExpectation Statement hi def link jasmineExpectation Statement
hi def link jasmineMatcher Statement hi def link jasmineMatcher Statement
hi def link jasmineNot Special hi def link jasmineNot Special

View File

@@ -14,60 +14,62 @@ if !exists("main_syntax")
let main_syntax = 'javascript' let main_syntax = 'javascript'
endif endif
if !exists('g:javascript_conceal') " Dollar sign is permitted anywhere in an identifier
let g:javascript_conceal = 0 if v:version > 704 || v:version == 704 && has('patch1142')
syntax iskeyword @,48-57,_,192-255,$
else
setlocal iskeyword+=$
endif endif
" Dollar sign is permittd anywhere in an identifier
setlocal iskeyword+=$
syntax sync fromstart syntax sync fromstart
" TODO: Figure out what type of casing I need " TODO: Figure out what type of casing I need
" syntax case ignore " syntax case ignore
syntax case match syntax case match
syntax match jsNoise /[:,\;\.]\{1}/ syntax match jsNoise /[:,\;]\{1}/
syntax match jsNoise /[\.]\{1}/ skipwhite skipempty nextgroup=jsObjectProp
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/ syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
syntax match jsParensError /[)}\]]/ syntax match jsParensError /[)}\]]/
" Program Keywords " Program Keywords
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
syntax keyword jsOperator delete instanceof typeof void new in of syntax match jsVariableDef contained /\k\+/ skipwhite skipempty nextgroup=jsFlowDefinition
syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/ syntax keyword jsOperator delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/ skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsBooleanTrue true syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false syntax keyword jsBooleanFalse false
" Modules " Modules
syntax keyword jsModuleKeywords contained import syntax keyword jsImport import skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup,jsFlowImportType
syntax keyword jsModuleKeywords contained export skipwhite skipempty nextgroup=jsExportBlock,jsModuleDefault syntax keyword jsExport export skipwhite skipempty nextgroup=@jsAll,jsModuleGroup,jsExportDefault,jsModuleAsterisk,jsModuleKeyword
syntax keyword jsModuleOperators contained from syntax match jsModuleKeyword contained /\k\+/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax keyword jsModuleOperators contained as syntax keyword jsExportDefault contained default skipwhite skipempty nextgroup=@jsExpression
syntax region jsModuleGroup contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment syntax keyword jsExportDefaultGroup contained default skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax match jsModuleAsterisk contained /*/ syntax match jsModuleAsterisk contained /\*/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAs,jsFrom
syntax keyword jsModuleDefault contained default skipwhite kipempty nextgroup=@jsExpression syntax keyword jsModuleAs contained as skipwhite skipempty nextgroup=jsModuleKeyword,jsExportDefaultGroup
syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk syntax keyword jsFrom contained from skipwhite skipempty nextgroup=jsString
syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
" Strings, Templates, Numbers " Strings, Templates, Numbers
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateVar,jsSpecial extend syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial extend
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
syntax match jsNumber /\<-\=\d\+\(L\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/ syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
syntax keyword jsNumber Infinity syntax keyword jsNumber Infinity
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ syntax match jsFloat /\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
" Regular Expressions " Regular Expressions
syntax match jsSpecial contained "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" syntax match jsSpecial contained "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)"
syntax region jsTemplateVar contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression syntax region jsTemplateExpression contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression keepend
syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+
syntax match jsRegexpBoundary contained "\v%(\<@![\^$]|\\[bB])" syntax match jsRegexpBoundary contained "\v%(\<@![\^$]|\\[bB])"
syntax match jsRegexpBackRef contained "\v\\[1-9][0-9]*" syntax match jsRegexpBackRef contained "\v\\[1-9][0-9]*"
syntax match jsRegexpQuantifier contained "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" syntax match jsRegexpQuantifier contained "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??"
syntax match jsRegexpOr contained "\v\<@!\|" syntax match jsRegexpOr contained "\v\<@!\|"
syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]" syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]"
syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
if v:version > 703 || v:version == 603 && has("patch1088") if v:version > 703 || v:version == 603 && has("patch1088")
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@50<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@50<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@50<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@50<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
else else
@@ -75,46 +77,54 @@ else
endif endif
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue,jsFlowParenRegion " Objects
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
syntax match jsObjectColon contained /:/ skipwhite skipempty
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
syntax match jsObjectSeparator contained /,/ syntax match jsObjectSeparator contained /,/
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend syntax region jsObjectValue contained matchgroup=jsNoise start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
syntax match jsObjectMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName syntax match jsObjectMethodType contained /\%(get\|set\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '') exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '') exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite skipempty nextgroup=@jsExpression'
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '') 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 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 jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
exe 'syntax keyword jsThis this contained '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '') exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '') exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
" Statement Keywords " Statement Keywords
syntax keyword jsStatement contained break continue with yield debugger syntax match jsBlockLabel /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\s*::\@!/ contains=jsNoise skipwhite skipempty nextgroup=jsBlock
syntax keyword jsConditional if else skipwhite skipempty nextgroup=jsParenIfElse,jsBlock syntax match jsBlockLabelKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*\%(;\|\n\)\)\@=/
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch syntax keyword jsStatement contained with yield debugger
syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat syntax keyword jsStatement contained break continue skipwhite skipempty nextgroup=jsBlockLabelKey
syntax keyword jsRepeat do skipwhite skipempty nextgroup=jsBlock syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
syntax keyword jsLabel contained case default syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsBlock syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat,jsForAwait
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch syntax keyword jsDo do skipwhite skipempty nextgroup=jsRepeatBlock
syntax region jsSwitchCase contained matchgroup=jsLabel start=/\<\%(case\|default\)\>/ end=/:\@=/ contains=@jsExpression,jsLabel skipwhite skipempty nextgroup=jsSwitchColon keepend
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock
syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsFinallyBlock
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
syntax keyword jsException throw syntax keyword jsException throw
syntax keyword jsAsyncKeyword async await syntax keyword jsAsyncKeyword async await
syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock
" Keywords " Keywords
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError syntax keyword jsGlobalNodeObjects module exports global process __dirname __filename
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval syntax match jsGlobalNodeObjects /\<require\>/ containedin=jsFuncCall
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
" DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved? " DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved?
syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public
" DISCUSS: Should we really be matching stuff like this? " DISCUSS: Should we really be matching stuff like this?
" DOM2 Objects " DOM2 Objects
@@ -130,32 +140,37 @@ syntax keyword jsDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECT
" HTML events and internal variables " HTML events and internal variables
syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
"" Code blocks " Code blocks
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression extend fold syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc extend fold
syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock extend fold
syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsRepeatBlock extend fold
syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsRestExpression,jsFlow skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend fold syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise,jsFlowClassProperty extend fold syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsAsyncKeyword,jsNoise extend fold
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment extend fold
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsComment extend fold
syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword extend fold
syntax region jsBlock matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsSpreadExpression extend fold
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment skipwhite skipempty nextgroup=jsFrom
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/ syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
syntax match jsFuncArgCommas contained ',' syntax match jsFuncArgCommas contained ','
syntax keyword jsArguments contained arguments syntax keyword jsArguments contained arguments
syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat
" Matches a single keyword argument with no parens " Matches a single keyword argument with no parens
syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
@@ -163,14 +178,16 @@ syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArg
syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '') exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock contains=jsFuncBraces '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '') exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
exe 'syntax match jsArrowFunction /()\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '').(' contains=jsArrowFuncArgs')
exe 'syntax match jsArrowFunction /_\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
syntax keyword jsClassKeywords contained extends class " Classes
syntax keyword jsClassKeyword contained class
syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression
syntax match jsClassNoise contained /\./ syntax match jsClassNoise contained /\./
syntax match jsClassMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty syntax match jsClassMethodType contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
@@ -193,6 +210,21 @@ syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spe
syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend
syntax region jsEnvComment start=/\%^#!/ end=/$/ display syntax region jsEnvComment start=/\%^#!/ end=/$/ display
" Specialized Comments - These are special comment regexes that are used in
" odd places that maintain the proper nextgroup functionality. It sucks we
" can't make jsComment a skippable type of group for nextgroup
syntax region jsCommentFunction contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend keepend
syntax region jsCommentFunction contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn fold extend keepend
syntax region jsCommentClass contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup extend keepend
syntax region jsCommentClass contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup fold extend keepend
syntax region jsCommentMisc contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsBlock extend keepend
syntax region jsCommentMisc contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsBlock fold extend keepend
" Decorators
syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction
syntax match jsDecoratorFunction contained /[a-zA-Z_][a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator
syntax match jsObjectProp contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/
if exists("javascript_plugin_jsdoc") if exists("javascript_plugin_jsdoc")
runtime extras/jsdoc.vim runtime extras/jsdoc.vim
" NGDoc requires JSDoc " NGDoc requires JSDoc
@@ -205,8 +237,8 @@ if exists("javascript_plugin_flow")
runtime extras/flow.vim runtime extras/flow.vim
endif endif
syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo
syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword,jsNoise,,jsBlockLabel
" 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
@@ -220,6 +252,10 @@ if version >= 508 || !exists("did_javascript_syn_inits")
endif endif
HiLink jsComment Comment HiLink jsComment Comment
HiLink jsEnvComment PreProc HiLink jsEnvComment PreProc
HiLink jsParensIfElse jsParens
HiLink jsParensRepeat jsParens
HiLink jsParensSwitch jsParens
HiLink jsParensCatch jsParens
HiLink jsCommentTodo Todo HiLink jsCommentTodo Todo
HiLink jsString String HiLink jsString String
HiLink jsObjectKeyString String HiLink jsObjectKeyString String
@@ -243,12 +279,14 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsLabel Label HiLink jsLabel Label
HiLink jsReturn Statement HiLink jsReturn Statement
HiLink jsRepeat Repeat HiLink jsRepeat Repeat
HiLink jsDo Repeat
HiLink jsStatement Statement HiLink jsStatement Statement
HiLink jsException Exception HiLink jsException Exception
HiLink jsTry Exception HiLink jsTry Exception
HiLink jsFinally Exception HiLink jsFinally Exception
HiLink jsCatch Exception HiLink jsCatch Exception
HiLink jsAsyncKeyword Keyword HiLink jsAsyncKeyword Keyword
HiLink jsForAwait Keyword
HiLink jsArrowFunction Type HiLink jsArrowFunction Type
HiLink jsFunction Type HiLink jsFunction Type
HiLink jsGenerator jsFunction HiLink jsGenerator jsFunction
@@ -262,9 +300,10 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsOperator Operator HiLink jsOperator Operator
HiLink jsOf Operator HiLink jsOf Operator
HiLink jsStorageClass StorageClass HiLink jsStorageClass StorageClass
HiLink jsClassKeywords Structure HiLink jsClassKeyword Keyword
HiLink jsExtendsKeyword Keyword
HiLink jsThis Special HiLink jsThis Special
HiLink jsSuper Special HiLink jsSuper Constant
HiLink jsNan Number HiLink jsNan Number
HiLink jsNull Type HiLink jsNull Type
HiLink jsUndefined Type HiLink jsUndefined Type
@@ -272,6 +311,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFloat Float HiLink jsFloat Float
HiLink jsBooleanTrue Boolean HiLink jsBooleanTrue Boolean
HiLink jsBooleanFalse Boolean HiLink jsBooleanFalse Boolean
HiLink jsObjectColon jsNoise
HiLink jsNoise Noise HiLink jsNoise Noise
HiLink jsBrackets Noise HiLink jsBrackets Noise
HiLink jsParens Noise HiLink jsParens Noise
@@ -280,21 +320,32 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFuncParens Noise HiLink jsFuncParens Noise
HiLink jsClassBraces Noise HiLink jsClassBraces Noise
HiLink jsClassNoise Noise HiLink jsClassNoise Noise
HiLink jsIfElseBraces Noise
HiLink jsTryCatchBraces Noise
HiLink jsModuleBraces Noise
HiLink jsObjectBraces Noise HiLink jsObjectBraces Noise
HiLink jsObjectSeparator Noise HiLink jsObjectSeparator Noise
HiLink jsFinallyBraces Noise
HiLink jsRepeatBraces Noise
HiLink jsSwitchBraces Noise
HiLink jsSpecial Special HiLink jsSpecial Special
HiLink jsTemplateVar Special HiLink jsTemplateBraces Noise
HiLink jsTemplateBraces jsBraces HiLink jsGlobalObjects Constant
HiLink jsGlobalObjects Special HiLink jsGlobalNodeObjects Constant
HiLink jsExceptions Special HiLink jsExceptions Constant
HiLink jsBuiltins Special HiLink jsBuiltins Constant
HiLink jsModuleKeywords Include HiLink jsImport Include
HiLink jsModuleOperators Include HiLink jsExport Include
HiLink jsModuleDefault Include HiLink jsExportDefault StorageClass
HiLink jsDecorator Special HiLink jsExportDefaultGroup jsExportDefault
HiLink jsDecoratorFunction Special HiLink jsModuleAs Include
HiLink jsFuncArgOperator jsFuncArgs HiLink jsModuleComma jsNoise
HiLink jsModuleAsterisk Noise HiLink jsModuleAsterisk Noise
HiLink jsFrom Include
HiLink jsDecorator Special
HiLink jsDecoratorFunction Function
HiLink jsParensDecorator jsParens
HiLink jsFuncArgOperator jsFuncArgs
HiLink jsClassProperty jsObjectKey HiLink jsClassProperty jsObjectKey
HiLink jsSpreadOperator Operator HiLink jsSpreadOperator Operator
HiLink jsRestOperator Operator HiLink jsRestOperator Operator
@@ -302,12 +353,19 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsSwitchColon Noise HiLink jsSwitchColon Noise
HiLink jsClassMethodType Type HiLink jsClassMethodType Type
HiLink jsObjectMethodType Type HiLink jsObjectMethodType Type
HiLink jsClassDefinition jsFuncName
HiLink jsBlockLabel Identifier
HiLink jsBlockLabelKey jsBlockLabel
HiLink jsDestructuringBraces Noise HiLink jsDestructuringBraces Noise
HiLink jsDestructuringProperty jsFuncArgs HiLink jsDestructuringProperty jsFuncArgs
HiLink jsDestructuringAssignment jsObjectKey HiLink jsDestructuringAssignment jsObjectKey
HiLink jsDestructuringNoise Noise HiLink jsDestructuringNoise Noise
HiLink jsCommentFunction jsComment
HiLink jsCommentClass jsComment
HiLink jsCommentMisc jsComment
HiLink jsDomErrNo Constant HiLink jsDomErrNo Constant
HiLink jsDomNodeConsts Constant HiLink jsDomNodeConsts Constant
HiLink jsDomElemAttrs Label HiLink jsDomElemAttrs Label

View File

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
" Vim syntax file " Vim syntax file
" Language: Kotlin " Language: Kotlin
" Maintainer: Alexander Udalov " Maintainer: Alexander Udalov
" Latest Revision: 4 July 2016 " Latest Revision: 29 December 2016
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -21,7 +21,7 @@ syn keyword ktException try catch finally throw
syn keyword ktInclude import package syn keyword ktInclude import package
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit 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 ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic header impl
syn keyword ktStructure class object interface typealias fun val var constructor init syn keyword ktStructure class object interface typealias fun val var constructor init
syn keyword ktReservedKeyword typeof syn keyword ktReservedKeyword typeof
@@ -29,7 +29,7 @@ syn keyword ktReservedKeyword typeof
syn keyword ktBoolean true false syn keyword ktBoolean true false
syn keyword ktConstant null syn keyword ktConstant null
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix coroutine suspend syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix suspend
syn keyword ktTodo TODO FIXME XXX contained syn keyword ktTodo TODO FIXME XXX contained
syn match ktShebang "\v^#!.*$" syn match ktShebang "\v^#!.*$"

675
syntax/layout/nginx.vim Normal file
View File

@@ -0,0 +1,675 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Vim syntax file
" Language: nginx.conf
if exists("b:current_syntax")
finish
end
if has("patch-7.4-1142")
if has("win32")
syn iskeyword @,48-57,_,128-167,224-235,.,/,:
else
syn iskeyword @,48-57,_,192-255,.,/,:
endif
else
setlocal iskeyword+=.
setlocal iskeyword+=/
setlocal iskeyword+=:
endif
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
syn match ngxComment ' *#.*$'
syn match ngxRewriteURI /\S\+/ contained contains=ngxVariableString nextgroup=ngxURI skipwhite
syn match ngxURI /\S\+/ contained contains=ngxVariableString skipwhite
syn match ngxLocationPath /[^ {]\+/ contained
syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
syn keyword ngxBoolean on
syn keyword ngxBoolean off
syn keyword ngxDirectiveBlock http
syn keyword ngxDirectiveBlock mail
syn keyword ngxDirectiveBlock events
syn keyword ngxDirectiveBlock server
syn keyword ngxDirectiveBlock stream
syn keyword ngxDirectiveBlock types
syn match ngxLocationOperator /\(=\|\~\*\|\^\~\|\~\)/ contained nextgroup=ngxLocationPath,ngxString skipwhite
syn match ngxLocationNamedLoc /@\w\+/
syn keyword ngxDirectiveBlock location nextgroup=ngxLocationNamedLoc,ngxLocationOperator,ngxLocationPath,ngxString skipwhite
syn keyword ngxDirectiveBlock upstream
syn keyword ngxDirectiveBlock charset_map
syn keyword ngxDirectiveBlock limit_except
syn keyword ngxDirectiveBlock if
syn keyword ngxDirectiveBlock geo
syn keyword ngxDirectiveBlock map
syn keyword ngxDirectiveBlock split_clients
syn keyword ngxDirectiveImportant include
syn keyword ngxDirectiveImportant root
syn keyword ngxDirectiveImportant server
syn keyword ngxDirectiveImportant server_name
syn keyword ngxDirectiveImportant listen
syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass
syn keyword ngxDirectiveImportant fastcgi_pass
syn keyword ngxDirectiveImportant scgi_pass
syn keyword ngxDirectiveImportant uwsgi_pass
syn keyword ngxDirectiveImportant try_files
syn keyword ngxDirectiveControl break
syn keyword ngxDirectiveControl return
syn keyword ngxDirectiveControl rewrite nextgroup=ngxRewriteURI skipwhite
syn keyword ngxDirectiveControl set
syn keyword ngxRewriteFlag last
syn keyword ngxRewriteFlag break
syn keyword ngxRewriteFlag redirect
syn keyword ngxRewriteFlag permanent
syn keyword ngxDirectiveError error_page
syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated limit_zone
syn keyword ngxDirectiveDeprecated mysql_test
syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any
syn keyword ngxDirectiveDeprecated so_keepalive
syn keyword ngxDirectiveDeprecated spdy_chunk_size
syn keyword ngxDirectiveDeprecated spdy_headers_comp
syn keyword ngxDirectiveDeprecated spdy_keepalive_timeout
syn keyword ngxDirectiveDeprecated spdy_max_concurrent_streams
syn keyword ngxDirectiveDeprecated spdy_pool_size
syn keyword ngxDirectiveDeprecated spdy_recv_buffer_size
syn keyword ngxDirectiveDeprecated spdy_recv_timeout
syn keyword ngxDirectiveDeprecated spdy_streams_index_size
syn keyword ngxDirective absolute_redirect
syn keyword ngxDirective accept_mutex
syn keyword ngxDirective accept_mutex_delay
syn keyword ngxDirective acceptex_read
syn keyword ngxDirective access_log
syn keyword ngxDirective add_after_body
syn keyword ngxDirective add_before_body
syn keyword ngxDirective add_header
syn keyword ngxDirective addition_types
syn keyword ngxDirective aio
syn keyword ngxDirective aio_write
syn keyword ngxDirective alias
syn keyword ngxDirective allow
syn keyword ngxDirective ancient_browser
syn keyword ngxDirective ancient_browser_value
syn keyword ngxDirective auth_basic
syn keyword ngxDirective auth_basic_user_file
syn keyword ngxDirective auth_http
syn keyword ngxDirective auth_http_header
syn keyword ngxDirective auth_http_pass_client_cert
syn keyword ngxDirective auth_http_timeout
syn keyword ngxDirective auth_jwt
syn keyword ngxDirective auth_jwt_key_file
syn keyword ngxDirective auth_request
syn keyword ngxDirective auth_request_set
syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_format
syn keyword ngxDirective autoindex_localtime
syn keyword ngxDirective charset
syn keyword ngxDirective charset_map
syn keyword ngxDirective charset_types
syn keyword ngxDirective chunked_transfer_encoding
syn keyword ngxDirective client_body_buffer_size
syn keyword ngxDirective client_body_in_file_only
syn keyword ngxDirective client_body_in_single_buffer
syn keyword ngxDirective client_body_temp_path
syn keyword ngxDirective client_body_timeout
syn keyword ngxDirective client_header_buffer_size
syn keyword ngxDirective client_header_timeout
syn keyword ngxDirective client_max_body_size
syn keyword ngxDirective connection_pool_size
syn keyword ngxDirective create_full_put_path
syn keyword ngxDirective daemon
syn keyword ngxDirective dav_access
syn keyword ngxDirective dav_methods
syn keyword ngxDirective debug_connection
syn keyword ngxDirective debug_points
syn keyword ngxDirective default_type
syn keyword ngxDirective degradation
syn keyword ngxDirective degrade
syn keyword ngxDirective deny
syn keyword ngxDirective devpoll_changes
syn keyword ngxDirective devpoll_events
syn keyword ngxDirective directio
syn keyword ngxDirective directio_alignment
syn keyword ngxDirective disable_symlinks
syn keyword ngxDirective empty_gif
syn keyword ngxDirective env
syn keyword ngxDirective epoll_events
syn keyword ngxDirective error_log
syn keyword ngxDirective etag
syn keyword ngxDirective eventport_events
syn keyword ngxDirective expires
syn keyword ngxDirective f4f
syn keyword ngxDirective f4f_buffer_size
syn keyword ngxDirective fastcgi_bind
syn keyword ngxDirective fastcgi_buffer_size
syn keyword ngxDirective fastcgi_buffering
syn keyword ngxDirective fastcgi_buffers
syn keyword ngxDirective fastcgi_busy_buffers_size
syn keyword ngxDirective fastcgi_cache
syn keyword ngxDirective fastcgi_cache_bypass
syn keyword ngxDirective fastcgi_cache_key
syn keyword ngxDirective fastcgi_cache_lock
syn keyword ngxDirective fastcgi_cache_lock_age
syn keyword ngxDirective fastcgi_cache_lock_timeout
syn keyword ngxDirective fastcgi_cache_max_range_offset
syn keyword ngxDirective fastcgi_cache_methods
syn keyword ngxDirective fastcgi_cache_min_uses
syn keyword ngxDirective fastcgi_cache_path
syn keyword ngxDirective fastcgi_cache_purge
syn keyword ngxDirective fastcgi_cache_revalidate
syn keyword ngxDirective fastcgi_cache_use_stale
syn keyword ngxDirective fastcgi_cache_valid
syn keyword ngxDirective fastcgi_catch_stderr
syn keyword ngxDirective fastcgi_connect_timeout
syn keyword ngxDirective fastcgi_force_ranges
syn keyword ngxDirective fastcgi_hide_header
syn keyword ngxDirective fastcgi_ignore_client_abort
syn keyword ngxDirective fastcgi_ignore_headers
syn keyword ngxDirective fastcgi_index
syn keyword ngxDirective fastcgi_intercept_errors
syn keyword ngxDirective fastcgi_keep_conn
syn keyword ngxDirective fastcgi_limit_rate
syn keyword ngxDirective fastcgi_max_temp_file_size
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_pass_header
syn keyword ngxDirective fastcgi_pass_request_body
syn keyword ngxDirective fastcgi_pass_request_headers
syn keyword ngxDirective fastcgi_read_timeout
syn keyword ngxDirective fastcgi_request_buffering
syn keyword ngxDirective fastcgi_send_lowat
syn keyword ngxDirective fastcgi_send_timeout
syn keyword ngxDirective fastcgi_split_path_info
syn keyword ngxDirective fastcgi_store
syn keyword ngxDirective fastcgi_store_access
syn keyword ngxDirective fastcgi_temp_file_write_size
syn keyword ngxDirective fastcgi_temp_path
syn keyword ngxDirective flv
syn keyword ngxDirective geoip_city
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 gunzip
syn keyword ngxDirective gunzip_buffers
syn keyword ngxDirective gzip
syn keyword ngxDirective gzip_buffers
syn keyword ngxDirective gzip_comp_level
syn keyword ngxDirective gzip_disable
syn keyword ngxDirective gzip_hash
syn keyword ngxDirective gzip_http_version
syn keyword ngxDirective gzip_min_length
syn keyword ngxDirective gzip_no_buffer
syn keyword ngxDirective gzip_proxied
syn keyword ngxDirective gzip_static
syn keyword ngxDirective gzip_types
syn keyword ngxDirective gzip_vary
syn keyword ngxDirective gzip_window
syn keyword ngxDirective hash
syn keyword ngxDirective health_check
syn keyword ngxDirective health_check_timeout
syn keyword ngxDirective hls
syn keyword ngxDirective hls_buffers
syn keyword ngxDirective hls_forward_args
syn keyword ngxDirective hls_fragment
syn keyword ngxDirective hls_mp4_buffer_size
syn keyword ngxDirective hls_mp4_max_buffer_size
syn keyword ngxDirective http2 " Not a real directive
syn keyword ngxDirective http2_chunk_size
syn keyword ngxDirective http2_body_preread_size
syn keyword ngxDirective http2_idle_timeout
syn keyword ngxDirective http2_max_concurrent_streams
syn keyword ngxDirective http2_max_field_size
syn keyword ngxDirective http2_max_header_size
syn keyword ngxDirective http2_max_requests
syn keyword ngxDirective http2_recv_buffer_size
syn keyword ngxDirective http2_recv_timeout
syn keyword ngxDirective if_modified_since
syn keyword ngxDirective ignore_invalid_headers
syn keyword ngxDirective image_filter
syn keyword ngxDirective image_filter_buffer
syn keyword ngxDirective image_filter_interlace
syn keyword ngxDirective image_filter_jpeg_quality
syn keyword ngxDirective image_filter_sharpen
syn keyword ngxDirective image_filter_transparency
syn keyword ngxDirective image_filter_webp_quality
syn keyword ngxDirective imap_auth
syn keyword ngxDirective imap_capabilities
syn keyword ngxDirective imap_client_buffer
syn keyword ngxDirective index
syn keyword ngxDirective iocp_threads
syn keyword ngxDirective ip_hash
syn keyword ngxDirective js_access
syn keyword ngxDirective js_content
syn keyword ngxDirective js_filter
syn keyword ngxDirective js_include
syn keyword ngxDirective js_preread
syn keyword ngxDirective js_set
syn keyword ngxDirective keepalive
syn keyword ngxDirective keepalive_disable
syn keyword ngxDirective keepalive_requests
syn keyword ngxDirective keepalive_timeout
syn keyword ngxDirective kqueue_changes
syn keyword ngxDirective kqueue_events
syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective least_conn
syn keyword ngxDirective least_time
syn keyword ngxDirective limit_conn
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_after
syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_status
syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective lingering_close
syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout
syn keyword ngxDirective load_module
syn keyword ngxDirective lock_file
syn keyword ngxDirective log_format
syn keyword ngxDirective log_not_found
syn keyword ngxDirective log_subrequest
syn keyword ngxDirective map_hash_bucket_size
syn keyword ngxDirective map_hash_max_size
syn keyword ngxDirective match
syn keyword ngxDirective master_process
syn keyword ngxDirective max_ranges
syn keyword ngxDirective memcached_bind
syn keyword ngxDirective memcached_buffer_size
syn keyword ngxDirective memcached_connect_timeout
syn keyword ngxDirective memcached_force_ranges
syn keyword ngxDirective memcached_gzip_flag
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_send_timeout
syn keyword ngxDirective merge_slashes
syn keyword ngxDirective min_delete_depth
syn keyword ngxDirective modern_browser
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 mp4_limit_rate
syn keyword ngxDirective mp4_limit_rate_after
syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept
syn keyword ngxDirective ntlm
syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events
syn keyword ngxDirective open_file_cache_min_uses
syn keyword ngxDirective open_file_cache_valid
syn keyword ngxDirective open_log_file_cache
syn keyword ngxDirective output_buffers
syn keyword ngxDirective override_charset
syn keyword ngxDirective pcre_jit
syn keyword ngxDirective perl
syn keyword ngxDirective perl_modules
syn keyword ngxDirective perl_require
syn keyword ngxDirective perl_set
syn keyword ngxDirective pid
syn keyword ngxDirective pop3_auth
syn keyword ngxDirective pop3_capabilities
syn keyword ngxDirective port_in_redirect
syn keyword ngxDirective post_acceptex
syn keyword ngxDirective postpone_gzipping
syn keyword ngxDirective postpone_output
syn keyword ngxDirective preread_buffer_size
syn keyword ngxDirective preread_timeout
syn keyword ngxDirective protocol nextgroup=ngxMailProtocol skipwhite
syn keyword ngxMailProtocol imap pop3 smtp
syn keyword ngxDirective proxy
syn keyword ngxDirective proxy_bind
syn keyword ngxDirective proxy_buffer
syn keyword ngxDirective proxy_buffer_size
syn keyword ngxDirective proxy_buffering
syn keyword ngxDirective proxy_buffers
syn keyword ngxDirective proxy_busy_buffers_size
syn keyword ngxDirective proxy_cache
syn keyword ngxDirective proxy_cache_bypass
syn keyword ngxDirective proxy_cache_convert_head
syn keyword ngxDirective proxy_cache_key
syn keyword ngxDirective proxy_cache_lock
syn keyword ngxDirective proxy_cache_lock_age
syn keyword ngxDirective proxy_cache_lock_timeout
syn keyword ngxDirective proxy_cache_max_range_offset
syn keyword ngxDirective proxy_cache_methods
syn keyword ngxDirective proxy_cache_min_uses
syn keyword ngxDirective proxy_cache_path
syn keyword ngxDirective proxy_cache_purge
syn keyword ngxDirective proxy_cache_revalidate
syn keyword ngxDirective proxy_cache_use_stale
syn keyword ngxDirective proxy_cache_valid
syn keyword ngxDirective proxy_connect_timeout
syn keyword ngxDirective proxy_cookie_domain
syn keyword ngxDirective proxy_cookie_path
syn keyword ngxDirective proxy_download_rate
syn keyword ngxDirective proxy_force_ranges
syn keyword ngxDirective proxy_headers_hash_bucket_size
syn keyword ngxDirective proxy_headers_hash_max_size
syn keyword ngxDirective proxy_hide_header
syn keyword ngxDirective proxy_http_version
syn keyword ngxDirective proxy_ignore_client_abort
syn keyword ngxDirective proxy_ignore_headers
syn keyword ngxDirective proxy_intercept_errors
syn keyword ngxDirective proxy_limit_rate
syn keyword ngxDirective proxy_max_temp_file_size
syn keyword ngxDirective proxy_method
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_header
syn keyword ngxDirective proxy_pass_request_body
syn keyword ngxDirective proxy_pass_request_headers
syn keyword ngxDirective proxy_protocol
syn keyword ngxDirective proxy_protocol_timeout
syn keyword ngxDirective proxy_read_timeout
syn keyword ngxDirective proxy_redirect
syn keyword ngxDirective proxy_request_buffering
syn keyword ngxDirective proxy_responses
syn keyword ngxDirective proxy_send_lowat
syn keyword ngxDirective proxy_send_timeout
syn keyword ngxDirective proxy_set_body
syn keyword ngxDirective proxy_set_header
syn keyword ngxDirective proxy_ssl_certificate
syn keyword ngxDirective proxy_ssl_certificate_key
syn keyword ngxDirective proxy_ssl_ciphers
syn keyword ngxDirective proxy_ssl_crl
syn keyword ngxDirective proxy_ssl_name
syn keyword ngxDirective proxy_ssl_password_file
syn keyword ngxDirective proxy_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
syn keyword ngxDirective proxy_ssl_server_name
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_access
syn keyword ngxDirective proxy_temp_file_write_size
syn keyword ngxDirective proxy_temp_path
syn keyword ngxDirective proxy_timeout
syn keyword ngxDirective proxy_upload_rate
syn keyword ngxDirective queue
syn keyword ngxDirective random_index
syn keyword ngxDirective read_ahead
syn keyword ngxDirective real_ip_header
syn keyword ngxDirective real_ip_recursive
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 reset_timedout_connection
syn keyword ngxDirective resolver
syn keyword ngxDirective resolver_timeout
syn keyword ngxDirective rewrite_log
syn keyword ngxDirective rtsig_overflow_events
syn keyword ngxDirective rtsig_overflow_test
syn keyword ngxDirective rtsig_overflow_threshold
syn keyword ngxDirective rtsig_signo
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_age
syn keyword ngxDirective scgi_cache_lock_timeout
syn keyword ngxDirective scgi_cache_max_range_offset
syn keyword ngxDirective scgi_cache_methods
syn keyword ngxDirective scgi_cache_min_uses
syn keyword ngxDirective scgi_cache_path
syn keyword ngxDirective scgi_cache_purge
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_limit_rate
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_request_buffering
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 send_lowat
syn keyword ngxDirective send_timeout
syn keyword ngxDirective sendfile
syn keyword ngxDirective sendfile_max_chunk
syn keyword ngxDirective server_name_in_redirect
syn keyword ngxDirective server_names_hash_bucket_size
syn keyword ngxDirective server_names_hash_max_size
syn keyword ngxDirective server_tokens
syn keyword ngxDirective session_log
syn keyword ngxDirective session_log_format
syn keyword ngxDirective session_log_zone
syn keyword ngxDirective set_real_ip_from
syn keyword ngxDirective slice
syn keyword ngxDirective smtp_auth
syn keyword ngxDirective smtp_capabilities
syn keyword ngxDirective smtp_client_buffer
syn keyword ngxDirective smtp_greeting_delay
syn keyword ngxDirective source_charset
syn keyword ngxDirective ssi
syn keyword ngxDirective ssi_ignore_recycled_buffers
syn keyword ngxDirective ssi_last_modified
syn keyword ngxDirective ssi_min_file_chunk
syn keyword ngxDirective ssi_silent_errors
syn keyword ngxDirective ssi_types
syn keyword ngxDirective ssi_value_length
syn keyword ngxDirective ssl
syn keyword ngxDirective ssl_buffer_size
syn keyword ngxDirective ssl_certificate
syn keyword ngxDirective ssl_certificate_key
syn keyword ngxDirective ssl_ciphers
syn keyword ngxDirective ssl_client_certificate
syn keyword ngxDirective ssl_crl
syn keyword ngxDirective ssl_dhparam
syn keyword ngxDirective ssl_ecdh_curve
syn keyword ngxDirective ssl_engine
syn keyword ngxDirective ssl_handshake_timeout
syn keyword ngxDirective ssl_password_file
syn keyword ngxDirective ssl_prefer_server_ciphers
syn keyword ngxDirective ssl_preread
syn keyword ngxDirective ssl_protocols nextgroup=ngxSSLProtocol skipwhite
syn keyword ngxSSLProtocol SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2
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_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_depth
syn keyword ngxDirective starttls
syn keyword ngxDirective state
syn keyword ngxDirective status
syn keyword ngxDirective status_format
syn keyword ngxDirective status_zone
syn keyword ngxDirective sticky
syn keyword ngxDirective sticky_cookie_insert
syn keyword ngxDirective stub_status
syn keyword ngxDirective sub_filter
syn keyword ngxDirective sub_filter_last_modified
syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay
syn keyword ngxDirective tcp_nopush
syn keyword ngxDirective thread_pool
syn keyword ngxDirective thread_stack_size
syn keyword ngxDirective timeout
syn keyword ngxDirective timer_resolution
syn keyword ngxDirective types_hash_bucket_size
syn keyword ngxDirective types_hash_max_size
syn keyword ngxDirective underscores_in_headers
syn keyword ngxDirective uninitialized_variable_warn
syn keyword ngxDirective upstream_conf
syn keyword ngxDirective use
syn keyword ngxDirective user
syn keyword ngxDirective userid
syn keyword ngxDirective userid_domain
syn keyword ngxDirective userid_expires
syn keyword ngxDirective userid_mark
syn keyword ngxDirective userid_name
syn keyword ngxDirective userid_p3p
syn keyword ngxDirective userid_path
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_age
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_purge
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_limit_rate
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
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_request_buffering
syn keyword ngxDirective uwsgi_send_timeout
syn keyword ngxDirective uwsgi_ssl_certificate
syn keyword ngxDirective uwsgi_ssl_certificate_key
syn keyword ngxDirective uwsgi_ssl_ciphers
syn keyword ngxDirective uwsgi_ssl_crl
syn keyword ngxDirective uwsgi_ssl_name
syn keyword ngxDirective uwsgi_ssl_password_file
syn keyword ngxDirective uwsgi_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
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 variables_hash_bucket_size
syn keyword ngxDirective variables_hash_max_size
syn keyword ngxDirective worker_aio_requests
syn keyword ngxDirective worker_connections
syn keyword ngxDirective worker_cpu_affinity
syn keyword ngxDirective worker_priority
syn keyword ngxDirective worker_processes
syn keyword ngxDirective worker_rlimit_core
syn keyword ngxDirective worker_rlimit_nofile
syn keyword ngxDirective worker_rlimit_sigpending
syn keyword ngxDirective worker_threads
syn keyword ngxDirective working_directory
syn keyword ngxDirective xclient
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_types
syn keyword ngxDirective zone
" 3rd party module list:
" https://www.nginx.com/resources/wiki/modules/
" @3PARTY
" highlight
hi link ngxComment Comment
hi link ngxVariable Identifier
hi link ngxVariableString PreProc
hi link ngxString String
hi link ngxLocationPath String
hi link ngxLocationNamedLoc Identifier
hi link ngxBoolean Boolean
hi link ngxRewriteFlag Boolean
hi link ngxDirectiveBlock Statement
hi link ngxDirectiveImportant Type
hi link ngxDirectiveControl Keyword
hi link ngxDirectiveError Constant
hi link ngxDirectiveDeprecated Error
hi link ngxDirective Identifier
hi link ngxDirectiveThirdParty Special
let b:current_syntax = "nginx"
endif

View File

@@ -15,20 +15,33 @@ endif
syntax sync fromstart syntax sync fromstart
function! s:FoldableRegion(tag, name, expr)
let synexpr = 'syntax region ' . a:name . ' ' . a:expr
let pfx = 'g:lua_syntax_fold_'
if !exists('g:lua_syntax_nofold') || exists(pfx . a:tag) || exists(pfx . a:name)
let synexpr .= ' fold'
end
exec synexpr
endfunction
" Clusters " Clusters
syntax cluster luaBase contains=luaComment,luaCommentLong,luaConstant,luaNumber,luaString,luaStringLong,luaBuiltIn syntax cluster luaBase contains=luaComment,luaCommentLong,luaConstant,luaNumber,luaString,luaStringLong,luaBuiltIn
syntax cluster luaExpr contains=@luaBase,luaTable,luaParen,luaBracket,luaSpecialTable,luaSpecialValue,luaOperator,luaEllipsis,luaComma,luaFunc,luaFuncCall,luaError syntax cluster luaExpr contains=@luaBase,luaTable,luaParen,luaBracket,luaSpecialTable,luaSpecialValue,luaOperator,luaSymbolOperator,luaEllipsis,luaComma,luaFunc,luaFuncCall,luaError
syntax cluster luaStat contains=@luaExpr,luaIfThen,luaBlock,luaLoop,luaGoto,luaLabel,luaLocal,luaStatement,luaSemiCol syntax cluster luaStat
\ contains=@luaExpr,luaIfThen,luaBlock,luaLoop,luaGoto,luaLabel,luaLocal,luaStatement,luaSemiCol,luaErrHand
syntax match luaNoise /\%(\.\|,\|:\|\;\)/ syntax match luaNoise /\%(\.\|,\|:\|\;\)/
" Symbols " Symbols
syntax region luaTable transparent matchgroup=luaBraces start="{" end="}" contains=@luaExpr fold call s:FoldableRegion('table', 'luaTable',
\ 'transparent matchgroup=luaBraces start="{" end="}" contains=@luaExpr')
syntax region luaParen transparent matchgroup=luaParens start='(' end=')' contains=@luaExpr syntax region luaParen transparent matchgroup=luaParens start='(' end=')' contains=@luaExpr
syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]" contains=@luaExpr syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]" contains=@luaExpr
syntax match luaComma "," syntax match luaComma ","
syntax match luaSemiCol ";" syntax match luaSemiCol ";"
syntax match luaOperator "[#<>=~^&|*/%+-]\|\.\." if !exists('g:lua_syntax_nosymboloperator')
syntax match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\."
endi
syntax match luaEllipsis "\.\.\." syntax match luaEllipsis "\.\.\."
" Catch errors caused by unbalanced brackets and keywords " Catch errors caused by unbalanced brackets and keywords
@@ -43,14 +56,16 @@ syntax match luaComment "\%^#!.*"
" Comments " Comments
syntax keyword luaCommentTodo contained TODO FIXME XXX TBD syntax keyword luaCommentTodo contained TODO FIXME XXX TBD
syntax match luaComment "--.*$" contains=luaCommentTodo,luaDocTag,@Spell syntax match luaComment "--.*$" contains=luaCommentTodo,luaDocTag,@Spell
syntax region luaCommentLong matchgroup=luaCommentLongTag start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaCommentTodo,luaDocTag,@Spell fold call s:FoldableRegion('comment', 'luaCommentLong',
\ 'matchgroup=luaCommentLongTag start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaCommentTodo,luaDocTag,@Spell')
syntax match luaDocTag contained "\s@\k\+" syntax match luaDocTag contained "\s@\k\+"
" Function calls " Function calls
syntax match luaFuncCall /\k\+\%(\s*[{('"]\)\@=/ syntax match luaFuncCall /\k\+\%(\s*[{('"]\)\@=/
" Functions " Functions
syntax region luaFunc transparent matchgroup=luaFuncKeyword start="\<function\>" end="\<end\>" contains=@luaStat,luaFuncSig fold call s:FoldableRegion('function', 'luaFunc',
\ 'transparent matchgroup=luaFuncKeyword start="\<function\>" end="\<end\>" contains=@luaStat,luaFuncSig')
syntax region luaFuncSig contained transparent start="\(\<function\>\)\@<=" end=")" contains=luaFuncId,luaFuncArgs keepend syntax region luaFuncSig contained transparent start="\(\<function\>\)\@<=" end=")" contains=luaFuncId,luaFuncArgs keepend
syntax match luaFuncId contained "[^(]*(\@=" contains=luaFuncTable,luaFuncName syntax match luaFuncId contained "[^(]*(\@=" contains=luaFuncTable,luaFuncName
syntax match luaFuncTable contained /\k\+\%(\s*[.:]\)\@=/ syntax match luaFuncTable contained /\k\+\%(\s*[.:]\)\@=/
@@ -63,7 +78,8 @@ syntax match luaFuncArgComma contained /,/
syntax region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=@luaExpr nextgroup=luaThenEnd skipwhite skipempty syntax region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=@luaExpr nextgroup=luaThenEnd skipwhite skipempty
" then ... end " then ... end
syntax region luaThenEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=@luaStat,luaElseifThen,luaElse fold call s:FoldableRegion('control', 'luaThenEnd',
\ 'contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=@luaStat,luaElseifThen,luaElse')
" elseif ... then " elseif ... then
syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=@luaExpr syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=@luaExpr
@@ -72,16 +88,20 @@ syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<el
syntax keyword luaElse contained else syntax keyword luaElse contained else
" do ... end " do ... end
syntax region luaBlock transparent matchgroup=luaRepeat start="\<do\>" end="\<end\>" contains=@luaStat fold call s:FoldableRegion('control', 'luaLoopBlock',
\ 'transparent matchgroup=luaRepeat start="\<do\>" end="\<end\>" contains=@luaStat contained')
call s:FoldableRegion('control', 'luaBlock',
\ 'transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=@luaStat')
" repeat ... until " repeat ... until
syntax region luaLoop transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=@luaStat nextgroup=@luaExpr fold call s:FoldableRegion('control', 'luaLoop',
\ 'transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=@luaStat nextgroup=@luaExpr')
" while ... do " while ... do
syntax region luaLoop transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=@luaExpr nextgroup=luaBlock skipwhite skipempty fold syntax region luaLoop transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=@luaExpr nextgroup=luaLoopBlock skipwhite skipempty
" for ... do and for ... in ... do " for ... do and for ... in ... do
syntax region luaLoop transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=@luaExpr,luaIn nextgroup=luaBlock skipwhite skipempty syntax region luaLoop transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=@luaExpr,luaIn nextgroup=luaLoopBlock skipwhite skipempty
syntax keyword luaIn contained in syntax keyword luaIn contained in
" goto and labels " goto and labels
@@ -98,7 +118,8 @@ syntax keyword luaStatement break return
" Strings " Strings
syntax match luaStringSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}# syntax match luaStringSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
syntax region luaStringLong matchgroup=luaStringLongTag start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell call s:FoldableRegion('string', 'luaStringLong',
\ 'matchgroup=luaStringLongTag start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell')
syntax region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaStringSpecial,@Spell syntax region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaStringSpecial,@Spell
syntax region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaStringSpecial,@Spell syntax region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaStringSpecial,@Spell
@@ -113,50 +134,60 @@ syntax match luaFloat "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
" Floating point constant, without dot, with exponent " Floating point constant, without dot, with exponent
syntax match luaFloat "\<\d\+[eE][-+]\=\d\+\>" syntax match luaFloat "\<\d\+[eE][-+]\=\d\+\>"
" Special names from the Standard Library
syntax keyword luaSpecialTable
\ bit32
\ coroutine
\ debug
\ io
\ math
\ os
\ package
\ string
\ table
\ utf8
syntax keyword luaSpecialValue " Special names from the Standard Library
\ _G if !exists('g:lua_syntax_nostdlib')
\ _VERSION syntax keyword luaSpecialValue
\ assert \ module
\ collectgarbage \ require
\ dofile
\ error syntax keyword luaSpecialTable _G
\ getfenv
\ getmetatable syntax keyword luaErrHand
\ ipairs \ assert
\ load \ error
\ loadfile \ pcall
\ loadstring \ xpcall
\ module
\ next if !exists('g:lua_syntax_noextendedstdlib')
\ pairs syntax keyword luaSpecialTable
\ pcall \ bit32
\ print \ coroutine
\ rawequal \ debug
\ rawget \ io
\ rawlen \ math
\ rawset \ os
\ require \ package
\ select \ string
\ setfenv \ table
\ setmetatable \ utf8
\ tonumber
\ tostring syntax keyword luaSpecialValue
\ type \ _VERSION
\ unpack \ collectgarbage
\ xpcall \ dofile
\ getfenv
\ getmetatable
\ ipairs
\ load
\ loadfile
\ loadstring
\ next
\ pairs
\ print
\ rawequal
\ rawget
\ rawlen
\ rawset
\ select
\ setfenv
\ setmetatable
\ tonumber
\ tostring
\ type
\ unpack
endif
endif
" 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
@@ -173,21 +204,23 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaBrackets Noise HiLink luaBrackets Noise
HiLink luaBuiltIn Special HiLink luaBuiltIn Special
HiLink luaComment Comment HiLink luaComment Comment
HiLink luaCommentLongTag luaCommentLong
HiLink luaCommentLong luaComment HiLink luaCommentLong luaComment
HiLink luaCommentTodo Todo HiLink luaCommentTodo Todo
HiLink luaCond Conditional HiLink luaCond Conditional
HiLink luaConstant Boolean HiLink luaConstant Constant
HiLink luaDocTag Underlined HiLink luaDocTag Underlined
HiLink luaEllipsis StorageClass HiLink luaEllipsis Special
HiLink luaElse Conditional HiLink luaElse Conditional
HiLink luaError Error HiLink luaError Error
HiLink luaFloat Float HiLink luaFloat Float
HiLink luaFuncTable Function
HiLink luaFuncArgName Noise HiLink luaFuncArgName Noise
HiLink luaFuncCall PreProc HiLink luaFuncCall PreProc
HiLink luaFuncId Function HiLink luaFuncId Function
HiLink luaFuncKeyword Type HiLink luaFuncName luaFuncId
HiLink luaFuncName Function HiLink luaFuncTable luaFuncId
HiLink luaFuncKeyword luaFunction
HiLink luaFunction Structure
HiLink luaFuncParens Noise HiLink luaFuncParens Noise
HiLink luaGoto luaStatement HiLink luaGoto luaStatement
HiLink luaGotoLabel Noise HiLink luaGotoLabel Noise
@@ -195,6 +228,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaLabel Label HiLink luaLabel Label
HiLink luaLocal Type HiLink luaLocal Type
HiLink luaNumber Number HiLink luaNumber Number
HiLink luaSymbolOperator luaOperator
HiLink luaOperator Operator HiLink luaOperator Operator
HiLink luaRepeat Repeat HiLink luaRepeat Repeat
HiLink luaSemiCol Delimiter HiLink luaSemiCol Delimiter
@@ -204,6 +238,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaString String HiLink luaString String
HiLink luaStringLong luaString HiLink luaStringLong luaString
HiLink luaStringSpecial SpecialChar HiLink luaStringSpecial SpecialChar
HiLink luaErrHand Exception
delcommand HiLink delcommand HiLink
end end

View File

@@ -49,12 +49,15 @@ if get(g:, 'vim_markdown_emphasis_multiline', 1)
else else
let s:oneline = ' oneline' let s:oneline = ' oneline'
endif endif
execute 'syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend' . s:oneline syn region mkdItalic matchgroup=mkdItalic start="\%(\*\|_\)" end="\%(\*\|_\)"
execute 'syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend' . s:oneline syn region mkdBold matchgroup=mkdBold start="\%(\*\*\|__\)" end="\%(\*\*\|__\)"
execute 'syn region htmlBold start="\%(^\|\s\)\*\*\ze\S" end="\S\zs\*\*" keepend' . s:oneline syn region mkdBoldItalic matchgroup=mkdBoldItalic start="\%(\*\*\*\|___\)" end="\%(\*\*\*\|___\)"
execute 'syn region htmlBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend' . s:oneline execute 'syn region htmlItalic matchgroup=mkdItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend contains=@Spell' . s:oneline . s:concealends
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend' . s:oneline execute 'syn region htmlItalic matchgroup=mkdItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend contains=@Spell' . s:oneline . s:concealends
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend' . s:oneline execute 'syn region htmlBold matchgroup=mkdBold start="\%(^\|\s\)\zs\*\*\ze\S" end="\S\zs\*\*" keepend contains=@Spell' . s:oneline . s:concealends
execute 'syn region htmlBold matchgroup=mkdBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend contains=@Spell' . s:oneline . s:concealends
execute 'syn region htmlBoldItalic matchgroup=mkdBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend contains=@Spell' . s:oneline . s:concealends
execute 'syn region htmlBoldItalic matchgroup=mkdBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend contains=@Spell' . s:oneline . s:concealends
" [link](URL) | [link][id] | [link][] | ![image](URL) " [link](URL) | [link][id] | [link][] | ![image](URL)
syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]" syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]"
@@ -104,7 +107,7 @@ syn region mkdFootnote start="\[^" end="\]"
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained
syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\ze\s\+/ contained
syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell
syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell
syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/

View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
syn keyword ngxDirectiveThirdParty set_from_accept_language
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Access Key Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveDeprecated accesskey
syn keyword ngxDirectiveDeprecated accesskey_arg
syn keyword ngxDirectiveDeprecated accesskey_hashmethod
syn keyword ngxDirectiveDeprecated accesskey_signature
endif

42
syntax/modules/afcgi.vim Normal file
View File

@@ -0,0 +1,42 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Asynchronous FastCGI Module <https://github.com/rsms/afcgi>
" Primarily a modified version of the Nginx FastCGI module which implements multiplexing of connections, allowing a single FastCGI server to handle many concurrent requests.
" syn keyword ngxDirectiveThirdParty fastcgi_bind
" syn keyword ngxDirectiveThirdParty fastcgi_buffer_size
" syn keyword ngxDirectiveThirdParty fastcgi_buffers
" syn keyword ngxDirectiveThirdParty fastcgi_busy_buffers_size
" syn keyword ngxDirectiveThirdParty fastcgi_cache
" syn keyword ngxDirectiveThirdParty fastcgi_cache_key
" syn keyword ngxDirectiveThirdParty fastcgi_cache_methods
" syn keyword ngxDirectiveThirdParty fastcgi_cache_min_uses
" syn keyword ngxDirectiveThirdParty fastcgi_cache_path
" syn keyword ngxDirectiveThirdParty fastcgi_cache_use_stale
" syn keyword ngxDirectiveThirdParty fastcgi_cache_valid
" syn keyword ngxDirectiveThirdParty fastcgi_catch_stderr
" syn keyword ngxDirectiveThirdParty fastcgi_connect_timeout
" syn keyword ngxDirectiveThirdParty fastcgi_hide_header
" syn keyword ngxDirectiveThirdParty fastcgi_ignore_client_abort
" syn keyword ngxDirectiveThirdParty fastcgi_ignore_headers
" syn keyword ngxDirectiveThirdParty fastcgi_index
" syn keyword ngxDirectiveThirdParty fastcgi_intercept_errors
" syn keyword ngxDirectiveThirdParty fastcgi_max_temp_file_size
" syn keyword ngxDirectiveThirdParty fastcgi_next_upstream
" syn keyword ngxDirectiveThirdParty fastcgi_param
" syn keyword ngxDirectiveThirdParty fastcgi_pass
" syn keyword ngxDirectiveThirdParty fastcgi_pass_header
" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_body
" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_headers
" syn keyword ngxDirectiveThirdParty fastcgi_read_timeout
" syn keyword ngxDirectiveThirdParty fastcgi_send_lowat
" syn keyword ngxDirectiveThirdParty fastcgi_send_timeout
" syn keyword ngxDirectiveThirdParty fastcgi_split_path_info
" syn keyword ngxDirectiveThirdParty fastcgi_store
" syn keyword ngxDirectiveThirdParty fastcgi_store_access
" syn keyword ngxDirectiveThirdParty fastcgi_temp_file_write_size
" syn keyword ngxDirectiveThirdParty fastcgi_temp_path
syn keyword ngxDirectiveThirdParty fastcgi_upstream_fail_timeout
syn keyword ngxDirectiveThirdParty fastcgi_upstream_max_fails
endif

View File

@@ -0,0 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Akamai G2O Module <https://github.com/kaltura/nginx_mod_akamai_g2o>
" Nginx Module for Authenticating Akamai G2O requests
syn keyword ngxDirectiveThirdParty g2o
syn keyword ngxDirectiveThirdParty g2o_nonce
syn keyword ngxDirectiveThirdParty g2o_key
endif

View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Lua Module <https://github.com/alacner/nginx_lua_module>
" You can be very simple to execute lua code for nginx
syn keyword ngxDirectiveThirdParty lua_file
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Array Variable Module <https://github.com/openresty/array-var-nginx-module>
" Add support for array-typed variables to nginx config files
syn keyword ngxDirectiveThirdParty array_split
syn keyword ngxDirectiveThirdParty array_join
syn keyword ngxDirectiveThirdParty array_map
syn keyword ngxDirectiveThirdParty array_map_op
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Nginx Audio Track for HTTP Live Streaming <https://github.com/flavioribeiro/nginx-audio-track-for-hls-module>
" This nginx module generates audio track for hls streams on the fly.
syn keyword ngxDirectiveThirdParty ngx_hls_audio_track
syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_rootpath
syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_format
syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_header
endif

View File

@@ -0,0 +1,13 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" AWS Proxy Module <https://github.com/anomalizer/ngx_aws_auth>
" Nginx module to proxy to authenticated AWS services
syn keyword ngxDirectiveThirdParty aws_access_key
syn keyword ngxDirectiveThirdParty aws_key_scope
syn keyword ngxDirectiveThirdParty aws_signing_key
syn keyword ngxDirectiveThirdParty aws_endpoint
syn keyword ngxDirectiveThirdParty aws_s3_bucket
syn keyword ngxDirectiveThirdParty aws_sign
endif

View File

@@ -0,0 +1,9 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Backtrace module <https://github.com/alibaba/nginx-backtrace>
" A Nginx module to dump backtrace when a worker process exits abnormally
syn keyword ngxDirectiveThirdParty backtrace_log
syn keyword ngxDirectiveThirdParty backtrace_max_stack_size
endif

14
syntax/modules/brotli.vim Normal file
View File

@@ -0,0 +1,14 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Brotli Module <https://github.com/google/ngx_brotli>
" Nginx module for Brotli compression
syn keyword ngxDirectiveThirdParty brotli_static
syn keyword ngxDirectiveThirdParty brotli
syn keyword ngxDirectiveThirdParty brotli_types
syn keyword ngxDirectiveThirdParty brotli_buffers
syn keyword ngxDirectiveThirdParty brotli_comp_level
syn keyword ngxDirectiveThirdParty brotli_window
syn keyword ngxDirectiveThirdParty brotli_min_length
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Cache Purge Module <https://github.com/FRiCKLE/ngx_cache_purge>
" Adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
syn keyword ngxDirectiveThirdParty proxy_cache_purge
" syn keyword ngxDirectiveThirdParty scgi_cache_purge
" syn keyword ngxDirectiveThirdParty uwsgi_cache_purge
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Chunkin Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpChunkinModule>
" HTTP 1.1 chunked-encoding request body support for Nginx.
syn keyword ngxDirectiveDeprecated chunkin
syn keyword ngxDirectiveDeprecated chunkin_keepalive
syn keyword ngxDirectiveDeprecated chunkin_max_chunks_per_buf
syn keyword ngxDirectiveDeprecated chunkin_resume
endif

View File

@@ -0,0 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
" Circle GIF Module <https://github.com/evanmiller/nginx_circle_gif>
" Generates simple circle images with the colors and size specified in the URL.
syn keyword ngxDirectiveThirdParty circle_gif
syn keyword ngxDirectiveThirdParty circle_gif_max_radius
syn keyword ngxDirectiveThirdParty circle_gif_min_radius
syn keyword ngxDirectiveThirdParty circle_gif_step_radius
endif

Some files were not shown because too many files have changed in this diff Show More