mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dd2e11698 | ||
|
|
9197c69900 | ||
|
|
c7dfe2f626 | ||
|
|
af87010071 | ||
|
|
ef369d45a5 | ||
|
|
64938393bd | ||
|
|
79fce146dd | ||
|
|
ef4435cffc | ||
|
|
c2a7f363c6 | ||
|
|
0134940f23 | ||
|
|
8bb259b1f6 | ||
|
|
466f20b12e | ||
|
|
461de4cc21 | ||
|
|
ba75890936 | ||
|
|
0801eac01a | ||
|
|
9f735b1fe7 | ||
|
|
fbeb019a85 |
166
README.md
166
README.md
@@ -1,4 +1,4 @@
|
||||
# vim-polyglot [![Build Status][travis-img-url]][travis-url] []()
|
||||
# vim-polyglot [![Build Status][travis-img-url]][travis-url] []()
|
||||
|
||||
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
||||
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
||||
@@ -8,7 +8,7 @@ A collection of language packs for Vim.
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs and updates 70+ times faster** than 70+ packages it consist of.
|
||||
- It **installs and updates 100+ times faster** than 100+ packages it consist of.
|
||||
- Solid syntax and indentation support. Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
@@ -23,104 +23,118 @@ 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.
|
||||
|
||||
You can also use Vim 8 built-in package manager:
|
||||
|
||||
```
|
||||
mkdir -p ~/.vim/pack/default/start
|
||||
git clone https://github.com/sheerun/vim-polyglot ~/.vim/pack/default/start/vim-polyglot
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin)
|
||||
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax)
|
||||
- [applescript](https://github.com/vim-scripts/applescript.vim) (syntax)
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin, ftdetect)
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent)
|
||||
- [asciidoc](https://github.com/asciidoc/vim-asciidoc) (syntax)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin)
|
||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (syntax)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin, ftdetect)
|
||||
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [cql](https://github.com/elubow/cql-vim) (syntax, ftdetect)
|
||||
- [caddyfile](https://github.com/joshglendenning/vim-caddyfile) (syntax, indent, ftplugin)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [cql](https://github.com/elubow/cql-vim) (syntax)
|
||||
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin)
|
||||
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin)
|
||||
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, 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)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
|
||||
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent, ftdetect)
|
||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
|
||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin)
|
||||
- [dockerfile](https://github.com/docker/docker) (syntax)
|
||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
||||
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent)
|
||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent)
|
||||
- [graphql](https://github.com/jparise/vim-graphql) (syntax, ftplugin)
|
||||
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
|
||||
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, 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)
|
||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
||||
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin)
|
||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||
- [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)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftdetect, ftplugin, extras)
|
||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin, ftdetect)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||
- [jsx](https://github.com/mxw/vim-jsx) (ftdetect, after)
|
||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftdetect)
|
||||
- [i3](https://github.com/PotatoesMaster/i3-vim-syntax) (syntax, ftplugin)
|
||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent)
|
||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
|
||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect)
|
||||
- [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect)
|
||||
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax)
|
||||
- [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin)
|
||||
- [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin)
|
||||
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent)
|
||||
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin)
|
||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||
- [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin)
|
||||
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (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)
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
|
||||
- [pgsql](https://github.com/exu/pgsql.vim) (syntax)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (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)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
|
||||
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
||||
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
|
||||
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin)
|
||||
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftplugin)
|
||||
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload)
|
||||
- [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)
|
||||
- [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)
|
||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, 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)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, 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)
|
||||
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftdetect, ftplugin)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect)
|
||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax)
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
|
||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin)
|
||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
|
||||
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
|
||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax)
|
||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftplugin)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin)
|
||||
- [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)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftdetect)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [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)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
|
||||
@@ -18,4 +18,44 @@ if g:terraform_align && exists(':Tabularize')
|
||||
endfunction
|
||||
endif
|
||||
|
||||
|
||||
function! TerraformFolds()
|
||||
let thisline = getline(v:lnum)
|
||||
if match(thisline, '^resource') >= 0
|
||||
return ">1"
|
||||
elseif match(thisline, '^provider') >= 0
|
||||
return ">1"
|
||||
elseif match(thisline, '^module') >= 0
|
||||
return ">1"
|
||||
elseif match(thisline, '^variable') >= 0
|
||||
return ">1"
|
||||
elseif match(thisline, '^output') >= 0
|
||||
return ">1"
|
||||
else
|
||||
return "="
|
||||
endif
|
||||
endfunction
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=TerraformFolds()
|
||||
setlocal foldlevel=1
|
||||
|
||||
function! TerraformFoldText()
|
||||
let foldsize = (v:foldend-v:foldstart)
|
||||
return getline(v:foldstart).' ('.foldsize.' lines)'
|
||||
endfunction
|
||||
setlocal foldtext=TerraformFoldText()
|
||||
|
||||
"inoremap <space> <C-O>za
|
||||
nnoremap <space> za
|
||||
onoremap <space> <C-C>za
|
||||
vnoremap <space> zf
|
||||
|
||||
" Match the identation put in place by Hashicorp and :TerraformFmt, https://github.com/hashivim/vim-terraform/issues/21
|
||||
if get(g:, "terraform_align", 1)
|
||||
setlocal tabstop=2
|
||||
setlocal softtabstop=2
|
||||
setlocal shiftwidth=2
|
||||
endif
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -24,6 +24,16 @@ syn match cCustomParen "(" contains=cParen contains=cCppParen
|
||||
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
||||
hi def link cCustomFunc Function
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Highlight member variable names.
|
||||
" -----------------------------------------------------------------------------
|
||||
if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
|
||||
syn match cCustomDot "\." contained
|
||||
syn match cCustomPtr "->" contained
|
||||
syn match cCustomMemVar "\(\.\|->\)\w\+" contains=cCustomDot,cCustomPtr
|
||||
hi def link cCustomMemVar Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Source: aftersyntaxc.vim
|
||||
" -----------------------------------------------------------------------------
|
||||
|
||||
@@ -557,6 +557,7 @@ syntax keyword cppSTLios defaultfloat
|
||||
syntax keyword cppSTLios endl
|
||||
syntax keyword cppSTLios ends
|
||||
syntax keyword cppSTLios fixed
|
||||
syntax keyword cppSTLios floatfield
|
||||
syntax keyword cppSTLios flush
|
||||
syntax keyword cppSTLios get_money
|
||||
syntax keyword cppSTLios get_time
|
||||
|
||||
@@ -34,6 +34,22 @@ syn region ShaderScript
|
||||
\ end="</script>"me=s-1
|
||||
\ contains=@GLSL,htmlScriptTag,@htmlPreproc
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: HTML (version 5.1)
|
||||
" Last Change: 2017 Feb 15
|
||||
" License: Public domain
|
||||
" (but let me know if you like :) )
|
||||
"
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
|
||||
" Comment
|
||||
" https://github.com/w3c/html/issues/694
|
||||
syntax region htmlComment start=+<!--+ end=+-->+ contains=@Spell
|
||||
syntax region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||
|
||||
|
||||
107
after/syntax/mma.vim
Normal file
107
after/syntax/mma.vim
Normal file
@@ -0,0 +1,107 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||
|
||||
"Vim conceal file
|
||||
" Language: Mathematica
|
||||
" Maintainer: R. Menon <rsmenon@icloud.com>
|
||||
" Last Change: Feb 25, 2013
|
||||
|
||||
if (exists('g:mma_candy') && g:mma_candy == 0) || !has('conceal') || &enc != 'utf-8'
|
||||
finish
|
||||
endif
|
||||
|
||||
"These are fairly safe and straightforward conceals
|
||||
if exists('g:mma_candy') && g:mma_candy > 0
|
||||
"Rules
|
||||
syntax match mmaOperator "->" conceal cchar=→ "Rule
|
||||
syntax match mmaOperator ":>" conceal cchar=⧴ "RuleDelayed
|
||||
|
||||
"Logicals
|
||||
syntax match mmaOperator "===" conceal cchar=≡ "SameQ
|
||||
syntax match mmaOperator "=!=" conceal cchar=≢ "UnsameQ
|
||||
syntax match mmaOperator "!=" conceal cchar=≠ "NotEqual
|
||||
syntax match mmaOperator "<=" conceal cchar=≤ "LessEqual
|
||||
syntax match mmaOperator ">=" conceal cchar=≥ "GreaterEqual
|
||||
|
||||
"Constants
|
||||
syntax keyword mmaSystemSymbol Pi conceal cchar=π
|
||||
syntax keyword mmaSystemSymbol Infinity conceal cchar=∞
|
||||
syntax keyword mmaSystemSymbol Degree conceal cchar=°
|
||||
|
||||
"Domains
|
||||
syntax keyword mmaSystemSymbol Reals conceal cchar=ℝ
|
||||
syntax keyword mmaSystemSymbol Integers conceal cchar=ℤ
|
||||
syntax keyword mmaSystemSymbol Complexes conceal cchar=ℂ
|
||||
syntax keyword mmaSystemSymbol Rationals conceal cchar=ℚ
|
||||
|
||||
"Greek
|
||||
syntax match mmaSymbol "\\\[CapitalAlpha\]" conceal cchar=Α
|
||||
syntax match mmaSymbol "\\\[CapitalBeta\]" conceal cchar=Β
|
||||
syntax match mmaSymbol "\\\[CapitalGamma\]" conceal cchar=Γ
|
||||
syntax match mmaSymbol "\\\[CapitalDelta\]" conceal cchar=Δ
|
||||
syntax match mmaSymbol "\\\[CapitalEpsilon\]" conceal cchar=Ε
|
||||
syntax match mmaSymbol "\\\[CapitalZeta\]" conceal cchar=Ζ
|
||||
syntax match mmaSymbol "\\\[CapitalEta\]" conceal cchar=Η
|
||||
syntax match mmaSymbol "\\\[CapitalTheta\]" conceal cchar=Θ
|
||||
syntax match mmaSymbol "\\\[CapitalIota\]" conceal cchar=Ι
|
||||
syntax match mmaSymbol "\\\[CapitalKappa\]" conceal cchar=Κ
|
||||
syntax match mmaSymbol "\\\[CapitalLambda\]" conceal cchar=Λ
|
||||
syntax match mmaSymbol "\\\[CapitalMu\]" conceal cchar=Μ
|
||||
syntax match mmaSymbol "\\\[CapitalNu\]" conceal cchar=Ν
|
||||
syntax match mmaSymbol "\\\[CapitalXi\]" conceal cchar=Ξ
|
||||
syntax match mmaSymbol "\\\[CapitalOmicron\]" conceal cchar=Ο
|
||||
syntax match mmaSymbol "\\\[CapitalPi\]" conceal cchar=Π
|
||||
syntax match mmaSymbol "\\\[CapitalRho\]" conceal cchar=Ρ
|
||||
syntax match mmaSymbol "\\\[CapitalSigma\]" conceal cchar=Σ
|
||||
syntax match mmaSymbol "\\\[CapitalTau\]" conceal cchar=Τ
|
||||
syntax match mmaSymbol "\\\[CapitalUpsilon\]" conceal cchar=Υ
|
||||
syntax match mmaSymbol "\\\[CapitalPhi\]" conceal cchar=Φ
|
||||
syntax match mmaSymbol "\\\[CapitalChi\]" conceal cchar=Χ
|
||||
syntax match mmaSymbol "\\\[CapitalPsi\]" conceal cchar=Ψ
|
||||
syntax match mmaSymbol "\\\[CapitalOmega\]" conceal cchar=Ω
|
||||
syntax match mmaSymbol "\\\[Alpha\]" conceal cchar=α
|
||||
syntax match mmaSymbol "\\\[Beta\]" conceal cchar=β
|
||||
syntax match mmaSymbol "\\\[Gamma\]" conceal cchar=γ
|
||||
syntax match mmaSymbol "\\\[Delta\]" conceal cchar=δ
|
||||
syntax match mmaSymbol "\\\[Epsilon\]" conceal cchar=ε
|
||||
syntax match mmaSymbol "\\\[Zeta\]" conceal cchar=ζ
|
||||
syntax match mmaSymbol "\\\[Eta\]" conceal cchar=η
|
||||
syntax match mmaSymbol "\\\[Theta\]" conceal cchar=θ
|
||||
syntax match mmaSymbol "\\\[Iota\]" conceal cchar=ι
|
||||
syntax match mmaSymbol "\\\[Kappa\]" conceal cchar=κ
|
||||
syntax match mmaSymbol "\\\[Lambda\]" conceal cchar=λ
|
||||
syntax match mmaSymbol "\\\[Mu\]" conceal cchar=μ
|
||||
syntax match mmaSymbol "\\\[Nu\]" conceal cchar=ν
|
||||
syntax match mmaSymbol "\\\[Xi\]" conceal cchar=ξ
|
||||
syntax match mmaSymbol "\\\[Omicron\]" conceal cchar=ο
|
||||
syntax match mmaSymbol "\\\[Pi\]" conceal cchar=π
|
||||
syntax match mmaSymbol "\\\[Rho\]" conceal cchar=ρ
|
||||
syntax match mmaSymbol "\\\[Sigma\]" conceal cchar=σ
|
||||
syntax match mmaSymbol "\\\[Tau\]" conceal cchar=τ
|
||||
syntax match mmaSymbol "\\\[Upsilon\]" conceal cchar=υ
|
||||
syntax match mmaSymbol "\\\[Phi\]" conceal cchar=φ
|
||||
syntax match mmaSymbol "\\\[Chi\]" conceal cchar=χ
|
||||
syntax match mmaSymbol "\\\[Psi\]" conceal cchar=ψ
|
||||
syntax match mmaSymbol "\\\[Omega\]" conceal cchar=ω
|
||||
endif
|
||||
|
||||
"These might be troublesome if the appropriate fonts are missing. Also, they don't
|
||||
"look quite as good as the earlier ones, so enable only if the user chooses to
|
||||
if exists('g:mma_candy') && g:mma_candy == 2
|
||||
"Constants
|
||||
syntax keyword mmaSystemSymbol I conceal cchar=ⅈ
|
||||
syntax keyword mmaSystemSymbol E conceal cchar=ⅇ
|
||||
|
||||
"Functions
|
||||
syntax keyword mmaSystemSymbol Sum conceal cchar=∑
|
||||
syntax keyword mmaSystemSymbol Product conceal cchar=∏
|
||||
syntax keyword mmaSystemSymbol Sqrt conceal cchar=√
|
||||
|
||||
"Misc
|
||||
syntax match mmaOperator ">>" conceal cchar=» "Put
|
||||
syntax match mmaOperator "<<" conceal cchar=« "Get
|
||||
endif
|
||||
|
||||
hi! link Conceal Normal
|
||||
setlocal conceallevel=2
|
||||
|
||||
endif
|
||||
@@ -21,9 +21,7 @@ if version < 600
|
||||
endif
|
||||
syntax clear
|
||||
|
||||
syn match yamlDelimiter "[:,-]"
|
||||
syn match yamlBlock "[\[\]\{\}\|\>]"
|
||||
syn match yamlOperator "[?^+-]\|=>"
|
||||
|
||||
syn region yamlComment start="\#" end="$"
|
||||
syn match yamlIndicator "#YAML:\S\+"
|
||||
@@ -40,11 +38,12 @@ 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 FALSE False false NO No no OFF Off off
|
||||
|
||||
syn match yamlKey "^\s*\zs\S\+\ze\s*:"
|
||||
syn match yamlKey "^\s*\zs[^ \t\"]\+\ze\s*:"
|
||||
syn match yamlKey "^\s*-\s*\zs[^ \t\"]\+\ze\s*:"
|
||||
syn match yamlAnchor "&\S\+"
|
||||
syn match yamlAlias "*\S\+"
|
||||
|
||||
" Setupt the hilighting links
|
||||
" Setup the highlighting links
|
||||
|
||||
hi link yamlConstant Keyword
|
||||
hi link yamlIndicator PreCondit
|
||||
@@ -55,10 +54,7 @@ hi link yamlType Type
|
||||
|
||||
hi link yamlComment Comment
|
||||
hi link yamlBlock Operator
|
||||
hi link yamlOperator Operator
|
||||
hi link yamlDelimiter Delimiter
|
||||
hi link yamlString String
|
||||
hi link yamlEscape Special
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -68,5 +68,86 @@ function! dart#tojs(q_args) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Finds the path to `uri`.
|
||||
"
|
||||
" If the file is a package: uri, looks for a .packages file to resolve the path.
|
||||
" If the path cannot be resolved, or is not a package: uri, returns the
|
||||
" original.
|
||||
function! dart#resolveUri(uri) abort
|
||||
if a:uri !~ 'package:'
|
||||
return a:uri
|
||||
endif
|
||||
let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '')
|
||||
let [found, package_map] = s:PackageMap()
|
||||
if !found
|
||||
call s:error('cannot find .packages file')
|
||||
return a:uri
|
||||
endif
|
||||
if !has_key(package_map, package_name)
|
||||
call s:error('no package mapping for '.package_name)
|
||||
return a:uri
|
||||
endif
|
||||
let package_lib = package_map[package_name]
|
||||
return substitute(a:uri,
|
||||
\ 'package:'.package_name,
|
||||
\ escape(package_map[package_name], '\'),
|
||||
\ '')
|
||||
endfunction
|
||||
|
||||
" A map from package name to lib directory parse from a '.packages' file.
|
||||
"
|
||||
" Returns [found, package_map]
|
||||
function! s:PackageMap() abort
|
||||
let [found, dot_packages] = s:DotPackagesFile()
|
||||
if !found
|
||||
return [v:false, {}]
|
||||
endif
|
||||
let dot_packages_dir = fnamemodify(dot_packages, ':p:h')
|
||||
let lines = readfile(dot_packages)
|
||||
let map = {}
|
||||
for line in lines
|
||||
if line =~ '\s*#'
|
||||
continue
|
||||
endif
|
||||
let package = substitute(line, ':.*$', '', '')
|
||||
let lib_dir = substitute(line, '^[^:]*:', '', '')
|
||||
if lib_dir =~ 'file:/'
|
||||
let lib_dir = substitute(lib_dir, 'file://', '', '')
|
||||
if lib_dir =~ '/[A-Z]:/'
|
||||
let lib_dir = lib_dir[1:]
|
||||
endif
|
||||
else
|
||||
let lib_dir = resolve(dot_packages_dir.'/'.lib_dir)
|
||||
endif
|
||||
if lib_dir =~ '/$'
|
||||
let lib_dir = lib_dir[:len(lib_dir) - 2]
|
||||
endif
|
||||
let map[package] = lib_dir
|
||||
endfor
|
||||
return [v:true, map]
|
||||
endfunction
|
||||
|
||||
" Finds a file name '.packages' in the cwd, or in any directory above the open
|
||||
" file.
|
||||
"
|
||||
" Returns [found, file].
|
||||
function! s:DotPackagesFile() abort
|
||||
if filereadable('.packages')
|
||||
return [v:true, '.packages']
|
||||
endif
|
||||
let dir_path = expand('%:p:h')
|
||||
while v:true
|
||||
let file_path = dir_path.'/.packages'
|
||||
if filereadable(file_path)
|
||||
return [v:true, file_path]
|
||||
endif
|
||||
let parent = fnamemodify(dir_path, ':h')
|
||||
if dir_path == parent
|
||||
break
|
||||
endif
|
||||
let dir_path = parent
|
||||
endwhile
|
||||
return [v:false, '']
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,219 +1,347 @@
|
||||
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
|
||||
function! elixir#indent#debug(str)
|
||||
if exists("g:elixir_indent_debug") && g:elixir_indent_debug
|
||||
echom a:str
|
||||
endif
|
||||
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
|
||||
" Returns 0 or 1 based on whether or not the text starts with the given
|
||||
" expression and is not a string or comment
|
||||
function! elixir#indent#starts_with(text, expr, lnum)
|
||||
let pos = match(a:text, '^\s*'.a:expr)
|
||||
if pos == -1
|
||||
return 0
|
||||
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
|
||||
" NOTE: @jbodah 2017-02-24: pos is the index of the match which is
|
||||
" zero-indexed. Add one to make it the column number
|
||||
if elixir#indent#is_string_or_comment(a:lnum, pos + 1)
|
||||
return 0
|
||||
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*')
|
||||
return 1
|
||||
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
|
||||
" Returns 0 or 1 based on whether or not the text ends with the given
|
||||
" expression and is not a string or comment
|
||||
function! elixir#indent#ends_with(text, expr, lnum)
|
||||
let pos = match(a:text, a:expr.'\s*$')
|
||||
if pos == -1
|
||||
return 0
|
||||
else
|
||||
return a:ind
|
||||
if elixir#indent#is_string_or_comment(a:lnum, pos)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
||||
endfunction
|
||||
|
||||
" Returns 0 or 1 based on whether or not the text matches the given expression
|
||||
function! elixir#indent#contains(text, expr)
|
||||
return a:text =~ a:expr
|
||||
endfunction
|
||||
|
||||
" Returns 0 or 1 based on whether or not the given line number and column
|
||||
" number pair is a string or comment
|
||||
function! elixir#indent#is_string_or_comment(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 1), "name") =~ '\%(String\|Comment\)'
|
||||
endfunction
|
||||
|
||||
" Skip expression for searchpair. Returns 0 or 1 based on whether the value
|
||||
" under the cursor is a string or comment
|
||||
function! elixir#indent#searchpair_back_skip()
|
||||
" NOTE: @jbodah 2017-02-27: for some reason this function gets called with
|
||||
" and index that doesn't exist in the line sometimes. Detect and account for
|
||||
" that situation
|
||||
let curr_col = col('.')
|
||||
if getline('.')[curr_col-1] == ''
|
||||
let curr_col = curr_col-1
|
||||
endif
|
||||
return elixir#indent#is_string_or_comment(line('.'), curr_col)
|
||||
endfunction
|
||||
|
||||
" DRY up searchpair calls
|
||||
function! elixir#indent#searchpair_back(start, mid, end)
|
||||
let line = line('.')
|
||||
return searchpair(a:start, a:mid, a:end, 'bnW', "line('.') == " . line . " || elixir#indent#searchpair_back_skip()")
|
||||
endfunction
|
||||
|
||||
" DRY up searchpairpos calls
|
||||
function! elixir#indent#searchpairpos_back(start, mid, end)
|
||||
let line = line('.')
|
||||
return searchpairpos(a:start, a:mid, a:end, 'bnW', "line('.') == " . line . " || elixir#indent#searchpair_back_skip()")
|
||||
endfunction
|
||||
|
||||
" DRY up regex for keywords that 1) makes sure we only look at complete words
|
||||
" and 2) ignores atoms
|
||||
function! elixir#indent#keyword(expr)
|
||||
return ':\@<!\<\C\%('.a:expr.'\)\>:\@!'
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#starts_with_comment(text)
|
||||
return match(a:text, '^\s*#') != -1
|
||||
endfunction
|
||||
|
||||
" Start at the end of text and search backwards looking for a match. Also peek
|
||||
" ahead if we get a match to make sure we get a complete match. This means
|
||||
" that the result should be the position of the start of the right-most match
|
||||
function! elixir#indent#find_last_pos(lnum, text, match)
|
||||
let last = len(a:text) - 1
|
||||
let c = last
|
||||
|
||||
while c >= 0
|
||||
let substr = strpart(a:text, c, last)
|
||||
let peek = strpart(a:text, c - 1, last)
|
||||
let ss_match = match(substr, a:match)
|
||||
if ss_match != -1
|
||||
let peek_match = match(peek, a:match)
|
||||
if peek_match == ss_match + 1
|
||||
let syng = synIDattr(synID(a:lnum, c + ss_match, 1), 'name')
|
||||
if syng !~ '\%(String\|Comment\)'
|
||||
return c + ss_match
|
||||
end
|
||||
end
|
||||
end
|
||||
let c -= 1
|
||||
endwhile
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_top_of_file(_lnum, _text, prev_nb_lnum, _prev_nb_text)
|
||||
if a:prev_nb_lnum == 0
|
||||
return 0
|
||||
else
|
||||
return -1
|
||||
end
|
||||
endfunction
|
||||
|
||||
" TODO: @jbodah 2017-03-31: remove
|
||||
function! elixir#indent#handle_following_trailing_do(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
if elixir#indent#ends_with(a:prev_nb_text, elixir#indent#keyword('do'), a:prev_nb_lnum)
|
||||
if elixir#indent#starts_with(a:text, elixir#indent#keyword('end'), a:lnum)
|
||||
return indent(a:prev_nb_lnum)
|
||||
else
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_following_trailing_binary_operator(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
let binary_operator = '\%(=\|<>\|>>>\|<=\|||\|+\|\~\~\~\|-\|&&\|<<<\|/\|\^\^\^\|\*\)'
|
||||
|
||||
if elixir#indent#ends_with(a:prev_nb_text, binary_operator, a:prev_nb_lnum)
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_pipe(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
if elixir#indent#starts_with(a:text, '|>', a:lnum)
|
||||
let match_operator = '\%(!\|=\|<\|>\)\@<!=\%(=\|>\|\~\)\@!'
|
||||
let pos = elixir#indent#find_last_pos(a:prev_nb_lnum, a:prev_nb_text, match_operator)
|
||||
if pos == -1
|
||||
return indent(a:prev_nb_lnum)
|
||||
else
|
||||
let next_word_pos = match(strpart(a:prev_nb_text, pos+1, len(a:prev_nb_text)-1), '\S')
|
||||
if next_word_pos == -1
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
else
|
||||
return pos + 1 + next_word_pos
|
||||
end
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_comment(_lnum, text, prev_nb_lnum, _prev_nb_text)
|
||||
if elixir#indent#starts_with_comment(a:text)
|
||||
return indent(a:prev_nb_lnum)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_end(lnum, text, _prev_nb_lnum, _prev_nb_text)
|
||||
if elixir#indent#starts_with(a:text, elixir#indent#keyword('end'), a:lnum)
|
||||
let pair_lnum = elixir#indent#searchpair_back(elixir#indent#keyword('do\|fn'), '', elixir#indent#keyword('end').'\zs')
|
||||
return indent(pair_lnum)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_mid_or_end_block_keyword(lnum, text, _prev_nb_lnum, _prev_nb_text)
|
||||
if elixir#indent#starts_with(a:text, elixir#indent#keyword('catch\|rescue\|after\|else'), a:lnum)
|
||||
let pair_lnum = elixir#indent#searchpair_back(elixir#indent#keyword('with\|receive\|try\|if\|fn'), elixir#indent#keyword('catch\|rescue\|after\|else').'\zs', elixir#indent#keyword('end'))
|
||||
return indent(pair_lnum)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_close_bracket(lnum, text, _prev_nb_lnum, _prev_nb_text)
|
||||
if elixir#indent#starts_with(a:text, '\%(\]\|}\|)\)', a:lnum)
|
||||
let pair_lnum = elixir#indent#searchpair_back('\%(\[\|{\|(\)', '', '\%(\]\|}\|)\)')
|
||||
return indent(pair_lnum)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_starts_with_binary_operator(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
let binary_operator = '\%(=\|<>\|>>>\|<=\|||\|+\|\~\~\~\|-\|&&\|<<<\|/\|\^\^\^\|\*\)'
|
||||
|
||||
if elixir#indent#starts_with(a:text, binary_operator, a:lnum)
|
||||
let match_operator = '\%(!\|=\|<\|>\)\@<!=\%(=\|>\|\~\)\@!'
|
||||
let pos = elixir#indent#find_last_pos(a:prev_nb_lnum, a:prev_nb_text, match_operator)
|
||||
if pos == -1
|
||||
return indent(a:prev_nb_lnum)
|
||||
else
|
||||
let next_word_pos = match(strpart(a:prev_nb_text, pos+1, len(a:prev_nb_text)-1), '\S')
|
||||
if next_word_pos == -1
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
else
|
||||
return pos + 1 + next_word_pos
|
||||
end
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" To handle nested structures properly we need to find the innermost
|
||||
" nested structure. For example, we might be in a function in a map in a
|
||||
" function, etc... so we need to first figure out what the innermost structure
|
||||
" is then forward execution to the proper handler
|
||||
function! elixir#indent#handle_inside_nested_construct(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
let start_pattern = '\C\%(\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|{\|\[\|(\)'
|
||||
let end_pattern = '\C\%(\<end\>\|\]\|}\|)\)'
|
||||
let pair_info = elixir#indent#searchpairpos_back(start_pattern, '', end_pattern)
|
||||
let pair_lnum = pair_info[0]
|
||||
let pair_col = pair_info[1]
|
||||
if pair_lnum != 0 || pair_col != 0
|
||||
let pair_text = getline(pair_lnum)
|
||||
let pair_char = pair_text[pair_col - 1]
|
||||
if pair_char == 'f'
|
||||
call elixir#indent#debug("testing elixir#indent#do_handle_inside_fn")
|
||||
return elixir#indent#do_handle_inside_fn(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text)
|
||||
elseif pair_char == '['
|
||||
call elixir#indent#debug("testing elixir#indent#do_handle_inside_square_brace")
|
||||
return elixir#indent#do_handle_inside_square_brace(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text)
|
||||
elseif pair_char == '{'
|
||||
call elixir#indent#debug("testing elixir#indent#do_handle_inside_curly_brace")
|
||||
return elixir#indent#do_handle_inside_curly_brace(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text)
|
||||
elseif pair_char == '('
|
||||
call elixir#indent#debug("testing elixir#indent#do_handle_inside_parens")
|
||||
return elixir#indent#do_handle_inside_parens(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text)
|
||||
else
|
||||
call elixir#indent#debug("testing elixir#indent#do_handle_inside_keyword_block")
|
||||
return elixir#indent#do_handle_inside_keyword_block(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text)
|
||||
end
|
||||
else
|
||||
return -1
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#do_handle_inside_keyword_block(pair_lnum, _pair_col, _lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
let keyword_pattern = '\C\%(\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<after\>\|\<catch\>\|\<rescue\>\|\<else\>\)'
|
||||
if a:pair_lnum
|
||||
" last line is a "receive" or something
|
||||
if elixir#indent#starts_with(a:prev_nb_text, keyword_pattern, a:prev_nb_lnum)
|
||||
call elixir#indent#debug("prev nb line is keyword")
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
elseif elixir#indent#contains(a:text, '->')
|
||||
call elixir#indent#debug("contains ->")
|
||||
" TODO: @jbodah 2017-03-31: test contains ignores str + comments
|
||||
return indent(a:pair_lnum) + &sw
|
||||
elseif elixir#indent#contains(a:prev_nb_text, '->')
|
||||
call elixir#indent#debug("prev nb line contains ->")
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
else
|
||||
call elixir#indent#debug("doesnt start with comment or contain ->")
|
||||
return indent(a:prev_nb_lnum)
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#do_handle_inside_fn(pair_lnum, _pair_col, lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
if a:pair_lnum && a:pair_lnum != a:lnum
|
||||
if elixir#indent#contains(a:text, '->')
|
||||
return indent(a:pair_lnum) + &sw
|
||||
else
|
||||
if elixir#indent#ends_with(a:prev_nb_text, '->', a:prev_nb_lnum)
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
else
|
||||
return indent(a:prev_nb_lnum)
|
||||
end
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#do_handle_inside_square_brace(pair_lnum, pair_col, _lnum, _text, _prev_nb_lnum, _prev_nb_text)
|
||||
" If in list...
|
||||
if a:pair_lnum != 0 || a:pair_col != 0
|
||||
let pair_text = getline(a:pair_lnum)
|
||||
let substr = strpart(pair_text, a:pair_col, len(pair_text)-1)
|
||||
let indent_pos = match(substr, '\S')
|
||||
if indent_pos != -1
|
||||
return indent_pos + a:pair_col
|
||||
else
|
||||
return indent(a:pair_lnum) + &sw
|
||||
endif
|
||||
else
|
||||
return -1
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#do_handle_inside_curly_brace(pair_lnum, _pair_col, _lnum, _text, _prev_nb_lnum, _prev_nb_text)
|
||||
return indent(a:pair_lnum) + &sw
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#do_handle_inside_parens(pair_lnum, pair_col, _lnum, _text, prev_nb_lnum, prev_nb_text)
|
||||
if a:pair_lnum
|
||||
if elixir#indent#ends_with(a:prev_nb_text, '(', a:prev_nb_lnum)
|
||||
return indent(a:prev_nb_lnum) + &sw
|
||||
elseif a:pair_lnum == a:prev_nb_lnum
|
||||
" Align indent (e.g. "def add(a,")
|
||||
let pos = elixir#indent#find_last_pos(a:prev_nb_lnum, a:prev_nb_text, '[^(]\+,')
|
||||
if pos == -1
|
||||
return 0
|
||||
else
|
||||
return pos
|
||||
end
|
||||
else
|
||||
return indent(a:prev_nb_lnum)
|
||||
end
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! elixir#indent#handle_inside_generic_block(lnum, _text, prev_nb_lnum, prev_nb_text)
|
||||
let pair_lnum = searchpair(elixir#indent#keyword('do\|fn'), '', elixir#indent#keyword('end'), 'bW', "line('.') == ".a:lnum." || elixir#indent#is_string_or_comment(line('.'), col('.'))")
|
||||
if pair_lnum
|
||||
" TODO: @jbodah 2017-03-29: this should probably be the case in *all*
|
||||
" blocks
|
||||
if elixir#indent#ends_with(a:prev_nb_text, ',', a:prev_nb_lnum)
|
||||
return indent(pair_lnum) + 2 * &sw
|
||||
else
|
||||
return indent(pair_lnum) + &sw
|
||||
endif
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,52 +1,28 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
let s:SKIP_SYNTAX = '\%(Comment\|String\)$'
|
||||
function! elixir#util#get_filename(word) abort
|
||||
let word = a:word
|
||||
|
||||
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
|
||||
" get first thing that starts uppercase, until the first space or end of line
|
||||
let word = substitute(word,'^\s*\(\u[^ ]\+\).*$','\1','g')
|
||||
|
||||
return synIDattr(synID(a:line, a:col, 1), "name")
|
||||
\ !~ s:SKIP_SYNTAX
|
||||
endfunction
|
||||
" remove any trailing characters that don't look like a nested module
|
||||
let word = substitute(word,'\.\U.*$','','g')
|
||||
|
||||
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
|
||||
" replace module dots with slash
|
||||
let word = substitute(word,'\.','/','g')
|
||||
|
||||
function! s:match_count(line, pattern)
|
||||
let size = strlen(a:line.text)
|
||||
let index = 0
|
||||
let counter = 0
|
||||
" remove any special chars
|
||||
let word = substitute(word,'[^A-z0-9-_/]','','g')
|
||||
|
||||
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
|
||||
" convert to snake_case
|
||||
let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g')
|
||||
let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g')
|
||||
let word = substitute(word,'\(\l\|\d\)\(\u\)','\1_\2','g')
|
||||
let word = substitute(word,'-','_','g')
|
||||
let word = tolower(word)
|
||||
|
||||
return counter
|
||||
endfunction
|
||||
|
||||
function elixir#util#is_blank(string)
|
||||
return a:string =~ '^\s*$'
|
||||
return word
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -589,11 +589,13 @@ class VimRubyCompletion
|
||||
# {{{ main completion code
|
||||
def self.preload_rails
|
||||
a = VimRubyCompletion.new
|
||||
require 'Thread'
|
||||
Thread.new(a) do |b|
|
||||
begin
|
||||
b.load_rails
|
||||
rescue
|
||||
if VIM::evaluate("has('nvim')") == 0
|
||||
require 'thread'
|
||||
Thread.new(a) do |b|
|
||||
begin
|
||||
b.load_rails
|
||||
rescue
|
||||
end
|
||||
end
|
||||
end
|
||||
a.load_rails
|
||||
|
||||
@@ -3,33 +3,220 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
" Vim completion for WAI-ARIA data file
|
||||
" Language: HTML + WAI-ARIA
|
||||
" Maintainer: othree <othree@gmail.com>
|
||||
" Last Change: 2010 Sep 09
|
||||
" Last Change: 2017 Mar 07
|
||||
|
||||
" WAI_ARIA: {{{
|
||||
" Ref: http://www.w3.org/TR/wai-aria/
|
||||
" Version: Draft 15 December 2009
|
||||
" Ref: https://www.w3.org/TR/wai-aria-1.1/
|
||||
" Version: W3C Candidate Recommendation 27 October 2016
|
||||
|
||||
let abstract_role = {}
|
||||
let role_attributes = {}
|
||||
let default_role = {}
|
||||
|
||||
" Ref: http://www.w3.org/TR/wai-aria/roles
|
||||
" Version: Draft 15 December 2009
|
||||
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 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']
|
||||
" Ref: https://www.w3.org/TR/wai-aria-1.1/#roles_categorization
|
||||
" Version: W3C Candidate Recommendation 27 October 2016
|
||||
let widget_role = [
|
||||
\ 'alert',
|
||||
\ 'alertdialog',
|
||||
\ 'button',
|
||||
\ 'checkbox',
|
||||
\ 'combobox',
|
||||
\ 'dialog',
|
||||
\ 'gridcell',
|
||||
\ 'link',
|
||||
\ 'log',
|
||||
\ 'marquee',
|
||||
\ 'menuitem',
|
||||
\ 'menuitemcheckbox',
|
||||
\ 'menuitemradio',
|
||||
\ 'option',
|
||||
\ 'progressbar',
|
||||
\ 'radio',
|
||||
\ 'radiogroup',
|
||||
\ 'scrollbar',
|
||||
\ 'searchbox',
|
||||
\ 'slider',
|
||||
\ 'spinbutton',
|
||||
\ 'status',
|
||||
\ 'switch',
|
||||
\ 'tab',
|
||||
\ 'tabpanel',
|
||||
\ 'textbox',
|
||||
\ 'timer',
|
||||
\ 'tooltip',
|
||||
\ 'treeitem',
|
||||
\ 'combobox',
|
||||
\ 'grid',
|
||||
\ 'listbox',
|
||||
\ 'menu',
|
||||
\ 'menubar',
|
||||
\ 'radiogroup',
|
||||
\ 'tablist',
|
||||
\ 'tree',
|
||||
\ 'treegrid'
|
||||
\ ]
|
||||
|
||||
let document_structure = [
|
||||
\ 'article',
|
||||
\ 'cell',
|
||||
\ 'columnheader',
|
||||
\ 'definition',
|
||||
\ 'directory',
|
||||
\ 'document',
|
||||
\ 'feed',
|
||||
\ 'figure',
|
||||
\ 'group',
|
||||
\ 'heading',
|
||||
\ 'img',
|
||||
\ 'list',
|
||||
\ 'listitem',
|
||||
\ 'math',
|
||||
\ 'none',
|
||||
\ 'note',
|
||||
\ 'presentation',
|
||||
\ 'region',
|
||||
\ 'row',
|
||||
\ 'rowheader',
|
||||
\ 'separator',
|
||||
\ 'table',
|
||||
\ 'term'
|
||||
\ ]
|
||||
|
||||
let landmark_role = [
|
||||
\ 'application',
|
||||
\ 'banner',
|
||||
\ 'complementary',
|
||||
\ 'contentinfo',
|
||||
\ 'form',
|
||||
\ 'main',
|
||||
\ 'navigation',
|
||||
\ 'search'
|
||||
\ ]
|
||||
|
||||
" Ref: https://www.w3.org/TR/dpub-aria-1.0/
|
||||
" Version: W3C Candidate Recommendation 15 December 2016
|
||||
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(role, landmark_role)
|
||||
let role = extend(role, dpub_role)
|
||||
|
||||
" 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 widget_attributes = {'aria-autocomplete': ['inline', 'list', 'both', 'none'], 'aria-checked': ['true', 'false', 'mixed', 'undefined'], 'aria-disabled': ['true', 'false'], 'aria-expanded': ['true', 'false', 'undefined'], 'aria-haspopup': ['true', 'false'], 'aria-hidden': ['true', 'false'], 'aria-invalid': ['grammar', 'spelling', 'true', 'false'], 'aria-label': [], 'aria-level': [], 'aria-multiline': ['true', 'false'], 'aria-multiselectable': ['true', 'false'], 'aria-orientation': ['horizontal', 'vertical'], 'aria-pressed': ['true', 'false', 'mixed', 'undefined'], 'aria-readonly': ['true', 'false'], 'aria-required': ['true', 'false'], 'aria-selected': ['true', 'false', 'undefined'], 'aria-sort': ['ascending', 'descending', 'none', 'other'], 'aria-valuemax': [], 'aria-valuemin': [], 'aria-valuenow': [], 'aria-valuetext': []}
|
||||
let live_region_attributes = {'aria-atomic': ['true', 'false'], 'aria-busy': ['true', 'false'], 'aria-live': ['off', 'polite', 'assertive'], 'aria-relevant': ['additions', 'removals', 'text', 'all', 'additions text']}
|
||||
let drag_and_drop_attributes = {'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'], 'aria-grabbed': ['true', 'false', 'undefined']}
|
||||
let relationship_attributes = {'aria-activedescendant': [], 'aria-controls': [], 'aria-describedby': [], 'aria-flowto': [], 'aria-labelledby': [], 'aria-owns': [], 'aria-posinset': [], 'aria-setsize': []}
|
||||
let aria_attributes = widget_attributes
|
||||
" https://www.w3.org/TR/wai-aria-1.1/#states_and_properties
|
||||
let global_states_and_properties = {
|
||||
\ 'aria-atomic': ['true', 'false'],
|
||||
\ 'aria-busy': ['true', 'false'],
|
||||
\ 'aria-controls': [],
|
||||
\ 'aria-current': [],
|
||||
\ 'aria-describedby': [],
|
||||
\ 'aria-disabled': ['true', 'false'],
|
||||
\ 'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'],
|
||||
\ 'aria-errormessage': [],
|
||||
\ 'aria-flowto': [],
|
||||
\ 'aria-grabbed': ['true', 'false', 'undefined'],
|
||||
\ 'aria-haspopup': ['true', 'false'],
|
||||
\ 'aria-hidden': ['true', 'false'],
|
||||
\ 'aria-invalid': ['grammar', 'spelling', 'true', 'false'],
|
||||
\ 'aria-keyshortcuts': [],
|
||||
\ 'aria-label': [],
|
||||
\ 'aria-labelledby': [],
|
||||
\ 'aria-live': ['off', 'polite', 'assertive'],
|
||||
\ 'aria-owns': [],
|
||||
\ 'aria-relevant': ['additions', 'removals', 'text', 'all'],
|
||||
\ 'aria-roledescription': [],
|
||||
\ }
|
||||
|
||||
let widget_attributes = {
|
||||
\ 'aria-autocomplete': ['inline', 'list', 'both', 'none'],
|
||||
\ 'aria-checked': ['true', 'false', 'mixed', 'undefined'],
|
||||
\ 'aria-disabled': ['true', 'false'],
|
||||
\ 'aria-errormessage': [],
|
||||
\ 'aria-expanded': ['true', 'false', 'undefined'],
|
||||
\ 'aria-haspopup': ['true', 'false'],
|
||||
\ 'aria-hidden': ['true', 'false'],
|
||||
\ 'aria-invalid': ['grammar', 'spelling', 'true', 'false'],
|
||||
\ 'aria-label': [],
|
||||
\ 'aria-level': [],
|
||||
\ 'aria-modal': ['true', 'false'],
|
||||
\ 'aria-multiline': ['true', 'false'],
|
||||
\ 'aria-multiselectable': ['true', 'false'],
|
||||
\ 'aria-orientation': ['horizontal', 'vertical'],
|
||||
\ 'aria-placeholder': [],
|
||||
\ 'aria-pressed': ['true', 'false', 'mixed', 'undefined'],
|
||||
\ 'aria-readonly': ['true', 'false'],
|
||||
\ 'aria-required': ['true', 'false'],
|
||||
\ 'aria-selected': ['true', 'false', 'undefined'],
|
||||
\ 'aria-sort': ['ascending', 'descending', 'none', 'other'],
|
||||
\ 'aria-valuemax': [],
|
||||
\ 'aria-valuemin': [],
|
||||
\ 'aria-valuenow': [],
|
||||
\ 'aria-valuetext': []
|
||||
\ }
|
||||
|
||||
let live_region_attributes = {
|
||||
\ 'aria-atomic': ['true', 'false'],
|
||||
\ 'aria-busy': ['true', 'false'],
|
||||
\ 'aria-live': ['off', 'polite', 'assertive'],
|
||||
\ 'aria-relevant': ['additions', 'removals', 'text', 'all', 'additions text']
|
||||
\ }
|
||||
|
||||
let drag_and_drop_attributes = {
|
||||
\ 'aria-dropeffect': ['copy', 'move', 'link', 'execute', 'popup', 'none'],
|
||||
\ 'aria-grabbed': ['true', 'false', 'undefined']
|
||||
\ }
|
||||
|
||||
let relationship_attributes = {
|
||||
\ 'aria-activedescendant': [],
|
||||
\ 'aria-colcount': [],
|
||||
\ 'aria-colindex': [],
|
||||
\ 'aria-colspan': [],
|
||||
\ 'aria-controls': [],
|
||||
\ 'aria-describedby': [],
|
||||
\ 'aria-details': [],
|
||||
\ 'aria-errormessage': [],
|
||||
\ 'aria-flowto': [],
|
||||
\ 'aria-labelledby': [],
|
||||
\ 'aria-owns': [],
|
||||
\ 'aria-posinset': [],
|
||||
\ 'aria-rowcount': [],
|
||||
\ 'aria-rowindex': [],
|
||||
\ 'aria-rowspan': [],
|
||||
\ 'aria-setsize': []
|
||||
\ }
|
||||
|
||||
let aria_attributes = global_states_and_properties
|
||||
let aria_attributes = extend(aria_attributes, widget_attributes)
|
||||
let aria_attributes = extend(aria_attributes, live_region_attributes)
|
||||
let aria_attributes = extend(aria_attributes, drag_and_drop_attributes)
|
||||
let aria_attributes = extend(aria_attributes, relationship_attributes)
|
||||
@@ -84,6 +271,8 @@ let role_attributes['status'] = abstract_role['composite'] + role_attributes['re
|
||||
let role_attributes['tab'] = abstract_role['sectionhead'] + abstract_role['widget'] + ['aria-selected']
|
||||
let role_attributes['tabpanel'] = role_attributes['region']
|
||||
let role_attributes['textbox'] = abstract_role['input'] + ['aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required']
|
||||
let role_attributes['searchbox'] = role_attributes['textbox']
|
||||
let role_attributes['switch'] = role_attributes['checkbox']
|
||||
let role_attributes['timer'] = role_attributes['status']
|
||||
let role_attributes['tooltip'] = abstract_role['section']
|
||||
let role_attributes['treeitem'] = role_attributes['listitem'] + role_attributes['option']
|
||||
@@ -101,16 +290,22 @@ let role_attributes['treegrid'] = role_attributes['grid'] + role_attributes['tre
|
||||
let role_attributes['document'] = abstract_role['structure'] + ['aria-expanded']
|
||||
|
||||
let role_attributes['article'] = role_attributes['document'] + role_attributes['region']
|
||||
let role_attributes['cell'] = abstract_role['section'] + ['aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan']
|
||||
let role_attributes['columnheader'] = role_attributes['gridcell'] + abstract_role['sectionhead'] + ['aria-sort']
|
||||
let role_attributes['definition'] = abstract_role['section']
|
||||
let role_attributes['feed'] = role_attributes['list']
|
||||
let role_attributes['figure'] = abstract_role['section']
|
||||
let role_attributes['heading'] = abstract_role['sectionhead'] + ['aria-level']
|
||||
let role_attributes['img'] = abstract_role['section']
|
||||
let role_attributes['math'] = abstract_role['section']
|
||||
let role_attributes['note'] = abstract_role['section']
|
||||
let role_attributes['presentation'] = abstract_role['structure']
|
||||
let role_attributes['none'] = role_attributes['presentation']
|
||||
let role_attributes['row'] = role_attributes['group'] + ['aria-level', 'aria-selected']
|
||||
let role_attributes['rowheader'] = role_attributes['gridcell'] + abstract_role['sectionhead']
|
||||
let role_attributes['separator'] = abstract_role['structure'] + ['aria-expanded']
|
||||
let role_attributes['table'] = abstract_role['section'] + ['aria-colcount', 'aria-rowcount']
|
||||
let role_attributes['term'] = abstract_role['section']
|
||||
|
||||
" Landmark Roles
|
||||
let role_attributes['application'] = abstract_role['landmark']
|
||||
@@ -126,19 +321,30 @@ let role_attributes['search'] = abstract_role['landmark']
|
||||
let aria_attributes_value = {
|
||||
\ 'aria-autocomplete': ['ID', ''],
|
||||
\ 'aria-checked': ['Token', ''],
|
||||
\ 'aria-colcount': ['Number', ''],
|
||||
\ 'aria-colindex': ['Number', ''],
|
||||
\ 'aria-colspan': ['Number', ''],
|
||||
\ 'aria-disabled': ['true/false', ''],
|
||||
\ 'aria-errormessage': ['ID', ''],
|
||||
\ 'aria-expanded': ['Token', ''],
|
||||
\ 'aria-haspopup': ['true/false', ''],
|
||||
\ 'aria-haspopup': ['Token', ''],
|
||||
\ 'aria-hidden': ['true/false', ''],
|
||||
\ 'aria-invalid': ['Token', ''],
|
||||
\ 'aria-keyshortcuts': ['String', ''],
|
||||
\ 'aria-label': ['String', ''],
|
||||
\ 'aria-level': ['Int', ''],
|
||||
\ 'aria-modal': ['true/false', ''],
|
||||
\ 'aria-multiline': ['true/false', ''],
|
||||
\ 'aria-multiselectable': ['true/false', ''],
|
||||
\ 'aria-orientation': ['Token', ''],
|
||||
\ 'aria-placeholder': ['String', ''],
|
||||
\ 'aria-pressed': ['Token', ''],
|
||||
\ 'aria-readonly': ['true/false', ''],
|
||||
\ 'aria-required': ['true/false', ''],
|
||||
\ 'aria-roledescription': ['String', ''],
|
||||
\ 'aria-rowcount': ['Number', ''],
|
||||
\ 'aria-rowindex': ['Number', ''],
|
||||
\ 'aria-rowspan': ['Number', ''],
|
||||
\ 'aria-selected': ['Token', ''],
|
||||
\ 'aria-sort': ['Token', ''],
|
||||
\ 'aria-valuemax': ['Number', ''],
|
||||
|
||||
@@ -80,6 +80,9 @@ let attributes_value = {
|
||||
\ 'accept-charset': ['Charset', ''],
|
||||
\ 'accesskey': ['Character', ''],
|
||||
\ 'action': ['URL', ''],
|
||||
\ 'allowfullscreen': ['Bool', ''],
|
||||
\ 'allowpaymentrequest': ['Bool', ''],
|
||||
\ 'allowusermedia': ['Bool', ''],
|
||||
\ 'alt': ['Text', ''],
|
||||
\ 'async': ['Bool', ''],
|
||||
\ 'autocomplete': ['*Token', ''],
|
||||
@@ -142,6 +145,7 @@ let attributes_value = {
|
||||
\ 'optimum': ['Number', ''],
|
||||
\ 'pattern': ['Pattern', ''],
|
||||
\ 'placeholder': ['Text', ''],
|
||||
\ 'playsinline': ['Bool', ''],
|
||||
\ 'poster': ['URL', ''],
|
||||
\ 'preload': ['Token', ''],
|
||||
\ 'pubdate': ['Bool', ''],
|
||||
@@ -315,10 +319,10 @@ if !exists('g:html5_aria_attributes_complete')
|
||||
let g:html5_aria_attributes_complete = 1
|
||||
endif
|
||||
if g:html5_aria_attributes_complete == 1
|
||||
" Ref: http://www.w3.org/TR/wai-aria/roles
|
||||
" Version: Draft 15 December 2009
|
||||
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']
|
||||
" Ref: https://www.w3.org/TR/wai-aria-1.1/#role_definitions
|
||||
" Version: W3C Candidate Recommendation 27 October 2016
|
||||
let widget_role = ['alert', 'alertdialog', 'button', 'checkbox', 'combobox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'treeitem', 'combobox', 'grid', 'listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid']
|
||||
let document_structure = ['article', 'cell', 'columnheader', 'definition', 'directory', 'document', 'feed', 'figure', 'group', 'heading', 'img', 'list', 'listitem', 'math', 'none', 'note', 'presentation', 'region', 'row', 'rowheader', 'separator', 'table', 'term']
|
||||
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)
|
||||
@@ -336,14 +340,38 @@ let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command
|
||||
|
||||
let flow_elements = phrasing_elements + ['p', 'hr', 'pre', 'ul', 'ol', 'dl', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup', 'address', 'blockquote', 'ins', 'del', 'element', 'object', 'main', 'map', 'noscript', 'section', 'nav', 'article', 'aside', 'header', 'footer', 'video', 'audio', 'figure', 'table', 'template', 'form', 'fieldset', 'menu', 'canvas', 'details']
|
||||
|
||||
" http://dev.w3.org/html5/spec/Overview.html#linkTypes
|
||||
let linktypes = ['alternate', 'author', 'bookmark', 'external', 'help', 'icon', 'license', 'next', 'nofollow', 'noreferrer', 'pingback', 'prefetch', 'prev', 'search', 'stylesheet', 'sidebar', 'tag']
|
||||
" https://html.spec.whatwg.org/#linkTypes
|
||||
let linktypes = ['alternate', 'author', 'bookmark', 'dns-prefetch', 'external', 'help', 'icon', 'license', 'next', 'nofollow', 'noreferrer', 'noopener', 'pingback', 'preconnect', 'prefetch', 'preload', 'prerender', 'prev', 'search', 'stylesheet', 'tag']
|
||||
" https://w3c.github.io/manifest/
|
||||
let linkreltypes = linktypes
|
||||
let linkreltypes = linkreltypes + ['manifest']
|
||||
" http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
|
||||
let linkreltypes = linktypes + ['canonical', 'import']
|
||||
" http://www.ysearchblog.com/2009/02/12/fighting-duplication-adding-more-arrows-to-your-quiver/
|
||||
" http://blogs.bing.com/webmaster/2009/02/12/partnering-to-help-solve-duplicate-content-issues
|
||||
let linkreltypes = linkreltypes + ['canonical']
|
||||
" http://w3c.github.io/webcomponents/spec/imports/
|
||||
let linkreltypes = linkreltypes + ['import']
|
||||
" https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint
|
||||
let linkreltypes = linkreltypes + ['webmention']
|
||||
" http://www.opensearch.org/Specifications/OpenSearch/1.1#Autodiscovery_in_HTML.2FXHTML
|
||||
let linkreltypes = linkreltypes + ['search']
|
||||
" http://microformats.org/wiki/rel-sitemap
|
||||
let linkreltypes = linkreltypes + ['sitemap']
|
||||
" https://www.ampproject.org/docs/get_started/create/prepare_for_discovery
|
||||
let linkreltypes = linkreltypes + ['amphtml']
|
||||
" https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
|
||||
let linkreltypes = linkreltypes + ['apple-touch-icon', 'apple-touch-icon-precomposed', 'apple-touch-startup-image']
|
||||
" https://developer.chrome.com/webstore/inline_installation
|
||||
let linkreltypes = linkreltypes + ['chrome-webstore-item']
|
||||
" http://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#rfc.section.4
|
||||
let linkreltypes = linkreltypes + ['hub']
|
||||
" https://golem.ph.utexas.edu/~distler/blog/archives/000320.html
|
||||
let linkreltypes = linkreltypes + ['pgpkey']
|
||||
|
||||
" a and button are special elements for interactive, some element can't be its descendent
|
||||
let abutton_dec = 'details\\|embed\\|iframe\\|keygen\\|label\\|menu\\|select\\|textarea'
|
||||
|
||||
let crossorigin = ['anonymous', 'use-credentials']
|
||||
|
||||
|
||||
let g:xmldata_html5 = {
|
||||
@@ -551,11 +579,11 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ 'iframe': [
|
||||
\ [],
|
||||
\ 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']})
|
||||
\ 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'], 'allowfullscreen': [], 'allowpaymentrequest': [], 'allowusermedia': []})
|
||||
\ ],
|
||||
\ 'img': [
|
||||
\ [],
|
||||
\ 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']})
|
||||
\ 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'], 'crossorigin': ['anonymous', 'use-credentials']})
|
||||
\ ],
|
||||
\ 'input': [
|
||||
\ [],
|
||||
@@ -587,7 +615,7 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ 'link': [
|
||||
\ [],
|
||||
\ 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']})
|
||||
\ 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'], 'crossorigin': crossorigin, 'preload': ['preload', ''], 'prefetch': ['prefetch', '']})
|
||||
\ ],
|
||||
\ 'main': [
|
||||
\ flow_elements + ['style'],
|
||||
@@ -695,7 +723,7 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ 'script': [
|
||||
\ [],
|
||||
\ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset, 'nonce': []})
|
||||
\ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset, 'nonce': [], 'crossorigin': crossorigin})
|
||||
\ ],
|
||||
\ 'section': [
|
||||
\ flow_elements + ['style'],
|
||||
@@ -807,7 +835,7 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ 'video': [
|
||||
\ flow_elements + ['source', 'track'],
|
||||
\ extend(copy(global_attributes), {'autoplay': ['autoplay', ''], 'preload': ['none', 'metadata', 'auto', ''], 'controls': ['controls', ''], 'loop': ['loop', ''], 'poster': [], 'height': [], 'width': [], 'src': []})
|
||||
\ extend(copy(global_attributes), {'autoplay': ['autoplay', ''], 'preload': ['none', 'metadata', 'auto', ''], 'controls': ['controls', ''], 'loop': ['loop', ''], 'playsinline': ['playsinline', ''], 'poster': [], 'height': [], 'width': [], 'src': [], 'crossorigin': crossorigin})
|
||||
\ ],
|
||||
\ 'wbr': [
|
||||
\ [],
|
||||
|
||||
47
build
47
build
@@ -2,10 +2,10 @@
|
||||
|
||||
set -E
|
||||
|
||||
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
||||
DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
|
||||
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
|
||||
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
|
||||
DIRS="syntax indent compiler autoload ftplugin after/syntax after/indent after/ftplugin"
|
||||
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
|
||||
DIRS_ALL="syntax indent compiler autoload ftplugin after"
|
||||
DIRS_SYNTAX="syntax after/syntax"
|
||||
DIRS_JAVASCRIPT="${DIRS} extras"
|
||||
DIRS_RM="$DIRS_JAVASCRIPT"
|
||||
|
||||
@@ -29,6 +29,9 @@ download() {
|
||||
|
||||
extract() {
|
||||
printf "\n"
|
||||
|
||||
cat config.vim >> tmp/polyglot.vim
|
||||
|
||||
for pack in $1; do
|
||||
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||
@@ -49,10 +52,21 @@ extract() {
|
||||
fi
|
||||
done
|
||||
|
||||
for f in ${dir}/ftdetect/*; do
|
||||
(
|
||||
echo "augroup filetypedetect";
|
||||
echo '" '"$pack";
|
||||
cat "${f}";
|
||||
echo "augroup END";
|
||||
echo
|
||||
) >> tmp/polyglot.vim;
|
||||
done
|
||||
|
||||
output "${subdirs##, })\n"
|
||||
done
|
||||
|
||||
mv tmp/polyglot.vim ftdetect/
|
||||
|
||||
for pack in $1; do
|
||||
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||
@@ -76,15 +90,6 @@ copy_dir() {
|
||||
done
|
||||
}
|
||||
|
||||
concat_ftdetect() {
|
||||
echo "augroup filetypedetect" > tmp/polyglot.vim
|
||||
cat config.vim >> tmp/polyglot.vim
|
||||
for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done
|
||||
echo "augroup END" >> tmp/polyglot.vim
|
||||
rm -f ftdetect/*
|
||||
mv tmp/polyglot.vim ftdetect/
|
||||
}
|
||||
|
||||
update_readme() {
|
||||
OLD_README="$(cat README.md)"
|
||||
|
||||
@@ -93,7 +98,7 @@ update_readme() {
|
||||
+2kb
|
||||
/##
|
||||
'b,-2c
|
||||
$(printf -- "$OUTPUT")
|
||||
$(printf -- "$OUTPUT" | sort)
|
||||
.
|
||||
w
|
||||
q
|
||||
@@ -102,12 +107,16 @@ EOF
|
||||
}
|
||||
|
||||
PACKS="
|
||||
apiblueprint:sheerun/apiblueprint.vim
|
||||
applescript:vim-scripts/applescript.vim
|
||||
asciidoc:asciidoc/vim-asciidoc
|
||||
yaml:stephpy/vim-yaml
|
||||
ansible:pearofducks/ansible-vim
|
||||
arduino:sudar/vim-arduino-syntax
|
||||
blade:jwalton512/vim-blade
|
||||
c++11:octol/vim-cpp-enhanced-highlight
|
||||
c/c++:vim-jp/vim-cpp
|
||||
caddyfile:joshglendenning/vim-caddyfile
|
||||
cjsx:mtscout6/vim-cjsx
|
||||
clojure:guns/vim-clojure-static
|
||||
coffee-script:kchmck/vim-coffee-script
|
||||
@@ -117,7 +126,7 @@ PACKS="
|
||||
css:JulesWang/css.vim
|
||||
cucumber:tpope/vim-cucumber
|
||||
dart:dart-lang/dart-vim-plugin
|
||||
dockerfile:honza/dockerfile.vim
|
||||
dockerfile:docker/docker::/contrib/syntax/vim/
|
||||
elixir:elixir-lang/vim-elixir
|
||||
elm:lambdatoast/elm.vim
|
||||
emberscript:yalesov/vim-ember-script
|
||||
@@ -126,7 +135,9 @@ PACKS="
|
||||
fish:dag/vim-fish
|
||||
git:tpope/vim-git
|
||||
glsl:tikhomirov/vim-glsl
|
||||
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
||||
go:fatih/vim-go:_BASIC
|
||||
graphql:jparise/vim-graphql
|
||||
groovy:vim-scripts/groovy.vim
|
||||
haml:sheerun/vim-haml
|
||||
handlebars:mustache/vim-mustache-handlebars
|
||||
@@ -148,7 +159,8 @@ PACKS="
|
||||
lua:tbastos/vim-lua
|
||||
mako:sophacles/vim-bundle-mako
|
||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||
nginx:othree/nginx-contrib-vim
|
||||
mathematica:rsmenon/vim-mathematica
|
||||
nginx:chr4/nginx.vim
|
||||
nim:zah/nim.vim:_BASIC
|
||||
nix:spwhitt/vim-nix
|
||||
objc:b4winckler/vim-objc
|
||||
@@ -180,6 +192,7 @@ PACKS="
|
||||
solidity:ethereum/vim-solidity
|
||||
stylus:wavded/vim-stylus
|
||||
swift:keith/swift.vim
|
||||
sxhkd:baskerville/vim-sxhkdrc
|
||||
systemd:kurayama/systemd-vim-syntax
|
||||
terraform:hashivim/vim-terraform
|
||||
textile:timcharper/textile.vim
|
||||
@@ -195,7 +208,6 @@ PACKS="
|
||||
vue:posva/vim-vue
|
||||
vm:lepture/vim-velocity
|
||||
xls:vim-scripts/XSLT-syntax
|
||||
yaml:stephpy/vim-yaml
|
||||
yard:sheerun/vim-yardoc
|
||||
"
|
||||
|
||||
@@ -206,7 +218,6 @@ mkdir tmp
|
||||
printf "Downloading packs..."
|
||||
download "$PACKS"
|
||||
extract "$PACKS"
|
||||
concat_ftdetect
|
||||
update_readme
|
||||
|
||||
rm -rf tmp
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
" Vim compiler plugin
|
||||
" Language: JavaScript
|
||||
" Maintainer: vim-javascript community
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -24,10 +24,10 @@ CompilerSet errorformat=
|
||||
\%D(in\ %f),
|
||||
\%\\s%#from\ %f:%l:%m,
|
||||
\%\\s%#from\ %f:%l:,
|
||||
\%\\s%##\ %f:%l:%m,
|
||||
\%\\s%##\ %f:%l,
|
||||
\%\\s%#[%f:%l:\ %#%m,
|
||||
\%\\s%#%f:%l:\ %#%m,
|
||||
\%\\s%##\ %f:%l:%m%\\&%.%#%\\D:%.%#,
|
||||
\%\\s%##\ %f:%l%\\&%.%#%\\D:%.%#,
|
||||
\%\\s%#[%f:%l:\ %#%m%\\&%.%#%\\D:%.%#,
|
||||
\%\\s%#%f:%l:\ %#%m%\\&%.%#%\\D:%.%#,
|
||||
\%\\s%#%f:%l:,
|
||||
\%m\ [%f:%l]:,
|
||||
\%+Erake\ aborted!,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,8 @@ setlocal comments+=s:{{--,m:\ \ \ \ ,e:--}}
|
||||
if exists('loaded_matchit') && exists('b:match_words')
|
||||
" Append to html matchit words
|
||||
let b:match_words .= ',' .
|
||||
\ '@\%(section\|if\|unless\|foreach\|forelse\|for\|while\|push\|can\|cannot\|hasSection\|php\|verbatim\)\>' .
|
||||
\ '@\%(section\s*([^\,]*)\|if\|unless\|foreach\|forelse\|for\|while\|push\|can\|cannot\|hasSection\|' .
|
||||
\ 'php\s*(\@!\|verbatim\|component\|slot\|prepend\)' .
|
||||
\ ':' .
|
||||
\ '@\%(else\|elseif\|empty\|break\|continue\|elsecan\|elsecannot\)\>' .
|
||||
\ ':' .
|
||||
|
||||
28
ftplugin/caddyfile.vim
Normal file
28
ftplugin/caddyfile.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'caddyfile') == -1
|
||||
|
||||
" Language: Caddyfile
|
||||
" Author: Josh Glendenning <josh@isobit.io>
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
" Add NERDCommenter delimiters
|
||||
let s:delimiters = {'left': '#'}
|
||||
if exists('g:NERDDelimiterMap')
|
||||
if !has_key(g:NERDDelimiterMap, 'caddyfile')
|
||||
let g:NERDDelimiterMap.caddyfile = s:delimiters
|
||||
endif
|
||||
elseif exists('g:NERDCustomDelimiters')
|
||||
if !has_key(g:NERDCustomDelimiters, 'caddyfile')
|
||||
let g:NERDDelimiterMap.caddyfile = s:delimiters
|
||||
endif
|
||||
else
|
||||
let g:NERDCustomDelimiters = {'caddyfile': s:delimiters}
|
||||
endif
|
||||
unlet s:delimiters
|
||||
|
||||
endif
|
||||
@@ -25,7 +25,9 @@ let &l:errorformat =
|
||||
\ '%m'
|
||||
\ ], ',')
|
||||
|
||||
setlocal includeexpr=dart#resolveUri(v:fname)
|
||||
setlocal isfname+=:
|
||||
|
||||
let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms<'
|
||||
let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms< inex< isf<'
|
||||
|
||||
endif
|
||||
|
||||
@@ -16,7 +16,7 @@ if !exists("g:eelixir_default_subtype")
|
||||
endif
|
||||
|
||||
if !exists("b:eelixir_subtype")
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let s:lines = join(getline(1, 5) + [getline('$')], "\n")
|
||||
let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
|
||||
if b:eelixir_subtype == ''
|
||||
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
||||
@@ -100,7 +100,7 @@ endif
|
||||
setlocal comments=:<%#
|
||||
setlocal commentstring=<%#\ %s\ %>
|
||||
|
||||
let b:undo_ftplugin = "setl cms< "
|
||||
let b:undo_ftplugin = "setl cms< " .
|
||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
@@ -17,45 +17,24 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
||||
\ ',{:},\[:\],(:)'
|
||||
endif
|
||||
|
||||
setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,?
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
function! GetElixirFilename(word)
|
||||
let word = a:word
|
||||
|
||||
" get first thing that starts uppercase, until the first space or end of line
|
||||
let word = substitute(word,'^\s*\(\u[^ ]\+\).*$','\1','g')
|
||||
|
||||
" remove any trailing characters that don't look like a nested module
|
||||
let word = substitute(word,'\.\U.*$','','g')
|
||||
|
||||
" replace module dots with slash
|
||||
let word = substitute(word,'\.','/','g')
|
||||
|
||||
" remove any special chars
|
||||
let word = substitute(word,'[^A-z0-9-_/]','','g')
|
||||
|
||||
" convert to snake_case
|
||||
let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g')
|
||||
let word = substitute(word,'\(\u\+\)\(\u\l\)','\1_\2','g')
|
||||
let word = substitute(word,'\(\l\|\d\)\(\u\)','\1_\2','g')
|
||||
let word = substitute(word,'-','_','g')
|
||||
let word = tolower(word)
|
||||
|
||||
return word
|
||||
endfunction
|
||||
|
||||
let &l:path =
|
||||
\ join([
|
||||
\ getcwd().'/lib',
|
||||
\ getcwd().'/src',
|
||||
\ getcwd().'/deps/**/lib',
|
||||
\ getcwd().'/deps/**/src',
|
||||
\ 'lib',
|
||||
\ 'src',
|
||||
\ 'deps/**/lib',
|
||||
\ 'deps/**/src',
|
||||
\ &g:path
|
||||
\ ], ',')
|
||||
setlocal includeexpr=GetElixirFilename(v:fname)
|
||||
setlocal includeexpr=elixir#util#get_filename(v:fname)
|
||||
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
|
||||
|
||||
silent! setlocal formatoptions-=t formatoptions+=croqlj
|
||||
|
||||
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< '.
|
||||
\ '| unlet! b:match_ignorecase b:match_words'
|
||||
|
||||
endif
|
||||
|
||||
17
ftplugin/graphql.vim
Normal file
17
ftplugin/graphql.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal formatoptions-=t
|
||||
setlocal iskeyword+=$,@-@
|
||||
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
setlocal suffixesadd+=.vue
|
||||
runtime ftplugin/coffee.vim
|
||||
|
||||
endif
|
||||
63
ftplugin/mma.vim
Normal file
63
ftplugin/mma.vim
Normal file
@@ -0,0 +1,63 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||
|
||||
"Vim filetype plugin
|
||||
" Language: Mathematica
|
||||
" Maintainer: R. Menon <rsmenon@icloud.com>
|
||||
" Last Change: Feb 26, 2013
|
||||
|
||||
" Initialization {
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
"}
|
||||
|
||||
" Syntax completion function {
|
||||
if exists('&ofu')
|
||||
setlocal omnifunc=syntaxcomplete#Complete
|
||||
setlocal completefunc=syntaxcomplete#Complete
|
||||
endif
|
||||
"}
|
||||
|
||||
" Main functions {
|
||||
if has('python')
|
||||
" Random ID generator {
|
||||
function! RandomID()
|
||||
|
||||
"Python implementation follows; do not alter indentations/whitespace
|
||||
python << EOF
|
||||
import random, string, vim
|
||||
vim.command("let l:id = '" + (''.join(random.sample(string.ascii_uppercase + string.digits, 8))) + "'")
|
||||
EOF
|
||||
|
||||
return l:id
|
||||
endfunction
|
||||
"}
|
||||
|
||||
"Unit test template {
|
||||
function! Test()
|
||||
if exists("*strftime")
|
||||
let l:date = strftime("%Y%m%d") . "-"
|
||||
else
|
||||
let l:date = ""
|
||||
endif
|
||||
|
||||
let l:testid = expand("%:t") . "-" . l:date . RandomID()
|
||||
let l:template = "Test[\rtest\r,\rresult\r,\rTestID -> \"" . l:testid . "\"\r\b]"
|
||||
exe ":normal i" . l:template
|
||||
endfunction
|
||||
"}
|
||||
endif
|
||||
"}
|
||||
|
||||
" Cleanup {
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
"}
|
||||
|
||||
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker:
|
||||
|
||||
endif
|
||||
@@ -1,22 +1,17 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
|
||||
|
||||
" Vim plugin file
|
||||
" Language: PlantUML
|
||||
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
|
||||
" Version: 0.1
|
||||
|
||||
if exists("b:loaded_plantuml_plugin")
|
||||
if exists('b:loaded_plantuml_plugin')
|
||||
finish
|
||||
endif
|
||||
let b:loaded_plantuml_plugin = 1
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("g:plantuml_executable_script")
|
||||
let g:plantuml_executable_script="plantuml"
|
||||
if !exists('g:plantuml_executable_script')
|
||||
let g:plantuml_executable_script='plantuml'
|
||||
endif
|
||||
|
||||
if exists("loaded_matchit")
|
||||
if exists('loaded_matchit')
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words =
|
||||
\ '\(\<ref\>\|\<box\>\|\<opt\>\|\<alt\>\|\<group\>\|\<loop\>\|\<note\>\|\<legend\>\):\<else\>:\<end\>' .
|
||||
@@ -27,7 +22,7 @@ if exists("loaded_matchit")
|
||||
\ ',\<\while\>:\<endwhile\>'
|
||||
endif
|
||||
|
||||
let &l:makeprg=g:plantuml_executable_script . " " . fnameescape(expand("%"))
|
||||
let &l:makeprg=g:plantuml_executable_script . ' ' . fnameescape(expand('%'))
|
||||
|
||||
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ setlocal formatoptions=tcqro
|
||||
" Enable autocompletion of hyphenated PowerShell commands,
|
||||
" e.g. Get-Content or Get-ADUser
|
||||
setlocal iskeyword+=-
|
||||
" MS applications (including PowerShell) require a Byte Order Mark (BOM) for UTF-8.
|
||||
setlocal bomb
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
|
||||
@@ -16,6 +16,8 @@ let b:did_ftplugin = 1
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
" MS applications (including PowerShell) require a Byte Order Mark (BOM) for UTF-8.
|
||||
setlocal bomb
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
|
||||
@@ -71,7 +71,7 @@ endif
|
||||
|
||||
function! s:query_path(root) abort
|
||||
let code = "print $:.join %q{,}"
|
||||
if &shell =~# 'sh'
|
||||
if &shell =~# 'sh' && empty(&shellxquote)
|
||||
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||
else
|
||||
let prefix = ''
|
||||
@@ -164,23 +164,23 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
nmap <buffer><script> <SID>: :<C-U>
|
||||
nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR>
|
||||
|
||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','n')<CR>
|
||||
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','','n')<CR>
|
||||
xnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','','v')<CR>
|
||||
xnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','','v')<CR>
|
||||
nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','n')<CR>
|
||||
nnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'','n')<CR>
|
||||
xnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','v')<CR>
|
||||
xnoremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>',['rubyDefine'],'','v')<CR>
|
||||
|
||||
nnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','','n')<CR>
|
||||
nnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','b','n')<CR>
|
||||
nnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','','n')<CR>
|
||||
xnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','','v')<CR>
|
||||
xnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','b','v')<CR>
|
||||
xnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','','v')<CR>
|
||||
nnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'b','n')<CR>
|
||||
nnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'','n')<CR>
|
||||
nnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'b','n')<CR>
|
||||
nnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'','n')<CR>
|
||||
xnoremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'b','v')<CR>
|
||||
xnoremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>',['rubyModule','rubyClass'],'','v')<CR>
|
||||
xnoremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'b','v')<CR>
|
||||
xnoremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>',['rubyModule','rubyClass'],'','v')<CR>
|
||||
|
||||
let b:undo_ftplugin = b:undo_ftplugin
|
||||
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
||||
@@ -290,12 +290,13 @@ function! s:searchsyn(pattern, syn, flags, mode) abort
|
||||
norm! gv
|
||||
endif
|
||||
let i = 0
|
||||
call map(a:syn, 'hlID(v:val)')
|
||||
while i < cnt
|
||||
let i = i + 1
|
||||
let line = line('.')
|
||||
let col = col('.')
|
||||
let pos = search(a:pattern,'W'.a:flags)
|
||||
while pos != 0 && s:synname() !~# a:syn
|
||||
while pos != 0 && index(a:syn, s:synid()) < 0
|
||||
let pos = search(a:pattern,'W'.a:flags)
|
||||
endwhile
|
||||
if pos == 0
|
||||
@@ -305,8 +306,8 @@ function! s:searchsyn(pattern, syn, flags, mode) abort
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
function! s:synname() abort
|
||||
return synIDattr(synID(line('.'),col('.'),0),'name')
|
||||
function! s:synid() abort
|
||||
return synID(line('.'),col('.'),0)
|
||||
endfunction
|
||||
|
||||
function! s:wrap_i(back,forward) abort
|
||||
@@ -362,7 +363,7 @@ function! RubyCursorFile() abort
|
||||
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
||||
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
||||
let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
|
||||
if s:synname() ==# 'rubyConstant'
|
||||
if s:synid() ==# hlID('rubyConstant')
|
||||
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
|
||||
let cfile = substitute(cfile,'::','/','g')
|
||||
let cfile = substitute(cfile,'\(\u\+\)\(\u\l\)','\1_\2', 'g')
|
||||
|
||||
@@ -11,4 +11,13 @@ endif
|
||||
|
||||
runtime! ftplugin/html.vim
|
||||
|
||||
setlocal suffixesadd+=.vue
|
||||
|
||||
if exists('g:loaded_ale')
|
||||
let g:ale_linters = get(g:, 'ale_linters', {})
|
||||
let g:ale_linters.vue = get(g:ale_linters, 'vue', ['eslint'])
|
||||
let g:ale_linter_aliases = get(g:, 'ale_linter_aliases', {})
|
||||
let g:ale_linter_aliases.vue = get(g:ale_linter_aliases, 'vue', 'javascript')
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -27,7 +27,12 @@ endif
|
||||
|
||||
function GetAnsibleIndent(lnum)
|
||||
if a:lnum == 1 || !prevnonblank(a:lnum-1)
|
||||
return 0
|
||||
endif
|
||||
if exists("g:ansible_unindent_after_newline")
|
||||
if (a:lnum -1) != prevnonblank(a:lnum - 1)
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
let prevlnum = prevnonblank(a:lnum - 1)
|
||||
let maintain = indent(prevlnum)
|
||||
|
||||
@@ -4,22 +4,22 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
||||
" Language: Blade (Laravel)
|
||||
" Maintainer: Jason Walton <jwalton512@gmail.com>
|
||||
|
||||
if exists("b:did_indent")
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/html.vim
|
||||
let s:htmlindent = &indentexpr
|
||||
unlet! b:did_indent
|
||||
|
||||
unlet! b:did_indent
|
||||
runtime! indent/php.vim
|
||||
let s:phpindent = &indentexpr
|
||||
unlet! b:did_indent
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
" Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'.
|
||||
let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim'
|
||||
let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim\|php\|' .
|
||||
\ 'component\|slot\|prepend'
|
||||
let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite'
|
||||
|
||||
if exists('g:blade_custom_directives_pairs')
|
||||
@@ -29,55 +29,71 @@ endif
|
||||
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=GetBladeIndent()
|
||||
exe "setlocal indentkeys=o,O,<>>,!^F,0=}},0=!!},=@" . substitute(s:directives_end, '\\|', ',=@', 'g')
|
||||
exe 'setlocal indentkeys=o,O,<>>,!^F,0=}},0=!!},=@' . substitute(s:directives_end, '\\|', ',=@', 'g')
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetBladeIndent")
|
||||
if exists('*GetBladeIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! s:IsStartingDelimiter(lnum)
|
||||
let line = getline(a:lnum)
|
||||
return line =~# '\%(\w\|@\)\@<!@\%(' . s:directives_start . '\)\%(.*@end\|.*@stop\)\@!'
|
||||
\ || line =~# '{{\%(.*}}\)\@!'
|
||||
\ || line =~# '{!!\%(.*!!}\)\@!'
|
||||
\ || line =~# '<?\%(.*?>\)\@!'
|
||||
endfunction
|
||||
|
||||
function! GetBladeIndent()
|
||||
let lnum = prevnonblank(v:lnum-1)
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||
let line = getline(lnum)
|
||||
let cline = getline(v:lnum)
|
||||
let indent = indent(lnum)
|
||||
if cline =~# '@\%(' . s:directives_end . '\)' ||
|
||||
\ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
|
||||
let indent = indent - &sw
|
||||
elseif line =~# '<?\%(.*?>\)\@!\|@php\%(\s*(\)\@!'
|
||||
let indent = indent + &sw
|
||||
else
|
||||
if exists("*GetBladeIndentCustom")
|
||||
let hindent = GetBladeIndentCustom()
|
||||
" Don't use PHP indentation if line is a comment
|
||||
elseif line !~# '^\s*\%(#\|//\)\|\*/\s*$' && (
|
||||
\ searchpair('@include\%(If\)\?\s*(', '', ')', 'bWr') ||
|
||||
\ searchpair('{!!', '', '!!}', 'bWr') ||
|
||||
\ searchpair('{{', '', '}}', 'bWr') ||
|
||||
\ searchpair('<?', '', '?>', 'bWr') ||
|
||||
\ searchpair('@php\%(\s*(\)\@!', '', '@endphp', 'bWr') )
|
||||
execute 'let hindent = ' . s:phpindent
|
||||
else
|
||||
execute 'let hindent = ' . s:htmlindent
|
||||
endif
|
||||
if hindent > -1
|
||||
let indent = hindent
|
||||
endif
|
||||
endif
|
||||
let increase = indent + &sw
|
||||
|
||||
if line =~# '@\%(section\)\%(.*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
|
||||
return indent
|
||||
elseif line =~# '@\%(' . s:directives_start . '\)\%(.*@end\|.*@stop\)\@!' ||
|
||||
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
|
||||
return increase
|
||||
else
|
||||
" 1. Check for special directives
|
||||
" @section is a single-line directive if it has a second argument.
|
||||
" @php is a single-line directive if it is followed by parentheses.
|
||||
if (line =~# '@section\%(.*@end\)\@!' && line !~# '@section\s*([^,]*)')
|
||||
\ || line =~# '@php\s*('
|
||||
return indent
|
||||
endif
|
||||
|
||||
" 2. When the current line is an ending delimiter: decrease indentation
|
||||
" if the previous line wasn't a starting delimiter.
|
||||
if cline =~# '^\s*@\%(' . s:directives_end . '\)'
|
||||
\ || cline =~# '\%(<?.*\)\@<!?>'
|
||||
\ || cline =~# '\%({{.*\)\@<!}}'
|
||||
\ || cline =~# '\%({!!.*\)\@<!!!}'
|
||||
return s:IsStartingDelimiter(lnum) ? indent : indent - &sw
|
||||
endif
|
||||
|
||||
" 3. Increase indentation if the line contains a starting delimiter.
|
||||
if s:IsStartingDelimiter(lnum)
|
||||
return indent + &sw
|
||||
endif
|
||||
|
||||
" 4. External indent scripts (PHP and HTML)
|
||||
execute 'let indent = ' . s:htmlindent
|
||||
|
||||
if exists('*GetBladeIndentCustom')
|
||||
let indent = GetBladeIndentCustom()
|
||||
elseif line !~# '^\s*\%(#\|//\)\|\*/\s*$' && (
|
||||
\ searchpair('@include\%(If\)\?\s*(', '', ')', 'bWr') ||
|
||||
\ searchpair('{!!', '', '!!}', 'bWr') ||
|
||||
\ searchpair('{{', '', '}}', 'bWr') ||
|
||||
\ searchpair('<?', '', '?>', 'bWr') ||
|
||||
\ searchpair('@php\s*(\@!', '', '@endphp', 'bWr') )
|
||||
" Only use PHP's indent if the region spans multiple lines
|
||||
if !s:IsStartingDelimiter(v:lnum)
|
||||
execute 'let indent = ' . s:phpindent
|
||||
endif
|
||||
endif
|
||||
|
||||
return indent
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
46
indent/caddyfile.vim
Normal file
46
indent/caddyfile.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'caddyfile') == -1
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=GetCaddyfileIndent(v:lnum)
|
||||
setlocal indentkeys+=<:>,0=},0=)
|
||||
" setlocal cindent
|
||||
|
||||
if exists('*shiftwidth')
|
||||
func s:sw()
|
||||
return shiftwidth()
|
||||
endfunc
|
||||
else
|
||||
func s:sw()
|
||||
return &sw
|
||||
endfunc
|
||||
endif
|
||||
|
||||
function! GetCaddyfileIndent(lnum)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let thisl = substitute(getline(a:lnum), '#.*$', '', '')
|
||||
let prevl = substitute(getline(prevlnum), '#.*$', '', '')
|
||||
|
||||
let ind = indent(prevlnum)
|
||||
|
||||
if prevl =~ '{\s*$'
|
||||
let ind += s:sw()
|
||||
endif
|
||||
|
||||
if thisl =~ '^\s*}\s*$'
|
||||
let ind -= s:sw()
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -1,97 +1,48 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
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
|
||||
|
||||
if exists("b:did_indent") || exists("*elixir#indent")
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
end
|
||||
let b:did_indent = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
setlocal indentexpr=elixir#indent(v:lnum)
|
||||
|
||||
function! elixir#indent()
|
||||
" initiates the `old_ind` dictionary
|
||||
let b:old_ind = get(b:, 'old_ind', {})
|
||||
" initiates the `line` dictionary
|
||||
let line = s:build_line(v:lnum)
|
||||
setlocal indentkeys+=0=end,0=catch,0=rescue,0=after,0=else,=->,0},0],0),0=\|>,0=<>
|
||||
" TODO: @jbodah 2017-02-27: all operators should cause reindent when typed
|
||||
|
||||
if s:is_beginning_of_file(line)
|
||||
" Reset `old_ind` dictionary at the beginning of the file
|
||||
let b:old_ind = {}
|
||||
" At the start of the file use zero indent.
|
||||
return 0
|
||||
elseif !s:is_indentable_line(line)
|
||||
" Keep last line indentation if the current line does not have an
|
||||
" indentable syntax
|
||||
return indent(line.last_non_blank.num)
|
||||
else
|
||||
" Calculates the indenation level based on the rules
|
||||
" All the rules are defined in `autoload/elixir/indent.vim`
|
||||
let ind = indent(line.last_non_blank.num)
|
||||
call s:debug('>>> line = ' . string(line.current))
|
||||
call s:debug('>>> ind = ' . ind)
|
||||
let ind = s:indent('deindent_case_arrow', ind, line)
|
||||
let ind = s:indent('indent_parenthesis', ind, line)
|
||||
let ind = s:indent('indent_square_brackets', ind, line)
|
||||
let ind = s:indent('indent_brackets', ind, line)
|
||||
let ind = s:indent('deindent_opened_symbols', ind, line)
|
||||
let ind = s:indent('indent_pipeline_assignment', ind, line)
|
||||
let ind = s:indent('indent_pipeline_continuation', ind, line)
|
||||
let ind = s:indent('indent_after_pipeline', ind, line)
|
||||
let ind = s:indent('indent_assignment', ind, line)
|
||||
let ind = s:indent('indent_ending_symbols', ind, line)
|
||||
let ind = s:indent('indent_keywords', ind, line)
|
||||
let ind = s:indent('deindent_keywords', ind, line)
|
||||
let ind = s:indent('deindent_ending_symbols', ind, line)
|
||||
let ind = s:indent('indent_case_arrow', ind, line)
|
||||
let ind = s:indent('indent_ecto_queries', ind, line)
|
||||
call s:debug('<<< final = ' . ind)
|
||||
return ind
|
||||
end
|
||||
function! elixir#indent(lnum)
|
||||
let lnum = a:lnum
|
||||
let text = getline(lnum)
|
||||
let prev_nb_lnum = prevnonblank(lnum-1)
|
||||
let prev_nb_text = getline(prev_nb_lnum)
|
||||
|
||||
call elixir#indent#debug("==> Indenting line " . lnum)
|
||||
call elixir#indent#debug("text = '" . text . "'")
|
||||
|
||||
let handlers = [
|
||||
\'top_of_file',
|
||||
\'starts_with_end',
|
||||
\'starts_with_mid_or_end_block_keyword',
|
||||
\'following_trailing_do',
|
||||
\'following_trailing_binary_operator',
|
||||
\'starts_with_pipe',
|
||||
\'starts_with_close_bracket',
|
||||
\'starts_with_binary_operator',
|
||||
\'inside_nested_construct',
|
||||
\'starts_with_comment',
|
||||
\'inside_generic_block'
|
||||
\]
|
||||
for handler in handlers
|
||||
call elixir#indent#debug('testing handler elixir#indent#handle_'.handler)
|
||||
let indent = function('elixir#indent#handle_'.handler)(lnum, text, prev_nb_lnum, prev_nb_text)
|
||||
if indent != -1
|
||||
call elixir#indent#debug('line '.lnum.': elixir#indent#handle_'.handler.' returned '.indent)
|
||||
return indent
|
||||
endif
|
||||
endfor
|
||||
|
||||
call elixir#indent#debug("defaulting")
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
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
|
||||
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
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
|
||||
@@ -6,9 +6,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
||||
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
||||
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Last Update: 2013-Jul-21
|
||||
" Last Update: 2017-Feb-28
|
||||
" License: Vim license
|
||||
" URL: https://github.com/hcs42/vim-erlang
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
" Note About Usage:
|
||||
" This indentation script works best with the Erlang syntax file created by
|
||||
@@ -528,7 +528,9 @@ endfunction
|
||||
" ok. % IsLineAtomContinuation = false
|
||||
function! s:IsLineAtomContinuation(lnum)
|
||||
if has('syntax_items')
|
||||
return synIDattr(synID(a:lnum, 1, 0), 'name') =~# '^erlangQuotedAtom'
|
||||
let syn_name = synIDattr(synID(a:lnum, 1, 0), 'name')
|
||||
return syn_name =~# '^erlangQuotedAtom' ||
|
||||
\ syn_name =~# '^erlangQuotedRecord'
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
@@ -682,7 +684,7 @@ function! s:BeginningOfClauseFound(stack, token, stored_vcol, lnum, i)
|
||||
call s:Pop(a:stack)
|
||||
if empty(a:stack)
|
||||
call s:Log(' Stack is ["when"], so LTI is in a guard -> return')
|
||||
return [1, a:stored_vcol + &sw + 2]
|
||||
return [1, a:stored_vcol + shiftwidth() + 2]
|
||||
else
|
||||
return [1, s:UnexpectedToken(a:token, a:stack)]
|
||||
endif
|
||||
@@ -691,7 +693,7 @@ function! s:BeginningOfClauseFound(stack, token, stored_vcol, lnum, i)
|
||||
call s:Pop(a:stack)
|
||||
if empty(a:stack)
|
||||
call s:Log(' Stack is ["->"], so LTI is in function body -> return')
|
||||
return [1, a:stored_vcol + &sw]
|
||||
return [1, a:stored_vcol + shiftwidth()]
|
||||
elseif a:stack[0] ==# ';'
|
||||
call s:Pop(a:stack)
|
||||
|
||||
@@ -843,7 +845,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
|
||||
elseif token ==# 'begin'
|
||||
let [ret, res] = s:BeginElementFound(stack, token, curr_vcol,
|
||||
\stored_vcol, 'end', &sw)
|
||||
\stored_vcol, 'end', shiftwidth())
|
||||
if ret | return res | endif
|
||||
|
||||
" case EXPR of BRANCHES end
|
||||
@@ -894,11 +896,11 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
elseif stack == ['->']
|
||||
call s:Log(' LTI is in a branch after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
return stored_vcol + &sw
|
||||
return stored_vcol + shiftwidth()
|
||||
elseif stack == ['when']
|
||||
call s:Log(' LTI is in a guard after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
return stored_vcol + &sw
|
||||
return stored_vcol + shiftwidth()
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
endif
|
||||
@@ -934,7 +936,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
if empty(stack)
|
||||
call s:Log(' LTI is in a condition; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
let stored_vcol = curr_vcol + &sw
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# 'align_to_begin_element'
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol
|
||||
@@ -943,23 +945,23 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
\'"case/if/try/receive" found')
|
||||
call s:Pop(stack)
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + &sw
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# '->'
|
||||
call s:Log(' LTI is in a branch; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * &sw
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth()
|
||||
elseif stack[0] ==# 'when'
|
||||
call s:Log(' LTI is in a guard; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * &sw + 2
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth() + 2
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
let [ret, res] = s:BeginElementFound(stack, token, curr_vcol,
|
||||
\stored_vcol, 'end', &sw)
|
||||
\stored_vcol, 'end', shiftwidth())
|
||||
if ret | return res | endif
|
||||
|
||||
elseif token ==# 'fun'
|
||||
@@ -985,7 +987,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" stack = ['when'] => LTI is in a guard
|
||||
if empty(stack)
|
||||
call s:Log(' LTI is in a condition; matching "fun" found')
|
||||
let stored_vcol = curr_vcol + &sw
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';'
|
||||
call s:Log(' LTI is in a condition; matching "fun" found')
|
||||
call s:Pop(stack)
|
||||
@@ -993,15 +995,15 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
elseif stack[0] ==# '->'
|
||||
call s:Log(' LTI is in a branch; matching "fun" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * &sw
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth()
|
||||
elseif stack[0] ==# 'when'
|
||||
call s:Log(' LTI is in a guard; matching "fun" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * &sw + 2
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth() + 2
|
||||
endif
|
||||
|
||||
let [ret, res] = s:BeginElementFound(stack, token, curr_vcol,
|
||||
\stored_vcol, 'end', &sw)
|
||||
\stored_vcol, 'end', shiftwidth())
|
||||
if ret | return res | endif
|
||||
else
|
||||
" Pass: we have a function reference (e.g. "fun f/0")
|
||||
@@ -1275,7 +1277,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" when A,
|
||||
" LTI
|
||||
let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol,
|
||||
\stored_vcol, &sw)
|
||||
\stored_vcol, shiftwidth())
|
||||
if ret | return res | endif
|
||||
else
|
||||
" Example:
|
||||
@@ -1307,7 +1309,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" If LTI is between an 'after' and the corresponding
|
||||
" 'end', then let's return
|
||||
let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol,
|
||||
\stored_vcol, &sw)
|
||||
\stored_vcol, shiftwidth())
|
||||
if ret | return res | endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ function! GetErubyIndent(...)
|
||||
let ind = ind + sw
|
||||
endif
|
||||
if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
|
||||
\ && synID(v:lnum, match(cline, '\S') + 1, 1) != hlID('htmlEndTag')
|
||||
let ind = ind - sw
|
||||
endif
|
||||
if cline =~# '^\s*[-=]\=%>\s*$'
|
||||
|
||||
@@ -13,12 +13,12 @@ if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
if !exists('g:haskell_indent_disable')
|
||||
let g:haskell_indent_disable = 0
|
||||
if get(g:, 'haskell_indent_disable', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
if !exists('g:haskell_indent_if')
|
||||
" if x
|
||||
" >>>then ...
|
||||
@@ -63,22 +63,16 @@ if !exists('g:haskell_indent_guard')
|
||||
let g:haskell_indent_guard = 2
|
||||
endif
|
||||
|
||||
if exists("g:haskell_indent_disable") && g:haskell_indent_disable == 0
|
||||
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
|
||||
setlocal indentexpr=GetHaskellIndent()
|
||||
setlocal indentkeys=0},0),0],!^F,o,O,0=where,0=let,0=deriving,<space>
|
||||
|
||||
function! s:isInBlock(hlstack)
|
||||
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
|
||||
return index(a:hlstack, 'haskellDelimiter') > -1 || 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
|
||||
function! s:stripComment(line)
|
||||
if a:line =~ '^\s*--\(-*\s\+\|$\)'
|
||||
return ''
|
||||
else
|
||||
let l:stripped = split(a:line, '-- ')
|
||||
if len(l:stripped) > 1
|
||||
@@ -144,7 +138,7 @@ function! GetHaskellIndent()
|
||||
return -1
|
||||
endif
|
||||
|
||||
let l:prevline = s:stripTrailingComment(getline(v:lnum - 1))
|
||||
let l:prevline = s:stripComment(getline(v:lnum - 1))
|
||||
let l:line = getline(v:lnum)
|
||||
|
||||
" indent multiline strings
|
||||
@@ -161,14 +155,6 @@ function! GetHaskellIndent()
|
||||
return 0
|
||||
endif
|
||||
|
||||
" comment indentation
|
||||
if l:line =~ '^\s*--'
|
||||
return match(l:prevline, '-- ')
|
||||
endif
|
||||
if l:prevline =~ '^\s*--'
|
||||
return match(l:prevline, '\S')
|
||||
endif
|
||||
|
||||
" { foo :: Int
|
||||
" >>,
|
||||
"
|
||||
@@ -176,7 +162,7 @@ function! GetHaskellIndent()
|
||||
" ...
|
||||
" >>,
|
||||
if l:line =~ '^\s*,'
|
||||
if s:isInBlock(l:hlstack)
|
||||
if s:isInBlock(s:getHLStack(line('.'), col('.')))
|
||||
normal! 0
|
||||
call search(',', 'cW')
|
||||
let l:n = s:getNesting(s:getHLStack(line('.'), col('.')))
|
||||
@@ -259,12 +245,16 @@ function! GetHaskellIndent()
|
||||
" where
|
||||
" >>foo
|
||||
"
|
||||
if l:prevline =~ '\C\<where\>\s*$'
|
||||
return match(l:prevline, '\S') + get(g:, 'haskell_indent_after_bare_where', &shiftwidth)
|
||||
endif
|
||||
|
||||
" do
|
||||
" >>foo
|
||||
"
|
||||
" foo =
|
||||
" >>bar
|
||||
if l:prevline =~ '\C\(\<where\>\|\<do\>\|=\)\s*$'
|
||||
if l:prevline =~ '\C\(\<do\>\|=\)\s*$'
|
||||
return match(l:prevline, '\S') + &shiftwidth
|
||||
endif
|
||||
|
||||
@@ -280,7 +270,7 @@ function! GetHaskellIndent()
|
||||
" case foo of
|
||||
" >>bar -> quux
|
||||
if l:prevline =~ '\C\<case\>.\+\<of\>\s*$'
|
||||
if exists('g:haskell_indent_case_alternative') && g:haskell_indent_case_alternative
|
||||
if get(g:,'haskell_indent_case_alternative', 0)
|
||||
return match(l:prevline, '\S') + &shiftwidth
|
||||
else
|
||||
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
|
||||
@@ -320,6 +310,14 @@ function! GetHaskellIndent()
|
||||
endif
|
||||
endif
|
||||
|
||||
" foo :: Int
|
||||
" -> Int
|
||||
" >>>>-> Int
|
||||
"
|
||||
" foo :: Monad m
|
||||
" => Functor f
|
||||
" >>>>=> Int
|
||||
"
|
||||
" foo :: Int
|
||||
" -> Int
|
||||
" foo x
|
||||
@@ -328,32 +326,36 @@ function! GetHaskellIndent()
|
||||
" :: Int
|
||||
" -> Int
|
||||
" foo x
|
||||
if l:prevline =~ '^\s*[-=]>' && l:line !~ '^\s*[-=]>'
|
||||
if s:isInBlock(l:hlstack)
|
||||
return match(l:prevline, '[^\s-=>]')
|
||||
if l:prevline =~ '^\s*[-=]>'
|
||||
if l:line =~ '^\s*[-=]>'
|
||||
return match(l:prevline, '[-=]')
|
||||
else
|
||||
let l:m = matchstr(l:line, '^\s*\zs\<\S\+\>\ze')
|
||||
let l:l = l:prevline
|
||||
let l:c = 1
|
||||
if s:isInBlock(l:hlstack)
|
||||
return match(l:prevline, '[^-=]')
|
||||
else
|
||||
let l:m = matchstr(l:line, '^\s*\zs\<\S\+\>\ze')
|
||||
let l:l = l:prevline
|
||||
let l:c = 1
|
||||
|
||||
while v:lnum != l:c
|
||||
" fun decl
|
||||
if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)')
|
||||
let l:s = match(l:l, l:m)
|
||||
if match(l:l, '\C^\s*\<default\>') > -1
|
||||
return l:s - 8
|
||||
else
|
||||
return l:s
|
||||
while v:lnum != l:c
|
||||
" fun decl
|
||||
if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)')
|
||||
let l:s = match(l:l, l:m)
|
||||
if match(l:l, '\C^\s*\<default\>') > -1
|
||||
return l:s - 8
|
||||
else
|
||||
return l:s
|
||||
endif
|
||||
" empty line, stop looking
|
||||
elseif l:l =~ '^$'
|
||||
return 0
|
||||
endif
|
||||
" empty line, stop looking
|
||||
elseif l:l =~ '^$'
|
||||
return 0
|
||||
endif
|
||||
let l:c += 1
|
||||
let l:l = getline(v:lnum - l:c)
|
||||
endwhile
|
||||
let l:c += 1
|
||||
let l:l = getline(v:lnum - l:c)
|
||||
endwhile
|
||||
|
||||
return 0
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -395,7 +397,7 @@ function! GetHaskellIndent()
|
||||
|
||||
" foo
|
||||
" >>{
|
||||
if l:line =~ '^\s*{' && l:prevline !~ '^{'
|
||||
if l:line =~ '^\s*{ '
|
||||
let l:s = match(l:prevline, '\S')
|
||||
if l:s >= 0
|
||||
return l:s + &shiftwidth
|
||||
@@ -404,12 +406,17 @@ function! GetHaskellIndent()
|
||||
|
||||
" in foo
|
||||
" where bar
|
||||
"
|
||||
" or
|
||||
"
|
||||
" foo
|
||||
" >>where
|
||||
if l:line =~ '\C^\s*\<where\>'
|
||||
if match(l:prevline, '\C^\s\+in\s\+') == 0
|
||||
return match(l:prevline, 'in') - g:haskell_indent_in
|
||||
endif
|
||||
|
||||
return match(l:prevline, '\S') + &shiftwidth
|
||||
return match(l:prevline, '\S') + get(g:, 'haskell_indent_before_where', &shiftwidth)
|
||||
endif
|
||||
|
||||
" let x = 1
|
||||
@@ -477,16 +484,7 @@ function! GetHaskellIndent()
|
||||
return s:indentMatching(']')
|
||||
endif
|
||||
|
||||
" do not reindent indented lines
|
||||
if match(l:prevline, '\S') < match(l:line, '\S')
|
||||
return -1
|
||||
endif
|
||||
|
||||
if l:line !~ '^\s*[=-]>\s' && l:line =~ '^\s*[!#$%&*+./<>?@\\^|~-]\+'
|
||||
return -1
|
||||
endif
|
||||
|
||||
return match(l:prevline, '\S')
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: January 24, 2017
|
||||
" Last Change: May 16, 2017
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -12,13 +12,28 @@ if exists('b:did_indent')
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" indent correctly if inside <script>
|
||||
" vim/vim@690afe1 for the switch from cindent
|
||||
let b:html_indent_script1 = 'inc'
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
setlocal indentkeys+=0],0)
|
||||
" Testable with something like:
|
||||
" vim -eNs "+filetype plugin indent on" "+syntax on" "+set ft=javascript" \
|
||||
" "+norm! gg=G" '+%print' '+:q!' testfile.js \
|
||||
" | diff -uBZ testfile.js -
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
|
||||
let b:syng_str = get(b:,'syng_str','string\|template\|special')
|
||||
" template strings may want to be excluded when editing graphql:
|
||||
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
|
||||
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetJavascriptIndent')
|
||||
finish
|
||||
@@ -34,10 +49,18 @@ if exists('*shiftwidth')
|
||||
endfunction
|
||||
else
|
||||
function s:sw()
|
||||
return &sw
|
||||
return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Performance for forwards search(): start search at pos rather than masking
|
||||
" matches before pos.
|
||||
let s:z = has('patch-7.4.984') ? 'z' : ''
|
||||
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "s:syn_at(line('.'),col('.')) =~? b:syng_strcom"
|
||||
|
||||
" searchpair() wrapper
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,skip,time,...)
|
||||
@@ -49,50 +72,80 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
|
||||
let s:syng_str = 'string\|template'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
||||
function s:syn_at(l,c)
|
||||
let pos = join([a:l,a:c],',')
|
||||
if has_key(s:synId_cache,pos)
|
||||
return s:synId_cache[pos]
|
||||
endif
|
||||
let s:synId_cache[pos] = synIDattr(synID(a:l,a:c,0),'name')
|
||||
return s:synId_cache[pos]
|
||||
endfunction
|
||||
|
||||
function s:parse_cino(f)
|
||||
let [cin, divider, n] = [strridx(&cino,a:f), 0, '']
|
||||
if cin == -1
|
||||
return
|
||||
endif
|
||||
let [sign, cstr] = &cino[cin+1] ==# '-' ? [-1, &cino[cin+2:]] : [1, &cino[cin+1:]]
|
||||
for c in split(cstr,'\zs')
|
||||
if c ==# '.' && !divider
|
||||
let divider = 1
|
||||
elseif c ==# 's'
|
||||
if n is ''
|
||||
let n = s:W
|
||||
else
|
||||
let n = str2nr(n) * s:W
|
||||
endif
|
||||
break
|
||||
elseif c =~ '\d'
|
||||
let [n, divider] .= [c, 0]
|
||||
else
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return sign * str2nr(n) / max([str2nr(divider),1])
|
||||
endfunction
|
||||
|
||||
" Optimized {skip} expr, used only once per GetJavascriptIndent() call
|
||||
function s:skip_func()
|
||||
if !s:free || search('\m`\|\${\|\*\/','nW',s:looksyn)
|
||||
let s:free = !eval(s:skip_expr)
|
||||
let s:looksyn = line('.')
|
||||
return !s:free
|
||||
if s:topCol == 1 || line('.') < s:scriptTag
|
||||
return {} " E728, used as limit condition for loops and searchpair()
|
||||
endif
|
||||
let s:topCol = col('.')
|
||||
if getline('.') =~ '\%<'.s:topCol.'c\/.\{-}\/\|\%>'.s:topCol.'c[''"]\|\\$'
|
||||
if eval(s:skip_expr)
|
||||
let s:topCol = 0
|
||||
endif
|
||||
return !s:topCol
|
||||
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
|
||||
let s:checkIn = eval(s:skip_expr)
|
||||
if s:checkIn
|
||||
let s:topCol = 0
|
||||
endif
|
||||
endif
|
||||
let s:looksyn = line('.')
|
||||
return getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$' &&
|
||||
\ eval(s:skip_expr)
|
||||
return s:checkIn
|
||||
endfunction
|
||||
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
while search('\m[][(){}]','bW',a:stop)
|
||||
if !s:skip_func()
|
||||
let idx = stridx('])}',s:looking_at())
|
||||
if idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
function s:alternatePair()
|
||||
let [l:pos, pat, l:for] = [getpos('.'), '[][(){};]', 3]
|
||||
while search('\m'.pat,'bW')
|
||||
if s:skip_func() | continue | endif
|
||||
let idx = stridx('])};',s:looking_at())
|
||||
if idx is 3
|
||||
if l:for is 1
|
||||
return s:GetPair('{','}','bW','s:skip_func()',2000) > 0 || setpos('.',l:pos)
|
||||
endif
|
||||
let [pat, l:for] = ['[{}();]', l:for - 1]
|
||||
elseif idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000) < 1
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
endfunction
|
||||
|
||||
function s:save_pos(f,...)
|
||||
let l:pos = getpos('.')[1:2]
|
||||
let ret = call(a:f,a:000)
|
||||
call call('cursor',l:pos)
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
function s:syn_at(l,c)
|
||||
return synIDattr(synID(a:l,a:c,0),'name')
|
||||
call setpos('.',l:pos)
|
||||
endfunction
|
||||
|
||||
function s:looking_at()
|
||||
@@ -104,88 +157,109 @@ function s:token()
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:n = line('.')
|
||||
if (s:looking_at() !~ '\k' || search('\m\<','cbW')) && search('\m\S','bW')
|
||||
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:n &&
|
||||
\ 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
|
||||
let l:pos = getpos('.')
|
||||
if search('\m\k\{1,}\|\S','ebW')
|
||||
if (strpart(getline('.'),col('.')-2,2) == '*/' || line('.') != l:pos[1] &&
|
||||
\ getline('.')[:col('.')-1] =~ '\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
while search('\m\S\ze\_s*\/[/*]','bW')
|
||||
if s:syn_at(line('.'),col('.')) !~? s:syng_com
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
else
|
||||
return s:token()
|
||||
endif
|
||||
call setpos('.',l:pos)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function s:others(p)
|
||||
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr
|
||||
endfunction
|
||||
for s:__ in ['__previous_token','__IsBlock']
|
||||
function s:{s:__}(...)
|
||||
let l:pos = getpos('.')
|
||||
try
|
||||
return call('s:'.matchstr(expand('<sfile>'),'.*__\zs\w\+'),a:000)
|
||||
catch
|
||||
finally
|
||||
call setpos('.',l:pos)
|
||||
endtry
|
||||
endfunction
|
||||
endfor
|
||||
|
||||
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])
|
||||
function s:expr_col()
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
return 1
|
||||
endif
|
||||
let [bal, l:pos] = [0, getpos('.')]
|
||||
while bal < 1 && search('\m[{}?:;]','bW',s:scriptTag)
|
||||
if eval(s:skip_expr)
|
||||
continue
|
||||
elseif s:looking_at() == ':'
|
||||
let bal -= strpart(getline('.'),col('.')-2,3) !~ '::'
|
||||
elseif s:looking_at() == '?'
|
||||
let bal += 1
|
||||
elseif s:looking_at() == '{' && getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()
|
||||
let bal = 1
|
||||
elseif s:looking_at() != '}' || s:GetPair('{','}','bW',s:skip_expr,200) < 1
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call setpos('.',l:pos)
|
||||
return max([bal,0])
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
|
||||
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
|
||||
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())])
|
||||
let token = matchstr(a:con[-15:],s:continuation)
|
||||
if strlen(token)
|
||||
call cursor(a:ln,strlen(a:con))
|
||||
if token =~ '[/>]'
|
||||
return s:syn_at(a:ln,col('.')) !~? (token == '>' ? 'jsflow\|^html' : 'regex')
|
||||
elseif token =~ '\l'
|
||||
return s:previous_token() != '.'
|
||||
elseif token == ':'
|
||||
return s:expr_col()
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
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('.'))
|
||||
let pline = substitute(getline(a:ln),'\s*$','','')
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = pline[: l:max]
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
let pline = substitute(pline[:-2],'\s*$','','')
|
||||
endwhile
|
||||
return pline
|
||||
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 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
|
||||
\ s:syn_at(l:n,1) =~? b:syng_str
|
||||
break
|
||||
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")')
|
||||
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
|
||||
let l:pos = getpos('.')
|
||||
call cursor(l:n,1)
|
||||
let l:n = search('\m\S\_s*\/\*','nbW')
|
||||
call setpos('.',l:pos)
|
||||
else
|
||||
return l:n
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return l:n
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
@@ -194,30 +268,53 @@ function s:Balanced(lnum)
|
||||
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
|
||||
if s:syn_at(a:lnum,pos + 1) !~? b:syng_strcom
|
||||
let l:open += match(' ' . l:line[pos],'[[({]')
|
||||
if l:open < 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, '[][(){}]', pos + 1)
|
||||
let pos = match(l:line, (l:open ?
|
||||
\ '['.matchstr(['][','()','{}'],l:line[pos]).']' :
|
||||
\ '[][(){}]'), pos + 1)
|
||||
endwhile
|
||||
return !l:open
|
||||
endfunction
|
||||
|
||||
function s:OneScope(lnum)
|
||||
let pline = s:Trim(a:lnum)
|
||||
call cursor(a:lnum,strlen(pline))
|
||||
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
|
||||
if s:previous_token() =~# '^\%(await\|each\)$'
|
||||
call s:previous_token()
|
||||
let kw = 'for'
|
||||
else
|
||||
let kw = 'for if let while with'
|
||||
endif
|
||||
endif
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
\ s:save_pos('s:previous_token') != '.'
|
||||
\ s:__previous_token() != '.' && !s:doWhile()
|
||||
endfunction
|
||||
|
||||
function s:doWhile()
|
||||
if expand('<cword>') ==# 'while'
|
||||
let [bal, l:pos] = [0, getpos('.')]
|
||||
call search('\m\<','cbW')
|
||||
while bal < 1 && search('\m\C[{}]\|\<\%(do\|while\)\>','bW')
|
||||
if eval(s:skip_expr)
|
||||
continue
|
||||
elseif s:looking_at() ==# 'd'
|
||||
let bal += s:__IsBlock(1)
|
||||
elseif s:looking_at() ==# 'w'
|
||||
let bal -= s:__previous_token() != '.'
|
||||
elseif s:looking_at() != '}' || s:GetPair('{','}','bW',s:skip_expr,200) < 1
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call setpos('.',l:pos)
|
||||
return max([bal,0])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" returns braceless levels started by 'i' and above lines * &sw. 'num' is the
|
||||
@@ -241,32 +338,42 @@ function s:iscontOne(i,num,cont)
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
function s:IsBlock(...)
|
||||
if a:0 || s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
|
||||
if syn =~? 'xml\|jsx'
|
||||
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:previous_token() == '.'
|
||||
if char ==# 'type'
|
||||
return s:__previous_token() !~# '^\%(im\|ex\)port$'
|
||||
endif
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:__previous_token() == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
|
||||
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? 'jsflow\|^html'
|
||||
elseif char == '*'
|
||||
return s:__previous_token() == ':'
|
||||
elseif char == ':'
|
||||
return getline('.')[col('.')-2] != ':' && s:label_col()
|
||||
return !s:expr_col()
|
||||
elseif char == '/'
|
||||
return s:syn_at(line('.'),col('.')) =~? 'regex'
|
||||
endif
|
||||
return syn =~? 'regex' || char !~ '[=~!<*,/?^%|&([]' &&
|
||||
return char !~ '[=~!<,.?^%|&([]' &&
|
||||
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function GetJavascriptIndent()
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
let s:synId_cache = {}
|
||||
" Get the current line.
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
let syns = s:syn_at(v:lnum, 1)
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
let syns = get(s:stack,-1,'')
|
||||
|
||||
" start with strings,comments,etc.
|
||||
if syns =~? s:syng_com
|
||||
@@ -275,7 +382,7 @@ function GetJavascriptIndent()
|
||||
elseif l:line !~ '^\s*\/[/*]'
|
||||
return -1
|
||||
endif
|
||||
elseif syns =~? s:syng_str && l:line !~ '^[''"]'
|
||||
elseif syns =~? b:syng_str
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
@@ -295,60 +402,53 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
let [ s:scriptTag, idx ] = [ get(get(b:,'hi_indent',{}),'blocklnr'),
|
||||
\ index([']',')','}'],l:line[0]) ]
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
call call('cursor',b:js_cache[1:])
|
||||
call call('cursor',b:js_cache[2] ? b:js_cache[1:] : [0,0])
|
||||
else
|
||||
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
let [s:looksyn, s:checkIn, s:topCol] = [v:lnum - 1, 0, 0]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif indent(v:lnum) && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000)
|
||||
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
call s:alternatePair()
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [s:scriptTag,0] : getpos('.')[1:2])
|
||||
let num = b:js_cache[1]
|
||||
|
||||
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
|
||||
if !num || s:IsBlock()
|
||||
if !b:js_cache[2] || 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 pline = s:Trim(l:lnum)
|
||||
if b:js_cache[2] && 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
|
||||
let switch_offset = &cino !~ ':' ? s:W : max([-indent(num),s:parse_cino(':')])
|
||||
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
|
||||
if idx < 0 && pline[-1:] !~ '[{;]'
|
||||
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
|
||||
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
|
||||
let bL -= (bL && l:line[0] == '{') * s:W
|
||||
endif
|
||||
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
|
||||
let pval = s:parse_cino('(')
|
||||
return !pval || !search('\m\S','nbW',num) && !s:parse_cino('U') ?
|
||||
\ (s:parse_cino('w') ? 0 : -!!search('\m\S','W'.s:z,num)) + virtcol('.') :
|
||||
\ max([indent('.') + pval + s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W,0])
|
||||
endif
|
||||
|
||||
" main return
|
||||
if idx + 1 || l:line[:1] == '|}'
|
||||
return indent(num)
|
||||
if l:line =~ '^[])}]\|^|}'
|
||||
return max([indent(num),0])
|
||||
elseif num
|
||||
return indent(num) + s:W + switch_offset + bL + isOp
|
||||
endif
|
||||
|
||||
26
indent/litcoffee.vim
Normal file
26
indent/litcoffee.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/coffee.vim
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetLitCoffeeIndent()
|
||||
|
||||
if exists('*GetLitCoffeeIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetLitCoffeeIndent()
|
||||
if searchpair('^ \|\t', '', '$', 'bWnm') > 0
|
||||
return GetCoffeeIndent(v:lnum)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endfunc
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,6 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
|
||||
|
||||
if exists("b:did_indent")
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
@@ -9,7 +9,7 @@ setlocal indentexpr=GetPlantUMLIndent()
|
||||
setlocal indentkeys=o,O,<CR>,<:>,!^F,0end,0else,}
|
||||
|
||||
" only define the indent code once
|
||||
if exists("*GetPlantUMLIndent")
|
||||
if exists('*GetPlantUMLIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
860
indent/ruby.vim
860
indent/ruby.vim
@@ -20,6 +20,11 @@ if !exists('g:ruby_indent_access_modifier_style')
|
||||
let g:ruby_indent_access_modifier_style = 'normal'
|
||||
endif
|
||||
|
||||
if !exists('g:ruby_indent_assignment_style')
|
||||
" Possible values: "variable", "hanging"
|
||||
let g:ruby_indent_assignment_style = 'hanging'
|
||||
endif
|
||||
|
||||
if !exists('g:ruby_indent_block_style')
|
||||
" Possible values: "expression", "do"
|
||||
let g:ruby_indent_block_style = 'expression'
|
||||
@@ -44,22 +49,21 @@ set cpo&vim
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
|
||||
" Regex of syntax group names that are or delimit strings/symbols or are comments.
|
||||
let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
|
||||
\ '\|Symbol\|String\|StringDelimiter\|StringEscape\|ASCIICode' .
|
||||
\ '\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|Comment\|Documentation\)\>'
|
||||
|
||||
" Regex of syntax group names that are strings.
|
||||
" Syntax group names that are strings.
|
||||
let s:syng_string =
|
||||
\ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\)\>'
|
||||
\ ['String', 'Interpolation', 'InterpolationDelimiter', 'NoInterpolation', 'StringEscape']
|
||||
|
||||
" Regex of syntax group names that are strings or documentation.
|
||||
let s:syng_stringdoc =
|
||||
\ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\|Documentation\)\>'
|
||||
" Syntax group names that are strings or documentation.
|
||||
let s:syng_stringdoc = s:syng_string + ['Documentation']
|
||||
|
||||
" Syntax group names that are or delimit strings/symbols/regexes or are comments.
|
||||
let s:syng_strcom = s:syng_stringdoc +
|
||||
\ ['Regexp', 'RegexpDelimiter', 'RegexpEscape',
|
||||
\ 'Symbol', 'StringDelimiter', 'ASCIICode', 'Comment']
|
||||
|
||||
" 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."'"
|
||||
\ 'index(map('.string(s:syng_strcom).',"hlID(''ruby''.v:val)"), synID(line("."),col("."),1)) >= 0'
|
||||
|
||||
" Regex used for words that, at the start of a line, add a level of indent.
|
||||
let s:ruby_indent_keywords =
|
||||
@@ -144,31 +148,540 @@ let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
|
||||
" Regex that describes a leading operator (only a method call's dot for now)
|
||||
let s:leading_operator_regex = '^\s*[.]'
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" 2. GetRubyIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function! GetRubyIndent(...) abort
|
||||
" 2.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
let indent_info = {}
|
||||
|
||||
" The value of a single shift-width
|
||||
if exists('*shiftwidth')
|
||||
let indent_info.sw = shiftwidth()
|
||||
else
|
||||
let indent_info.sw = &sw
|
||||
endif
|
||||
|
||||
" For the current line, use the first argument if given, else v:lnum
|
||||
let indent_info.clnum = a:0 ? a:1 : v:lnum
|
||||
let indent_info.cline = getline(indent_info.clnum)
|
||||
|
||||
" Set up variables for restoring position in file. Could use clnum here.
|
||||
let indent_info.col = col('.')
|
||||
|
||||
" 2.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
let indent_callback_names = [
|
||||
\ 's:AccessModifier',
|
||||
\ 's:ClosingBracketOnEmptyLine',
|
||||
\ 's:BlockComment',
|
||||
\ 's:DeindentingKeyword',
|
||||
\ 's:MultilineStringOrLineComment',
|
||||
\ 's:ClosingHeredocDelimiter',
|
||||
\ 's:LeadingOperator',
|
||||
\ ]
|
||||
|
||||
for callback_name in indent_callback_names
|
||||
" Decho "Running: ".callback_name
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
if indent >= 0
|
||||
" Decho "Match: ".callback_name." indent=".indent." info=".string(indent_info)
|
||||
return indent
|
||||
endif
|
||||
endfor
|
||||
|
||||
" 2.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
let indent_callback_names = [
|
||||
\ 's:EmptyInsideString',
|
||||
\ 's:StartOfFile',
|
||||
\ 's:AfterAccessModifier',
|
||||
\ 's:ContinuedLine',
|
||||
\ 's:AfterBlockOpening',
|
||||
\ 's:AfterHangingSplat',
|
||||
\ 's:AfterUnbalancedBracket',
|
||||
\ 's:AfterLeadingOperator',
|
||||
\ 's:AfterEndKeyword',
|
||||
\ 's:AfterIndentKeyword',
|
||||
\ ]
|
||||
|
||||
" Previous line number
|
||||
let indent_info.plnum = s:PrevNonBlankNonString(indent_info.clnum - 1)
|
||||
let indent_info.pline = getline(indent_info.plnum)
|
||||
|
||||
for callback_name in indent_callback_names
|
||||
" Decho "Running: ".callback_name
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
if indent >= 0
|
||||
" Decho "Match: ".callback_name." indent=".indent." info=".string(indent_info)
|
||||
return indent
|
||||
endif
|
||||
endfor
|
||||
|
||||
" 2.4. Work on the MSL line. {{{2
|
||||
" --------------------------
|
||||
let indent_callback_names = [
|
||||
\ 's:PreviousNotMSL',
|
||||
\ 's:IndentingKeywordInMSL',
|
||||
\ 's:ContinuedHangingOperator',
|
||||
\ ]
|
||||
|
||||
" Most Significant line based on the previous one -- in case it's a
|
||||
" contination of something above
|
||||
let indent_info.plnum_msl = s:GetMSL(indent_info.plnum)
|
||||
|
||||
for callback_name in indent_callback_names
|
||||
" Decho "Running: ".callback_name
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
if indent >= 0
|
||||
" Decho "Match: ".callback_name." indent=".indent." info=".string(indent_info)
|
||||
return indent
|
||||
endif
|
||||
endfor
|
||||
|
||||
" }}}2
|
||||
|
||||
" By default, just return the previous line's indent
|
||||
" Decho "Default case matched"
|
||||
return indent(indent_info.plnum)
|
||||
endfunction
|
||||
|
||||
" 3. Indenting Logic Callbacks {{{1
|
||||
" ============================
|
||||
|
||||
function! s:AccessModifier(cline_info) abort
|
||||
let info = a:cline_info
|
||||
|
||||
" If this line is an access modifier keyword, align according to the closest
|
||||
" class declaration.
|
||||
if g:ruby_indent_access_modifier_style == 'indent'
|
||||
if s:Match(info.clnum, s:access_modifier_regex)
|
||||
let class_lnum = s:FindContainingClass()
|
||||
if class_lnum > 0
|
||||
return indent(class_lnum) + info.sw
|
||||
endif
|
||||
endif
|
||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||
if s:Match(info.clnum, s:access_modifier_regex)
|
||||
let class_lnum = s:FindContainingClass()
|
||||
if class_lnum > 0
|
||||
return indent(class_lnum)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:ClosingBracketOnEmptyLine(cline_info) abort
|
||||
let info = a:cline_info
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||
let col = matchend(info.cline, '^\s*[]})]')
|
||||
|
||||
if col > 0 && !s:IsInStringOrComment(info.clnum, col)
|
||||
call cursor(info.clnum, col)
|
||||
let closing_bracket = info.cline[col - 1]
|
||||
let bracket_pair = strpart('(){}[]', stridx(')}]', closing_bracket) * 2, 2)
|
||||
|
||||
if searchpair(escape(bracket_pair[0], '\['), '', bracket_pair[1], 'bW', s:skip_expr) > 0
|
||||
if closing_bracket == ')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.') - 1
|
||||
elseif g:ruby_indent_block_style == 'do'
|
||||
let ind = indent(line('.'))
|
||||
else " g:ruby_indent_block_style == 'expression'
|
||||
let ind = indent(s:GetMSL(line('.')))
|
||||
endif
|
||||
endif
|
||||
|
||||
return ind
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:BlockComment(cline_info) abort
|
||||
" If we have a =begin or =end set indent to first column.
|
||||
if match(a:cline_info.cline, '^\s*\%(=begin\|=end\)$') != -1
|
||||
return 0
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:DeindentingKeyword(cline_info) abort
|
||||
let info = a:cline_info
|
||||
|
||||
" If we have a deindenting keyword, find its match and indent to its level.
|
||||
" TODO: this is messy
|
||||
if s:Match(info.clnum, s:ruby_deindent_keywords)
|
||||
call cursor(info.clnum, 1)
|
||||
|
||||
if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
|
||||
\ s:end_skip_expr) > 0
|
||||
let msl = s:GetMSL(line('.'))
|
||||
let line = getline(line('.'))
|
||||
|
||||
if s:IsAssignment(line, col('.')) &&
|
||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||
" assignment to case/begin/etc, on the same line
|
||||
if g:ruby_indent_assignment_style == 'hanging'
|
||||
" hanging indent
|
||||
let ind = virtcol('.') - 1
|
||||
else
|
||||
" align with variable
|
||||
let ind = indent(line('.'))
|
||||
endif
|
||||
elseif g:ruby_indent_block_style == 'do'
|
||||
" align to line of the "do", not to the MSL
|
||||
let ind = indent(line('.'))
|
||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||
" in the case of assignment to the MSL, align to the starting line,
|
||||
" not to the MSL
|
||||
let ind = indent(line('.'))
|
||||
else
|
||||
" align to the MSL
|
||||
let ind = indent(msl)
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:MultilineStringOrLineComment(cline_info) abort
|
||||
let info = a:cline_info
|
||||
|
||||
" If we are in a multi-line string or line-comment, don't do anything to it.
|
||||
if s:IsInStringOrDocumentation(info.clnum, matchend(info.cline, '^\s*') + 1)
|
||||
return indent(info.clnum)
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:ClosingHeredocDelimiter(cline_info) abort
|
||||
let info = a:cline_info
|
||||
|
||||
" If we are at the closing delimiter of a "<<" heredoc-style string, set the
|
||||
" indent to 0.
|
||||
if info.cline =~ '^\k\+\s*$'
|
||||
\ && s:IsInStringDelimiter(info.clnum, 1)
|
||||
\ && search('\V<<'.info.cline, 'nbW') > 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:LeadingOperator(cline_info) abort
|
||||
" If the current line starts with a leading operator, add a level of indent.
|
||||
if s:Match(a:cline_info.clnum, s:leading_operator_regex)
|
||||
return indent(s:GetMSL(a:cline_info.clnum)) + a:cline_info.sw
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:EmptyInsideString(pline_info) abort
|
||||
" If the line is empty and inside a string (plnum would not be the real
|
||||
" prevnonblank in that case), use the previous line's indent
|
||||
let info = a:pline_info
|
||||
|
||||
if info.cline =~ '^\s*$' && info.plnum != prevnonblank(info.clnum - 1)
|
||||
return indent(prevnonblank(info.clnum))
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:StartOfFile(pline_info) abort
|
||||
" At the start of the file use zero indent.
|
||||
if a:pline_info.plnum == 0
|
||||
return 0
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterAccessModifier(pline_info) abort
|
||||
let info = a:pline_info
|
||||
|
||||
if g:ruby_indent_access_modifier_style == 'indent'
|
||||
" If the previous line was a private/protected keyword, add a
|
||||
" level of indent.
|
||||
if s:Match(info.plnum, s:indent_access_modifier_regex)
|
||||
return indent(info.plnum) + info.sw
|
||||
endif
|
||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||
" If the previous line was a private/protected/public keyword, add
|
||||
" a level of indent, since the keyword has been out-dented.
|
||||
if s:Match(info.plnum, s:access_modifier_regex)
|
||||
return indent(info.plnum) + info.sw
|
||||
endif
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" Example:
|
||||
"
|
||||
" if foo || bar ||
|
||||
" baz || bing
|
||||
" puts "foo"
|
||||
" end
|
||||
"
|
||||
function! s:ContinuedLine(pline_info) abort
|
||||
let info = a:pline_info
|
||||
|
||||
let col = s:Match(info.plnum, s:ruby_indent_keywords)
|
||||
if s:Match(info.plnum, s:continuable_regex) &&
|
||||
\ s:Match(info.plnum, s:continuation_regex)
|
||||
if col > 0 && s:IsAssignment(info.pline, col)
|
||||
if g:ruby_indent_assignment_style == 'hanging'
|
||||
" hanging indent
|
||||
let ind = col - 1
|
||||
else
|
||||
" align with variable
|
||||
let ind = indent(info.plnum)
|
||||
endif
|
||||
else
|
||||
let ind = indent(s:GetMSL(info.plnum))
|
||||
endif
|
||||
return ind + info.sw + info.sw
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterBlockOpening(pline_info) abort
|
||||
let info = a:pline_info
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
if s:Match(info.plnum, s:block_regex)
|
||||
if g:ruby_indent_block_style == 'do'
|
||||
" don't align to the msl, align to the "do"
|
||||
let ind = indent(info.plnum) + info.sw
|
||||
else
|
||||
let plnum_msl = s:GetMSL(info.plnum)
|
||||
|
||||
if getline(plnum_msl) =~ '=\s*\(#.*\)\=$'
|
||||
" in the case of assignment to the msl, align to the starting line,
|
||||
" not to the msl
|
||||
let ind = indent(info.plnum) + info.sw
|
||||
else
|
||||
let ind = indent(plnum_msl) + info.sw
|
||||
endif
|
||||
endif
|
||||
|
||||
return ind
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterLeadingOperator(pline_info) abort
|
||||
" If the previous line started with a leading operator, use its MSL's level
|
||||
" of indent
|
||||
if s:Match(a:pline_info.plnum, s:leading_operator_regex)
|
||||
return indent(s:GetMSL(a:pline_info.plnum))
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterHangingSplat(pline_info) abort
|
||||
let info = a:pline_info
|
||||
|
||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||
if info.pline =~ s:splat_regex
|
||||
return indent(info.plnum) + info.sw
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterUnbalancedBracket(pline_info) abort
|
||||
let info = a:pline_info
|
||||
|
||||
" If the previous line contained unclosed opening brackets and we are still
|
||||
" in them, find the rightmost one and add indent depending on the bracket
|
||||
" type.
|
||||
"
|
||||
" If it contained hanging closing brackets, find the rightmost one, find its
|
||||
" match and indent according to that.
|
||||
if info.pline =~ '[[({]' || info.pline =~ '[])}]\s*\%(#.*\)\=$'
|
||||
let [opening, closing] = s:ExtraBrackets(info.plnum)
|
||||
|
||||
if opening.pos != -1
|
||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return indent(info.plnum) + info.sw
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
else
|
||||
let nonspace = matchend(info.pline, '\S', opening.pos + 1) - 1
|
||||
return nonspace > 0 ? nonspace : indent(info.plnum) + info.sw
|
||||
endif
|
||||
elseif closing.pos != -1
|
||||
call cursor(info.plnum, closing.pos + 1)
|
||||
normal! %
|
||||
|
||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||
return indent('.') + info.sw
|
||||
else
|
||||
return indent(s:GetMSL(line('.')))
|
||||
endif
|
||||
else
|
||||
call cursor(info.clnum, info.col)
|
||||
end
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterEndKeyword(pline_info) abort
|
||||
let info = a:pline_info
|
||||
" If the previous line ended with an "end", match that "end"s beginning's
|
||||
" indent.
|
||||
let col = s:Match(info.plnum, '\%(^\|[^.:@$]\)\<end\>\s*\%(#.*\)\=$')
|
||||
if col > 0
|
||||
call cursor(info.plnum, col)
|
||||
if searchpair(s:end_start_regex, '', s:end_end_regex, 'bW',
|
||||
\ s:end_skip_expr) > 0
|
||||
let n = line('.')
|
||||
let ind = indent('.')
|
||||
let msl = s:GetMSL(n)
|
||||
if msl != n
|
||||
let ind = indent(msl)
|
||||
end
|
||||
return ind
|
||||
endif
|
||||
end
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:AfterIndentKeyword(pline_info) abort
|
||||
let info = a:pline_info
|
||||
let col = s:Match(info.plnum, s:ruby_indent_keywords)
|
||||
|
||||
if col > 0
|
||||
call cursor(info.plnum, col)
|
||||
let ind = virtcol('.') - 1 + info.sw
|
||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
||||
" fails, we know that something is lacking an end and thus we indent a
|
||||
" level
|
||||
if s:Match(info.plnum, s:end_end_regex)
|
||||
let ind = indent('.')
|
||||
elseif s:IsAssignment(info.pline, col)
|
||||
if g:ruby_indent_assignment_style == 'hanging'
|
||||
" hanging indent
|
||||
let ind = col + info.sw - 1
|
||||
else
|
||||
" align with variable
|
||||
let ind = indent(info.plnum) + info.sw
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:PreviousNotMSL(msl_info) abort
|
||||
let info = a:msl_info
|
||||
|
||||
" If the previous line wasn't a MSL
|
||||
if info.plnum != info.plnum_msl
|
||||
" If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
|
||||
if s:Match(info.plnum, s:bracket_switch_continuation_regex)
|
||||
" TODO (2016-10-07) Wrong/unused? How could it be "1"?
|
||||
return indent(info.plnum) - 1
|
||||
" If previous line is a continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
elseif s:Match(info.plnum, s:non_bracket_continuation_regex) || s:IsInString(info.plnum, strlen(line))
|
||||
return indent(info.plnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:IndentingKeywordInMSL(msl_info) abort
|
||||
let info = a:msl_info
|
||||
" If the MSL line had an indenting keyword in it, add a level of indent.
|
||||
" TODO: this does not take into account contrived things such as
|
||||
" module Foo; class Bar; end
|
||||
let col = s:Match(info.plnum_msl, s:ruby_indent_keywords)
|
||||
if col > 0
|
||||
let ind = indent(info.plnum_msl) + info.sw
|
||||
if s:Match(info.plnum_msl, s:end_end_regex)
|
||||
let ind = ind - info.sw
|
||||
elseif s:IsAssignment(getline(info.plnum_msl), col)
|
||||
if g:ruby_indent_assignment_style == 'hanging'
|
||||
" hanging indent
|
||||
let ind = col + info.sw - 1
|
||||
else
|
||||
" align with variable
|
||||
let ind = indent(info.plnum_msl) + info.sw
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! s:ContinuedHangingOperator(msl_info) abort
|
||||
let info = a:msl_info
|
||||
|
||||
" If the previous line ended with [*+/.,-=], but wasn't a block ending or a
|
||||
" closing bracket, indent one extra level.
|
||||
if s:Match(info.plnum_msl, s:non_bracket_continuation_regex) && !s:Match(info.plnum_msl, '^\s*\([\])}]\|end\)')
|
||||
if info.plnum_msl == info.plnum
|
||||
let ind = indent(info.plnum_msl) + info.sw
|
||||
else
|
||||
let ind = indent(info.plnum_msl)
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" 4. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
function! s:IsInRubyGroup(groups, lnum, col) abort
|
||||
let ids = map(copy(a:groups), 'hlID("ruby".v:val)')
|
||||
return index(ids, synID(a:lnum, a:col, 1)) >= 0
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string, comment, or is ascii.
|
||||
function s:IsInStringOrComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom
|
||||
function! s:IsInStringOrComment(lnum, col) abort
|
||||
return s:IsInRubyGroup(s:syng_strcom, a:lnum, a:col)
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:IsInString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string
|
||||
function! s:IsInString(lnum, col) abort
|
||||
return s:IsInRubyGroup(s:syng_string, a:lnum, a:col)
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string or documentation.
|
||||
function s:IsInStringOrDocumentation(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_stringdoc
|
||||
function! s:IsInStringOrDocumentation(lnum, col) abort
|
||||
return s:IsInRubyGroup(s:syng_stringdoc, a:lnum, a:col)
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string delimiter
|
||||
function s:IsInStringDelimiter(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'rubyStringDelimiter'
|
||||
function! s:IsInStringDelimiter(lnum, col) abort
|
||||
return s:IsInRubyGroup(['StringDelimiter'], a:lnum, a:col)
|
||||
endfunction
|
||||
|
||||
function! s:IsAssignment(str, pos) abort
|
||||
return strpart(a:str, 0, a:pos - 1) =~ '=\s*$'
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
function! s:PrevNonBlankNonString(lnum) abort
|
||||
let in_block = 0
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
@@ -193,10 +706,9 @@ function s:PrevNonBlankNonString(lnum)
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that started the continuation 'lnum' may be part of.
|
||||
function s:GetMSL(lnum)
|
||||
function! s:GetMSL(lnum) abort
|
||||
" Start on the line we're at and use its indent.
|
||||
let msl = a:lnum
|
||||
let msl_body = getline(msl)
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
while lnum > 0
|
||||
" If we have a continuation line, or we're in a string, use line as MSL.
|
||||
@@ -293,14 +805,13 @@ function s:GetMSL(lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
let msl_body = getline(msl)
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
return msl
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||
function s:ExtraBrackets(lnum)
|
||||
function! s:ExtraBrackets(lnum) abort
|
||||
let opening = {'parentheses': [], 'braces': [], 'brackets': []}
|
||||
let closing = {'parentheses': [], 'braces': [], 'brackets': []}
|
||||
|
||||
@@ -362,7 +873,7 @@ function s:ExtraBrackets(lnum)
|
||||
return [rightmost_opening, rightmost_closing]
|
||||
endfunction
|
||||
|
||||
function s:Match(lnum, regex)
|
||||
function! s:Match(lnum, regex) abort
|
||||
let line = getline(a:lnum)
|
||||
let offset = match(line, '\C'.a:regex)
|
||||
let col = offset + 1
|
||||
@@ -382,7 +893,7 @@ endfunction
|
||||
" Locates the containing class/module's definition line, ignoring nested classes
|
||||
" along the way.
|
||||
"
|
||||
function! s:FindContainingClass()
|
||||
function! s:FindContainingClass() abort
|
||||
let saved_position = getpos('.')
|
||||
|
||||
while searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
|
||||
@@ -398,301 +909,6 @@ function! s:FindContainingClass()
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" 3. GetRubyIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetRubyIndent(...)
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" The value of a single shift-width
|
||||
if exists('*shiftwidth')
|
||||
let sw = shiftwidth()
|
||||
else
|
||||
let sw = &sw
|
||||
endif
|
||||
|
||||
" For the current line, use the first argument if given, else v:lnum
|
||||
let clnum = a:0 ? a:1 : v:lnum
|
||||
|
||||
" Set up variables for restoring position in file. Could use clnum here.
|
||||
let vcol = col('.')
|
||||
|
||||
" 3.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
|
||||
" Get the current line.
|
||||
let line = getline(clnum)
|
||||
let ind = -1
|
||||
|
||||
" If this line is an access modifier keyword, align according to the closest
|
||||
" class declaration.
|
||||
if g:ruby_indent_access_modifier_style == 'indent'
|
||||
if s:Match(clnum, s:access_modifier_regex)
|
||||
let class_line = s:FindContainingClass()
|
||||
if class_line > 0
|
||||
return indent(class_line) + sw
|
||||
endif
|
||||
endif
|
||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||
if s:Match(clnum, s:access_modifier_regex)
|
||||
let class_line = s:FindContainingClass()
|
||||
if class_line > 0
|
||||
return indent(class_line)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||
let col = matchend(line, '^\s*[]})]')
|
||||
if col > 0 && !s:IsInStringOrComment(clnum, col)
|
||||
call cursor(clnum, col)
|
||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||
if line[col-1]==')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.') - 1
|
||||
elseif g:ruby_indent_block_style == 'do'
|
||||
let ind = indent(line('.'))
|
||||
else " g:ruby_indent_block_style == 'expression'
|
||||
let ind = indent(s:GetMSL(line('.')))
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we have a =begin or =end set indent to first column.
|
||||
if match(line, '^\s*\%(=begin\|=end\)$') != -1
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If we have a deindenting keyword, find its match and indent to its level.
|
||||
" TODO: this is messy
|
||||
if s:Match(clnum, s:ruby_deindent_keywords)
|
||||
call cursor(clnum, 1)
|
||||
if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
|
||||
\ s:end_skip_expr) > 0
|
||||
let msl = s:GetMSL(line('.'))
|
||||
let line = getline(line('.'))
|
||||
|
||||
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||
" assignment to case/begin/etc, on the same line, hanging indent
|
||||
let ind = virtcol('.') - 1
|
||||
elseif g:ruby_indent_block_style == 'do'
|
||||
" align to line of the "do", not to the MSL
|
||||
let ind = indent(line('.'))
|
||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||
" in the case of assignment to the MSL, align to the starting line,
|
||||
" not to the MSL
|
||||
let ind = indent(line('.'))
|
||||
else
|
||||
" align to the MSL
|
||||
let ind = indent(msl)
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If we are in a multi-line string or line-comment, don't do anything to it.
|
||||
if s:IsInStringOrDocumentation(clnum, matchend(line, '^\s*') + 1)
|
||||
return indent('.')
|
||||
endif
|
||||
|
||||
" If we are at the closing delimiter of a "<<" heredoc-style string, set the
|
||||
" indent to 0.
|
||||
if line =~ '^\k\+\s*$'
|
||||
\ && s:IsInStringDelimiter(clnum, 1)
|
||||
\ && search('\V<<'.line, 'nbW') > 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If the current line starts with a leading operator, add a level of indent.
|
||||
if s:Match(clnum, s:leading_operator_regex)
|
||||
return indent(s:GetMSL(clnum)) + sw
|
||||
endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
" Find a non-blank, non-multi-line string line above the current line.
|
||||
let lnum = s:PrevNonBlankNonString(clnum - 1)
|
||||
|
||||
" If the line is empty and inside a string, use the previous line.
|
||||
if line =~ '^\s*$' && lnum != prevnonblank(clnum - 1)
|
||||
return indent(prevnonblank(clnum))
|
||||
endif
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Set up variables for the previous line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
|
||||
if g:ruby_indent_access_modifier_style == 'indent'
|
||||
" If the previous line was a private/protected keyword, add a
|
||||
" level of indent.
|
||||
if s:Match(lnum, s:indent_access_modifier_regex)
|
||||
return indent(lnum) + sw
|
||||
endif
|
||||
elseif g:ruby_indent_access_modifier_style == 'outdent'
|
||||
" If the previous line was a private/protected/public keyword, add
|
||||
" a level of indent, since the keyword has been out-dented.
|
||||
if s:Match(lnum, s:access_modifier_regex)
|
||||
return indent(lnum) + sw
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
|
||||
return indent(s:GetMSL(lnum)) + sw + sw
|
||||
endif
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
if s:Match(lnum, s:block_regex)
|
||||
let msl = s:GetMSL(lnum)
|
||||
|
||||
if g:ruby_indent_block_style == 'do'
|
||||
" don't align to the msl, align to the "do"
|
||||
let ind = indent(lnum) + sw
|
||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||
" in the case of assignment to the msl, align to the starting line,
|
||||
" not to the msl
|
||||
let ind = indent(lnum) + sw
|
||||
else
|
||||
let ind = indent(msl) + sw
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If the previous line started with a leading operator, use its MSL's level
|
||||
" of indent
|
||||
if s:Match(lnum, s:leading_operator_regex)
|
||||
return indent(s:GetMSL(lnum))
|
||||
endif
|
||||
|
||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||
if line =~ s:splat_regex
|
||||
return indent(lnum) + sw
|
||||
endif
|
||||
|
||||
" If the previous line contained unclosed opening brackets and we are still
|
||||
" in them, find the rightmost one and add indent depending on the bracket
|
||||
" type.
|
||||
"
|
||||
" If it contained hanging closing brackets, find the rightmost one, find its
|
||||
" match and indent according to that.
|
||||
if line =~ '[[({]' || line =~ '[])}]\s*\%(#.*\)\=$'
|
||||
let [opening, closing] = s:ExtraBrackets(lnum)
|
||||
|
||||
if opening.pos != -1
|
||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return ind + sw
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
else
|
||||
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
||||
return nonspace > 0 ? nonspace : ind + sw
|
||||
endif
|
||||
elseif closing.pos != -1
|
||||
call cursor(lnum, closing.pos + 1)
|
||||
normal! %
|
||||
|
||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||
return indent('.') + sw
|
||||
else
|
||||
return indent(s:GetMSL(line('.')))
|
||||
endif
|
||||
else
|
||||
call cursor(clnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" If the previous line ended with an "end", match that "end"s beginning's
|
||||
" indent.
|
||||
let col = s:Match(lnum, '\%(^\|[^.:@$]\)\<end\>\s*\%(#.*\)\=$')
|
||||
if col > 0
|
||||
call cursor(lnum, col)
|
||||
if searchpair(s:end_start_regex, '', s:end_end_regex, 'bW',
|
||||
\ s:end_skip_expr) > 0
|
||||
let n = line('.')
|
||||
let ind = indent('.')
|
||||
let msl = s:GetMSL(n)
|
||||
if msl != n
|
||||
let ind = indent(msl)
|
||||
end
|
||||
return ind
|
||||
endif
|
||||
end
|
||||
|
||||
let col = s:Match(lnum, s:ruby_indent_keywords)
|
||||
if col > 0
|
||||
call cursor(lnum, col)
|
||||
let ind = virtcol('.') - 1 + sw
|
||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
||||
" fails, we know that something is lacking an end and thus we indent a
|
||||
" level
|
||||
if s:Match(lnum, s:end_end_regex)
|
||||
let ind = indent('.')
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" 3.4. Work on the MSL line. {{{2
|
||||
" --------------------------
|
||||
|
||||
" Set up variables to use and search for MSL to the previous line.
|
||||
let p_lnum = lnum
|
||||
let lnum = s:GetMSL(lnum)
|
||||
|
||||
" If the previous line wasn't a MSL.
|
||||
if p_lnum != lnum
|
||||
" If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
|
||||
if s:Match(p_lnum, s:bracket_switch_continuation_regex)
|
||||
return ind - 1
|
||||
" If previous line is a continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
elseif s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line))
|
||||
return ind
|
||||
endif
|
||||
endif
|
||||
|
||||
" Set up more variables, now that we know we wasn't continuation bound.
|
||||
let line = getline(lnum)
|
||||
let msl_ind = indent(lnum)
|
||||
|
||||
" If the MSL line had an indenting keyword in it, add a level of indent.
|
||||
" TODO: this does not take into account contrived things such as
|
||||
" module Foo; class Bar; end
|
||||
if s:Match(lnum, s:ruby_indent_keywords)
|
||||
let ind = msl_ind + sw
|
||||
if s:Match(lnum, s:end_end_regex)
|
||||
let ind = ind - sw
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If the previous line ended with [*+/.,-=], but wasn't a block ending or a
|
||||
" closing bracket, indent one extra level.
|
||||
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
|
||||
if lnum == p_lnum
|
||||
let ind = msl_ind + sw
|
||||
else
|
||||
let ind = msl_ind
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
" }}}2
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -2,504 +2,362 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') ==
|
||||
|
||||
" Vim indent file
|
||||
" Language: Typescript
|
||||
" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
" Acknowledgement: Almost direct copy from https://github.com/pangloss/vim-javascript
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
if exists('b:did_indent') || get(g:, 'typescript_indent_disable', 0)
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetTypescriptIndent()
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
setlocal indentkeys+=0],0)
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetTypescriptIndent")
|
||||
if exists('*GetTypescriptIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" 1. Variables {{{1
|
||||
" ============
|
||||
" Get shiftwidth value
|
||||
if exists('*shiftwidth')
|
||||
function s:sw()
|
||||
return shiftwidth()
|
||||
endfunction
|
||||
else
|
||||
function s:sw()
|
||||
return &sw
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:ts_keywords = '^\s*\(break\|case\|catch\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
|
||||
" 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
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|regex\|comment\c'
|
||||
|
||||
" Regex of syntax group names that are strings.
|
||||
let s:syng_string = 'regex\c'
|
||||
|
||||
" Regex of syntax group names that are strings or documentation.
|
||||
let s:syng_multiline = 'comment\c'
|
||||
|
||||
" Regex of syntax group names that are line comment.
|
||||
let s:syng_linecom = 'linecomment\c'
|
||||
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
|
||||
let s:syng_str = 'string\|template\|special'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" 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."'"
|
||||
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
|
||||
" Regex that defines continuation lines, not including (, {, or [.
|
||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
||||
|
||||
" Regex that defines continuation lines.
|
||||
" TODO: this needs to deal with if ...: and so on
|
||||
let s:msl_regex = s:continuation_regex
|
||||
|
||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
||||
|
||||
" Regex that defines blocks.
|
||||
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||
|
||||
let s:var_stmt = '^\s*var'
|
||||
|
||||
let s:comma_first = '^\s*,'
|
||||
let s:comma_last = ',\s*$'
|
||||
|
||||
let s:ternary = '^\s\+[?|:]'
|
||||
let s:ternary_q = '^\s\+?'
|
||||
|
||||
" 2. Auxiliary Functions {{{1
|
||||
" ======================
|
||||
|
||||
" Check if the character at lnum:col is inside a string, comment, or is ascii.
|
||||
function s:IsInStringOrComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:IsInString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is inside a multi-line comment.
|
||||
function s:IsInMultilineComment(lnum, col)
|
||||
return !s:IsLineComment(a:lnum, a:col) && synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_multiline
|
||||
endfunction
|
||||
|
||||
" Check if the character at lnum:col is a line comment.
|
||||
function s:IsLineComment(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_linecom
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||
function s:PrevNonBlankNonString(lnum)
|
||||
let in_block = 0
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
" Go in and out of blocks comments as necessary.
|
||||
" If the line isn't empty (with opt. comment) or in a string, end search.
|
||||
let line = getline(lnum)
|
||||
if line =~ '/\*'
|
||||
if in_block
|
||||
let in_block = 0
|
||||
else
|
||||
break
|
||||
endif
|
||||
elseif !in_block && line =~ '\*/'
|
||||
let in_block = 1
|
||||
elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line)))
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that started the continuation 'lnum' may be part of.
|
||||
function s:GetMSL(lnum, in_one_line_scope)
|
||||
" Start on the line we're at and use its indent.
|
||||
let msl = a:lnum
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
while lnum > 0
|
||||
" If we have a continuation line, or we're in a string, use line as MSL.
|
||||
" Otherwise, terminate search as we have found our MSL already.
|
||||
let line = getline(lnum)
|
||||
let col = match(line, s:msl_regex) + 1
|
||||
if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
|
||||
let msl = lnum
|
||||
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:Match(lnum, s:one_line_scope_regex)
|
||||
if msl_one_line == 0
|
||||
break
|
||||
endif
|
||||
endif
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
return msl
|
||||
endfunction
|
||||
|
||||
function s:RemoveTrailingComments(content)
|
||||
let single = '\/\/\(.*\)\s*$'
|
||||
let multi = '\/\*\(.*\)\*\/\s*$'
|
||||
return substitute(substitute(a:content, single, '', ''), multi, '', '')
|
||||
endfunction
|
||||
|
||||
" Find if the string is inside var statement (but not the first string)
|
||||
function s:InMultiVarStatement(lnum)
|
||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
|
||||
|
||||
" loop through previous expressions to find a var statement
|
||||
while lnum > 0
|
||||
let line = getline(lnum)
|
||||
|
||||
" if the line is a ts keyword
|
||||
if (line =~ s:ts_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 (line =~ s:var_stmt)
|
||||
return lnum
|
||||
endif
|
||||
|
||||
" other ts keywords, not a var
|
||||
return 0
|
||||
endif
|
||||
|
||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||
endwhile
|
||||
|
||||
" beginning of program, not a var
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Find line above with beginning of the var statement or returns 0 if it's not
|
||||
" this statement
|
||||
function s:GetVarIndent(lnum)
|
||||
let lvar = s:InMultiVarStatement(a:lnum)
|
||||
let prev_lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||
|
||||
if lvar
|
||||
let line = s:RemoveTrailingComments(getline(prev_lnum))
|
||||
|
||||
" if the previous line doesn't end in a comma, return to regular indent
|
||||
if (line !~ s:comma_last)
|
||||
return indent(prev_lnum) - &sw
|
||||
else
|
||||
return indent(lvar) + &sw
|
||||
endif
|
||||
function s:skip_func()
|
||||
if !s:free || search('\m`\|\${\|\*\/','nW',s:looksyn)
|
||||
let s:free = !eval(s:skip_expr)
|
||||
let s:looksyn = line('.')
|
||||
return !s:free
|
||||
endif
|
||||
|
||||
return -1
|
||||
let s:looksyn = line('.')
|
||||
return getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$' &&
|
||||
\ eval(s:skip_expr)
|
||||
endfunction
|
||||
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
while search('\m[][(){}]','bW',a:stop)
|
||||
if !s:skip_func()
|
||||
let idx = stridx('])}',s:looking_at())
|
||||
if idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
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)
|
||||
function s:save_pos(f,...)
|
||||
let l:pos = getpos('.')[1:2]
|
||||
let ret = call(a:f,a:000)
|
||||
call call('cursor',l:pos)
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
function s:syn_at(l,c)
|
||||
return synIDattr(synID(a:l,a:c,0),'name')
|
||||
endfunction
|
||||
|
||||
function s:looking_at()
|
||||
return getline('.')[col('.')-1]
|
||||
endfunction
|
||||
|
||||
function s:token()
|
||||
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:n = line('.')
|
||||
if (s:looking_at() !~ '\k' || search('\m\<','cbW')) && search('\m\S','bW')
|
||||
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:n &&
|
||||
\ 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:,'typescript_opfirst',
|
||||
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'typescript_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 getline(l:n) =~ '\([/*]\)\1\@![/*]' && 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: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)
|
||||
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 (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||
return !l:open
|
||||
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
|
||||
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
|
||||
|
||||
" 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
|
||||
endif
|
||||
endif
|
||||
|
||||
return a:ind
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
\ s:save_pos('s:previous_token') != '.'
|
||||
endfunction
|
||||
|
||||
function s:InOneLineScope(lnum)
|
||||
let msl = s:GetMSL(a:lnum, 1)
|
||||
if msl > 0 && s:Match(msl, s:one_line_scope_regex)
|
||||
return msl
|
||||
endif
|
||||
return 0
|
||||
" 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
|
||||
endif
|
||||
let ind = min([ind, indent(l:i)])
|
||||
let l:i = s:PrevCodeLine(l:i - 1)
|
||||
endwhile
|
||||
return bL
|
||||
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:Match(msl, s:one_line_scope_regex)
|
||||
return 0
|
||||
else
|
||||
let prev_msl = s:GetMSL(msl - 1, 1)
|
||||
if s:Match(prev_msl, s:one_line_scope_regex)
|
||||
return prev_msl
|
||||
endif
|
||||
endif
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
if match(s:stack,'xml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:previous_token() == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
|
||||
elseif char == ':'
|
||||
return getline('.')[col('.')-2] != ':' && s:label_col()
|
||||
elseif char == '/'
|
||||
return s:syn_at(line('.'),col('.')) =~? 'regex'
|
||||
endif
|
||||
return char !~ '[=~!<*,?^%|&([]' &&
|
||||
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" 3. GetTypescriptIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetTypescriptIndent()
|
||||
" 3.1. Setup {{{2
|
||||
" ----------
|
||||
|
||||
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||
let vcol = col('.')
|
||||
|
||||
" 3.2. Work on the current line {{{2
|
||||
" -----------------------------
|
||||
|
||||
let ind = -1
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
" Get the current line.
|
||||
let line = getline(v:lnum)
|
||||
" previous nonblank line number
|
||||
let prevline = prevnonblank(v:lnum - 1)
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
let s:stack = synstack(v:lnum,1)
|
||||
let syns = synIDattr(get(s:stack,-1),'name')
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
||||
let col = matchend(line, '^\s*[],})]')
|
||||
if col > 0 && !s:IsInStringOrComment(v:lnum, col)
|
||||
call cursor(v:lnum, col)
|
||||
|
||||
let lvar = s:InMultiVarStatement(v:lnum)
|
||||
if lvar
|
||||
let prevline_contents = s:RemoveTrailingComments(getline(prevline))
|
||||
|
||||
" check for comma first
|
||||
if (line[col - 1] =~ ',')
|
||||
" if the previous line ends in comma or semicolon don't indent
|
||||
if (prevline_contents =~ '[;,]\s*$')
|
||||
return indent(s:GetMSL(line('.'), 0))
|
||||
" get previous line indent, if it's comma first return prevline indent
|
||||
elseif (prevline_contents =~ s:comma_first)
|
||||
return indent(prevline)
|
||||
" otherwise we indent 1 level
|
||||
else
|
||||
return indent(lvar) + &sw
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||
if line[col-1]==')' && col('.') != col('$') - 1
|
||||
let ind = virtcol('.')-1
|
||||
else
|
||||
let ind = indent(s:GetMSL(line('.'), 0))
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
" start with strings,comments,etc.
|
||||
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
|
||||
endif
|
||||
let l:lnum = s:PrevCodeLine(v:lnum - 1)
|
||||
if !l:lnum
|
||||
return
|
||||
endif
|
||||
|
||||
" If the line is comma first, dedent 1 level
|
||||
if (getline(prevline) =~ s:comma_first)
|
||||
return indent(prevline) - &sw
|
||||
let l:line = substitute(l:line,'^\s*','','')
|
||||
if l:line[:1] == '/*'
|
||||
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
|
||||
endif
|
||||
if l:line =~ '^\/[/*]'
|
||||
let l:line = ''
|
||||
endif
|
||||
|
||||
if (line =~ s:ternary)
|
||||
if (getline(prevline) =~ s:ternary_q)
|
||||
return indent(prevline)
|
||||
else
|
||||
return indent(prevline) + &sw
|
||||
endif
|
||||
endif
|
||||
|
||||
" If we are in a multi-line comment, cindent does the right thing.
|
||||
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
" Check for multiple var assignments
|
||||
" let var_indent = s:GetVarIndent(v:lnum)
|
||||
" if var_indent >= 0
|
||||
" return var_indent
|
||||
" endif
|
||||
|
||||
" 3.3. Work on the previous line. {{{2
|
||||
" -------------------------------
|
||||
|
||||
" 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*$' && s:IsInMultilineComment(prevline, 1)
|
||||
return indent(prevline) - 1
|
||||
endif
|
||||
|
||||
" Find a non-blank, non-multi-line string line above the current line.
|
||||
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
|
||||
|
||||
" 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
|
||||
|
||||
" Set up variables for current line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
|
||||
" If the previous line ended with a block opening, add a level of indent.
|
||||
if s:Match(lnum, s:block_regex)
|
||||
return indent(s:GetMSL(lnum, 0)) + &sw
|
||||
endif
|
||||
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if line =~ '[[({]'
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||
if col('.') + 1 == col('$')
|
||||
return ind + &sw
|
||||
else
|
||||
return virtcol('.')
|
||||
endif
|
||||
elseif counts[1] == '1' || counts[2] == '1'
|
||||
return ind + &sw
|
||||
else
|
||||
call cursor(v:lnum, vcol)
|
||||
end
|
||||
endif
|
||||
|
||||
" 3.4. Work on the MSL line. {{{2
|
||||
" --------------------------
|
||||
|
||||
let ind_con = ind
|
||||
let ind = s:IndentWithContinuation(lnum, ind_con, &sw)
|
||||
|
||||
" }}}2
|
||||
"
|
||||
"
|
||||
let ols = s:InOneLineScope(lnum)
|
||||
if ols > 0
|
||||
let ind = ind + &sw
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let ols = s:ExitingOneLineScope(lnum)
|
||||
while ols > 0 && ind > 0
|
||||
let ind = ind - &sw
|
||||
let ols = s:InOneLineScope(ols - 1)
|
||||
endwhile
|
||||
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
endif
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
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
|
||||
unlet s:cpo_save
|
||||
|
||||
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:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(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
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,41 +5,64 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1
|
||||
" Maintainer: Eduardo San Martin Morote
|
||||
" Author: Adriaan Zonnenberg
|
||||
|
||||
if exists("b:did_indent")
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Load indent files for required languages
|
||||
for language in ['stylus', 'pug', 'css', 'javascript', 'html', 'coffee']
|
||||
function! s:get_indentexpr(language)
|
||||
unlet! b:did_indent
|
||||
exe "runtime! indent/".language.".vim"
|
||||
exe "let s:".language."indent = &indentexpr"
|
||||
execute 'runtime! indent/' . a:language . '.vim'
|
||||
return &indentexpr
|
||||
endfunction
|
||||
|
||||
" The order is important here, tags without attributes go last.
|
||||
" HTML is left out, it will be used when there is no match.
|
||||
let s:languages = [
|
||||
\ { 'name': 'pug', 'pairs': ['<template lang="pug"', '</template>'] },
|
||||
\ { 'name': 'stylus', 'pairs': ['<style lang="stylus"', '</style>'] },
|
||||
\ { 'name': 'css', 'pairs': ['<style', '</style>'] },
|
||||
\ { 'name': 'coffee', 'pairs': ['<script lang="coffee"', '</script>'] },
|
||||
\ { 'name': 'javascript', 'pairs': ['<script', '</script>'] },
|
||||
\ ]
|
||||
|
||||
for language in s:languages
|
||||
" Set 'indentexpr' if the user has an indent file installed for the language
|
||||
if strlen(globpath(&rtp, 'indent/'. language.name .'.vim'))
|
||||
let language.indentexpr = s:get_indentexpr(language.name)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:html_indent = s:get_indentexpr('html')
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetVueIndent()
|
||||
|
||||
if exists("*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
|
||||
for language in s:languages
|
||||
let opening_tag_line = searchpair(language.pairs[0], '', language.pairs[1], 'bWr')
|
||||
|
||||
if opening_tag_line
|
||||
execute 'let indent = ' . get(language, 'indentexpr', -1)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
if exists('l:indent')
|
||||
if (opening_tag_line == prevnonblank(v:lnum - 1) || opening_tag_line == v:lnum)
|
||||
\ || getline(v:lnum) =~ '\v^\s*\</(script|style|template)'
|
||||
return 0
|
||||
endif
|
||||
else
|
||||
exe "let indent = ".s:htmlindent
|
||||
" Couldn't find language, fall back to html
|
||||
execute 'let indent = ' . s:html_indent
|
||||
endif
|
||||
|
||||
return indent > -1 ? indent : s:htmlindent
|
||||
return indent
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
38
syntax/apiblueprint.vim
Normal file
38
syntax/apiblueprint.vim
Normal file
@@ -0,0 +1,38 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'apiblueprint') == -1
|
||||
|
||||
runtime! syntax/markdown.vim
|
||||
unlet! b:current_syntax
|
||||
|
||||
" Metadata
|
||||
syntax region apibMarkdownMetadata start=/\%^.*:.*$/ end=/^$/ contains=apibMarkdownMetadataKey,apibMarkdownMetadataValue fold
|
||||
syntax match apibMarkdownMetadataKey /^[^:]*\ze:/ contained
|
||||
syntax match apibMarkdownMetadataValue /:.*/ contained
|
||||
|
||||
syntax region apibHTTPStatusCode start=/\d\d\d/ end=// contained containedin=apibResponseSection
|
||||
syntax region apibHTTPContentType start=/(.*)/ end=// contained containedin=apibResponseSection
|
||||
|
||||
syntax region apibModelSection start=/^+ Model/ end=/$/ oneline
|
||||
syntax region apibRequestSection start=/^[-+*] Request.*/ end=/^$/ contains=apibHTTPContentType
|
||||
syntax region apibResponseSection start=/^[-+*] Response \d\d\d/ end=/^$/ contains=apibHTTPStatusCode,apibHTTPContentType
|
||||
syntax region apibHeadersSection start=/^+ Headers$/ end=/^\S.*$/ contains=apibHeadersSectionKey,apibHeadersSectionValue
|
||||
|
||||
syntax region apibActionRelationKey start=/: .*/ end=/$/ contained
|
||||
syntax region apibActionRelation start=/^[-+*] Relation: .*$/ end=/$/ oneline contains=apibActionRelationKey
|
||||
|
||||
syntax match apibHeadersSectionKey /^[^:]*\ze:/ contained
|
||||
syntax match apibHeadersSectionValue /:.*/ contained
|
||||
|
||||
highlight default link apibMarkdownMetadataKey Function
|
||||
highlight default link apibRequestSection Function
|
||||
highlight default link apibResponseSection Function
|
||||
highlight default link apibModelSection Function
|
||||
highlight default link apibHeadersSectionKey Function
|
||||
highlight default link apibHTTPStatusCode Delimiter
|
||||
highlight default link apibHTTPContentType Comment
|
||||
highlight default link apibActionRelation Function
|
||||
highlight default link apibActionRelationKey Identifier
|
||||
|
||||
let b:current_syntax = 'apiblueprint'
|
||||
|
||||
|
||||
endif
|
||||
187
syntax/asciidoc.vim
Normal file
187
syntax/asciidoc.vim
Normal file
@@ -0,0 +1,187 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'asciidoc') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: AsciiDoc
|
||||
" Author: Stuart Rackham <srackham@gmail.com> (inspired by Felix
|
||||
" Obenhuber's original asciidoc.vim script).
|
||||
" URL: http://asciidoc.org/
|
||||
" Licence: GPL (http://www.gnu.org)
|
||||
" Remarks: Vim 6 or greater
|
||||
" Limitations:
|
||||
"
|
||||
" - Nested quoted text formatting is highlighted according to the outer
|
||||
" format.
|
||||
" - If a closing Example Block delimiter may be mistaken for a title
|
||||
" underline. A workaround is to insert a blank line before the closing
|
||||
" delimiter.
|
||||
" - Lines within a paragraph starting with equals characters are
|
||||
" highlighted as single-line titles.
|
||||
" - Lines within a paragraph beginning with a period are highlighted as
|
||||
" block titles.
|
||||
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn clear
|
||||
syn sync fromstart
|
||||
syn sync linebreaks=100
|
||||
|
||||
" Run :help syn-priority to review syntax matching priority.
|
||||
syn keyword asciidocToDo TODO FIXME CHECK TEST XXX ZZZ DEPRECATED
|
||||
syn match asciidocBackslash /\\/
|
||||
syn region asciidocIdMarker start=/^\$Id:\s/ end=/\s\$$/
|
||||
syn match asciidocCallout /\\\@<!<\d\{1,2}>/
|
||||
syn match asciidocOpenBlockDelimiter /^--$/
|
||||
syn match asciidocLineBreak /[ \t]+$/ containedin=asciidocList
|
||||
syn match asciidocRuler /^'\{3,}$/
|
||||
syn match asciidocPagebreak /^<\{3,}$/
|
||||
syn match asciidocEntityRef /\\\@<!&[#a-zA-Z]\S\{-};/
|
||||
syn region asciidocLiteralParagraph start=/\(\%^\|\_^\s*\n\)\@<=\s\+\S\+/ end=/\(^\(+\|--\)\?\s*$\)\@=/ contains=asciidocToDo
|
||||
syn match asciidocURL /\\\@<!\<\(http\|https\|ftp\|file\|irc\):\/\/[^| \t]*\(\w\|\/\)/
|
||||
syn match asciidocEmail /[\\.:]\@<!\(\<\|<\)\w\(\w\|[.-]\)*@\(\w\|[.-]\)*\w>\?[0-9A-Za-z_]\@!/
|
||||
syn match asciidocAttributeRef /\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}/
|
||||
|
||||
" As a damage control measure quoted patterns always terminate at a blank
|
||||
" line (see 'Limitations' above).
|
||||
syn match asciidocQuotedAttributeList /\\\@<!\[[a-zA-Z0-9_-][a-zA-Z0-9 _-]*\][+_'`#*]\@=/
|
||||
syn match asciidocQuotedSubscript /\\\@<!\~\S\_.\{-}\(\~\|\n\s*\n\)/ contains=asciidocEntityRef
|
||||
syn match asciidocQuotedSuperscript /\\\@<!\^\S\_.\{-}\(\^\|\n\s*\n\)/ contains=asciidocEntityRef
|
||||
|
||||
syn match asciidocQuotedMonospaced /\(^\|[| \t([.,=\]]\)\@<=+\([+ \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(+\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
syn match asciidocQuotedMonospaced2 /\(^\|[| \t([.,=\]]\)\@<=`\([` \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(`\([| \t)[\],.?!;:=]\|$\)\@=\)/
|
||||
syn match asciidocQuotedUnconstrainedMonospaced /[\\+]\@<!++\S\_.\{-}\(++\|\n\s*\n\)/ contains=asciidocEntityRef
|
||||
|
||||
syn match asciidocQuotedEmphasized /\(^\|[| \t([.,=\]]\)\@<=_\([_ \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(_\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
syn match asciidocQuotedEmphasized2 /\(^\|[| \t([.,=\]]\)\@<='\([' \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
syn match asciidocQuotedUnconstrainedEmphasized /\\\@<!__\S\_.\{-}\(__\|\n\s*\n\)/ contains=asciidocEntityRef
|
||||
|
||||
syn match asciidocQuotedBold /\(^\|[| \t([.,=\]]\)\@<=\*\([* \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(\*\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
syn match asciidocQuotedUnconstrainedBold /\\\@<!\*\*\S\_.\{-}\(\*\*\|\n\s*\n\)/ contains=asciidocEntityRef
|
||||
|
||||
" Don't allow ` in single quoted (a kludge to stop confusion with `monospaced`).
|
||||
syn match asciidocQuotedSingleQuoted /\(^\|[| \t([.,=\]]\)\@<=`\([` \n\t]\)\@!\([^`]\|\n\(\s*\n\)\@!\)\{-}[^` \t]\('\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
|
||||
syn match asciidocQuotedDoubleQuoted /\(^\|[| \t([.,=\]]\)\@<=``\([` \n\t]\)\@!\(.\|\n\(\s*\n\)\@!\)\{-}\S\(''\([| \t)[\],.?!;:=]\|$\)\@=\)/ contains=asciidocEntityRef
|
||||
|
||||
syn match asciidocDoubleDollarPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=\$\$..\{-}\(\$\$\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
|
||||
syn match asciidocTriplePlusPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=+++..\{-}\(+++\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
|
||||
|
||||
syn match asciidocAdmonition /^\u\{3,15}:\(\s\+.*\)\@=/
|
||||
|
||||
syn region asciidocTable_OLD start=/^\([`.']\d*[-~_]*\)\+[-~_]\+\d*$/ end=/^$/
|
||||
syn match asciidocBlockTitle /^\.[^. \t].*[^-~_]$/ contains=asciidocQuoted.*,asciidocAttributeRef
|
||||
syn match asciidocTitleUnderline /[-=~^+]\{2,}$/ transparent contained contains=NONE
|
||||
syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash
|
||||
syn match asciidocTwoLineTitle /^[^. +/].*[^.]\n[-=~^+]\{3,}$/ contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocTitleUnderline
|
||||
|
||||
syn match asciidocAttributeList /^\[[^[ \t].*\]$/
|
||||
syn match asciidocQuoteBlockDelimiter /^_\{4,}$/
|
||||
syn match asciidocExampleBlockDelimiter /^=\{4,}$/
|
||||
syn match asciidocSidebarDelimiter /^*\{4,}$/
|
||||
|
||||
" See http://vimdoc.sourceforge.net/htmldoc/usr_44.html for excluding region
|
||||
" contents from highlighting.
|
||||
syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?|/ containedin=asciidocTableBlock contained
|
||||
syn region asciidocTableBlock matchgroup=asciidocTableDelimiter start=/^|=\{3,}$/ end=/^|=\{3,}$/ keepend contains=ALL
|
||||
syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?!/ containedin=asciidocTableBlock contained
|
||||
syn region asciidocTableBlock2 matchgroup=asciidocTableDelimiter2 start=/^!=\{3,}$/ end=/^!=\{3,}$/ keepend contains=ALL
|
||||
|
||||
syn match asciidocListContinuation /^+$/
|
||||
syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout,asciidocToDo keepend
|
||||
syn region asciidocListingBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout,asciidocToDo keepend
|
||||
syn region asciidocCommentBlock start="^/\{4,}$" end="^/\{4,}$" contains=asciidocToDo
|
||||
syn region asciidocPassthroughBlock start="^+\{4,}$" end="^+\{4,}$"
|
||||
|
||||
" Allowing leading \w characters in the filter delimiter is to accomodate
|
||||
" the pre version 8.2.7 syntax and may be removed in future releases.
|
||||
syn region asciidocFilterBlock start=/^\w*\~\{4,}$/ end=/^\w*\~\{4,}$/
|
||||
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocRefMacro start=/\\\@<!<<"\{-}\(\w\|-\|_\|:\|\.\)\+"\?,\?/ end=/\(>>\)\|^$/ contains=asciidocQuoted.* keepend
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{2}\(\w\|-\|_\|:\|\.\)\+,\?/ end=/\]\{2}/ keepend
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{3}\(\w\|-\|_\|:\|\.\)\+/ end=/\]\{3}/ keepend
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/[\\0-9a-zA-Z]\@<!\w\(\w\|-\)*:\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef,asciidocEntityRef keepend
|
||||
" Highlight macro that starts with an attribute reference (a common idiom).
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/\(\\\@<!{\w\(\w\|[-,+]\)*\([=!@#$%?:].*\)\?}\)\@<=\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.*,asciidocAttributeRef keepend
|
||||
syn region asciidocMacroAttributes matchgroup=asciidocIndexTerm start=/\\\@<!(\{2,3}/ end=/)\{2,3}/ contains=asciidocQuoted.*,asciidocAttributeRef keepend
|
||||
|
||||
syn match asciidocCommentLine "^//\([^/].*\|\)$" contains=asciidocToDo
|
||||
|
||||
syn region asciidocAttributeEntry start=/^:\w/ end=/:\(\s\|$\)/ oneline
|
||||
|
||||
" Lists.
|
||||
syn match asciidocListBullet /^\s*\zs\(-\|\*\{1,5}\)\ze\s/
|
||||
syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\ze\s\+/
|
||||
syn region asciidocListLabel start=/^\s*/ end=/\(:\{2,4}\|;;\)$/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocToDo keepend
|
||||
" DEPRECATED: Horizontal label.
|
||||
syn region asciidocHLabel start=/^\s*/ end=/\(::\|;;\)\(\s\+\|\\$\)/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
|
||||
" Starts with any of the above.
|
||||
syn region asciidocList start=/^\s*\(-\|\*\{1,5}\)\s/ start=/^\s*\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\s\+/ start=/.\+\(:\{2,4}\|;;\)$/ end=/\(^[=*]\{4,}$\)\@=/ end=/\(^\(+\|--\)\?\s*$\)\@=/ contains=asciidocList.\+,asciidocQuoted.*,asciidocMacroAttributes,asciidocAttributeRef,asciidocEntityRef,asciidocEmail,asciidocURL,asciidocBackslash,asciidocCommentLine,asciidocAttributeList,asciidocToDo
|
||||
|
||||
hi def link asciidocAdmonition Special
|
||||
hi def link asciidocAnchorMacro Macro
|
||||
hi def link asciidocAttributeEntry Special
|
||||
hi def link asciidocAttributeList Special
|
||||
hi def link asciidocAttributeMacro Macro
|
||||
hi def link asciidocAttributeRef Special
|
||||
hi def link asciidocBackslash Special
|
||||
hi def link asciidocBlockTitle Title
|
||||
hi def link asciidocCallout Label
|
||||
hi def link asciidocCommentBlock Comment
|
||||
hi def link asciidocCommentLine Comment
|
||||
hi def link asciidocDoubleDollarPassthrough Special
|
||||
hi def link asciidocEmail Macro
|
||||
hi def link asciidocEntityRef Special
|
||||
hi def link asciidocExampleBlockDelimiter Type
|
||||
hi def link asciidocFilterBlock Type
|
||||
hi def link asciidocHLabel Label
|
||||
hi def link asciidocIdMarker Special
|
||||
hi def link asciidocIndexTerm Macro
|
||||
hi def link asciidocLineBreak Special
|
||||
hi def link asciidocOpenBlockDelimiter Label
|
||||
hi def link asciidocListBullet Label
|
||||
hi def link asciidocListContinuation Label
|
||||
hi def link asciidocListingBlock Identifier
|
||||
hi def link asciidocListLabel Label
|
||||
hi def link asciidocListNumber Label
|
||||
hi def link asciidocLiteralBlock Identifier
|
||||
hi def link asciidocLiteralParagraph Identifier
|
||||
hi def link asciidocMacroAttributes Label
|
||||
hi def link asciidocMacro Macro
|
||||
hi def link asciidocOneLineTitle Title
|
||||
hi def link asciidocPagebreak Type
|
||||
hi def link asciidocPassthroughBlock Identifier
|
||||
hi def link asciidocQuoteBlockDelimiter Type
|
||||
hi def link asciidocQuotedAttributeList Special
|
||||
hi def link asciidocQuotedBold Special
|
||||
hi def link asciidocQuotedDoubleQuoted Label
|
||||
hi def link asciidocQuotedEmphasized2 Type
|
||||
hi def link asciidocQuotedEmphasized Type
|
||||
hi def link asciidocQuotedMonospaced2 Identifier
|
||||
hi def link asciidocQuotedMonospaced Identifier
|
||||
hi def link asciidocQuotedSingleQuoted Label
|
||||
hi def link asciidocQuotedSubscript Type
|
||||
hi def link asciidocQuotedSuperscript Type
|
||||
hi def link asciidocQuotedUnconstrainedBold Special
|
||||
hi def link asciidocQuotedUnconstrainedEmphasized Type
|
||||
hi def link asciidocQuotedUnconstrainedMonospaced Identifier
|
||||
hi def link asciidocRefMacro Macro
|
||||
hi def link asciidocRuler Type
|
||||
hi def link asciidocSidebarDelimiter Type
|
||||
hi def link asciidocTableBlock2 NONE
|
||||
hi def link asciidocTableBlock NONE
|
||||
hi def link asciidocTableDelimiter2 Label
|
||||
hi def link asciidocTableDelimiter Label
|
||||
hi def link asciidocTable_OLD Type
|
||||
hi def link asciidocTablePrefix2 Label
|
||||
hi def link asciidocTablePrefix Label
|
||||
hi def link asciidocToDo Todo
|
||||
hi def link asciidocTriplePlusPassthrough Special
|
||||
hi def link asciidocTwoLineTitle Title
|
||||
hi def link asciidocURL Macro
|
||||
let b:current_syntax = "asciidoc"
|
||||
|
||||
" vim: wrap et sw=2 sts=2:
|
||||
|
||||
endif
|
||||
@@ -32,13 +32,13 @@ syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" con
|
||||
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 @component @slot
|
||||
\ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue
|
||||
\ @unset @lang @choice @component @slot @prepend
|
||||
\ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
||||
|
||||
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan
|
||||
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan
|
||||
\ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent
|
||||
\ @endslot
|
||||
\ @endslot @endprepend
|
||||
\ containedin=ALLBUT,@bladeExempt
|
||||
|
||||
if exists('g:blade_custom_directives')
|
||||
@@ -49,7 +49,7 @@ if exists('g:blade_custom_directives_pairs')
|
||||
exe "syn keyword bladeKeyword @" . join(values(g:blade_custom_directives_pairs), ' @') . " containedin=ALLBUT,@bladeExempt"
|
||||
endif
|
||||
|
||||
syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\%(\s*(\)\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend
|
||||
syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\s*(\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend
|
||||
syn match bladeKeyword "@php\ze\s*(" nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
||||
|
||||
syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Nov 17
|
||||
" Last Change: 2016 Nov 18
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -365,7 +365,7 @@ syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
if !exists("c_no_if0")
|
||||
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
|
||||
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*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
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
|
||||
else
|
||||
|
||||
33
syntax/caddyfile.vim
Normal file
33
syntax/caddyfile.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'caddyfile') == -1
|
||||
|
||||
" Language: Caddyfile
|
||||
" Author: Josh Glendenning <josh@isobit.io>
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match caddyDirective "^\s*\([a-z]\+\)" nextgroup=caddyDirectiveArgs skipwhite
|
||||
syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString nextgroup=caddyDirectiveBlock skipwhite
|
||||
syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment
|
||||
|
||||
syn match caddySubdirective "^\s*\([a-zA-Z0-9_]\+\)" contained nextgroup=caddySubdirectiveArgs skipwhite
|
||||
syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString
|
||||
|
||||
syn match caddyHost "\(https\?:\/\/\)\?\(\(\w\{1,}\.\)\(\w\{2,}\.\?\)\+\|localhost\)\(:[0-9]\{1,5}\)\?" nextgroup=caddyHostBlock skipwhite
|
||||
syn region caddyHostBlock start="{" skip="\\}" end="}" contained contains=caddyDirective,caddyComment
|
||||
|
||||
syn region caddyPlaceholder start="{" skip="\\}" end="}" oneline contained
|
||||
syn region caddyString start='"' skip='\\\\\|\\"' end='"' oneline
|
||||
syn match caddyComment "#.*$"
|
||||
|
||||
hi link caddyDirective Keyword
|
||||
hi link caddySubdirective Structure
|
||||
hi link caddyHost Identifier
|
||||
hi link caddyPlaceholder Special
|
||||
hi link caddyString String
|
||||
hi link caddyComment Comment
|
||||
|
||||
let b:current_syntax = "caddyfile"
|
||||
|
||||
endif
|
||||
@@ -34,7 +34,7 @@ hi def link coffeeConditional Conditional
|
||||
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
|
||||
hi def link coffeeException Exception
|
||||
|
||||
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\)\>/
|
||||
syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\|await\)\>/
|
||||
\ display
|
||||
" The `own` keyword is only a keyword after `for`.
|
||||
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
|
||||
|
||||
@@ -177,7 +177,7 @@ end
|
||||
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
||||
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
||||
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
||||
syn match crystalFunctionDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
|
||||
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant
|
||||
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
|
||||
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
||||
syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
||||
|
||||
" dockerfile.vim - Syntax highlighting for Dockerfiles
|
||||
" Maintainer: Honza Pokorny <http://honza.ca>
|
||||
" Maintainer: Honza Pokorny <https://honza.ca>
|
||||
" Version: 0.5
|
||||
|
||||
|
||||
@@ -9,10 +9,11 @@ if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:current_syntax = "dockerfile"
|
||||
|
||||
syntax case ignore
|
||||
|
||||
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/
|
||||
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/
|
||||
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/
|
||||
highlight link dockerfileKeyword Keyword
|
||||
|
||||
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
||||
@@ -21,15 +22,14 @@ highlight link dockerfileString String
|
||||
syntax match dockerfileComment "\v^\s*#.*$"
|
||||
highlight link dockerfileComment Comment
|
||||
|
||||
syntax include @DockerSh syntax/sh.vim
|
||||
try
|
||||
syntax include @DockerSh after/syntax/sh.vim
|
||||
catch
|
||||
endtry
|
||||
set commentstring=#\ %s
|
||||
|
||||
syntax region dockerShSnip matchgroup=DockerShGroup start="^\s*\%(RUN\|CMD\)\s\+" end="$" contains=@DockerSh
|
||||
highlight link DockerShGroup dockerfileKeyword
|
||||
|
||||
let b:current_syntax = "dockerfile"
|
||||
" match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
syntax include @SH syntax/sh.vim
|
||||
let b:current_syntax = s:current_syntax
|
||||
syntax region shLine matchgroup=dockerfileKeyword start=/\v^\s*(RUN|CMD|ENTRYPOINT)\s/ end=/\v$/ contains=@SH
|
||||
" since @SH will handle "\" as part of the same line automatically, this "just works" for line continuation too, but with the caveat that it will highlight "RUN echo '" followed by a newline as if it were a block because the "'" is shell line continuation... not sure how to fix that just yet (TODO)
|
||||
|
||||
endif
|
||||
|
||||
@@ -4,9 +4,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
||||
" Language: Erlang (http://www.erlang.org)
|
||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||
" Last Update: 2013-Nov-23
|
||||
" Last Update: 2017-Mar-05
|
||||
" License: Vim license
|
||||
" URL: https://github.com/hcs42/vim-erlang
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
" Acknowledgements: This script was originally created by Kresimir Marzic [1].
|
||||
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new
|
||||
@@ -31,11 +31,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
||||
"
|
||||
" syn keyword erlangAttribute myattr1 myattr2 contained
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -45,9 +42,7 @@ set cpo&vim
|
||||
" Case sensitive
|
||||
syn case match
|
||||
|
||||
if version >= 600
|
||||
setlocal iskeyword+=$,@-@
|
||||
endif
|
||||
setlocal iskeyword+=$,@-@
|
||||
|
||||
" Comments
|
||||
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
||||
@@ -88,6 +83,7 @@ syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||
syn match erlangMap '#'
|
||||
syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
|
||||
syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||
|
||||
" Shebang (this line has to be after the ErlangMap)
|
||||
syn match erlangShebang '^#!.*'
|
||||
@@ -153,118 +149,109 @@ let b:erlang_syntax_synced = 1
|
||||
let s:old_style = (exists("g:erlang_old_style_highlight") &&
|
||||
\g:erlang_old_style_highlight == 1)
|
||||
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_erlang_inits")
|
||||
if version < 508
|
||||
let did_erlang_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" Comments
|
||||
HiLink erlangComment Comment
|
||||
HiLink erlangCommentAnnotation Special
|
||||
HiLink erlangTodo Todo
|
||||
HiLink erlangShebang Comment
|
||||
" Comments
|
||||
hi def link erlangComment Comment
|
||||
hi def link erlangCommentAnnotation Special
|
||||
hi def link erlangTodo Todo
|
||||
hi def link erlangShebang Comment
|
||||
|
||||
" Numbers
|
||||
HiLink erlangNumberInteger Number
|
||||
HiLink erlangNumberFloat Float
|
||||
" Numbers
|
||||
hi def link erlangNumberInteger Number
|
||||
hi def link erlangNumberFloat Float
|
||||
|
||||
" Strings, atoms, characters
|
||||
HiLink erlangString String
|
||||
" Strings, atoms, characters
|
||||
hi def link erlangString String
|
||||
|
||||
if s:old_style
|
||||
HiLink erlangQuotedAtom Type
|
||||
else
|
||||
HiLink erlangQuotedAtom String
|
||||
endif
|
||||
|
||||
HiLink erlangStringModifier Special
|
||||
HiLink erlangQuotedAtomModifier Special
|
||||
HiLink erlangModifier Special
|
||||
|
||||
" Operators, separators
|
||||
HiLink erlangOperator Operator
|
||||
HiLink erlangRightArrow Operator
|
||||
if s:old_style
|
||||
HiLink erlangBracket Normal
|
||||
HiLink erlangPipe Normal
|
||||
else
|
||||
HiLink erlangBracket Delimiter
|
||||
HiLink erlangPipe Delimiter
|
||||
endif
|
||||
|
||||
" Atoms, functions, variables, macros
|
||||
if s:old_style
|
||||
HiLink erlangAtom Normal
|
||||
HiLink erlangLocalFuncCall Normal
|
||||
HiLink erlangLocalFuncRef Normal
|
||||
HiLink erlangGlobalFuncCall Function
|
||||
HiLink erlangGlobalFuncRef Function
|
||||
HiLink erlangVariable Normal
|
||||
HiLink erlangMacro Normal
|
||||
HiLink erlangRecord Normal
|
||||
HiLink erlangMap Normal
|
||||
else
|
||||
HiLink erlangAtom String
|
||||
HiLink erlangLocalFuncCall Normal
|
||||
HiLink erlangLocalFuncRef Normal
|
||||
HiLink erlangGlobalFuncCall Normal
|
||||
HiLink erlangGlobalFuncRef Normal
|
||||
HiLink erlangVariable Identifier
|
||||
HiLink erlangMacro Macro
|
||||
HiLink erlangRecord Structure
|
||||
HiLink erlangMap Structure
|
||||
endif
|
||||
|
||||
" Bitstrings
|
||||
if !s:old_style
|
||||
HiLink erlangBitType Type
|
||||
endif
|
||||
|
||||
" Constants and Directives
|
||||
if s:old_style
|
||||
HiLink erlangAttribute Type
|
||||
HiLink erlangMacroDef Type
|
||||
HiLink erlangUnknownAttribute Normal
|
||||
HiLink erlangInclude Type
|
||||
HiLink erlangRecordDef Type
|
||||
HiLink erlangDefine Type
|
||||
HiLink erlangPreCondit Type
|
||||
HiLink erlangType Type
|
||||
else
|
||||
HiLink erlangAttribute Keyword
|
||||
HiLink erlangMacroDef Macro
|
||||
HiLink erlangUnknownAttribute Normal
|
||||
HiLink erlangInclude Include
|
||||
HiLink erlangRecordDef Keyword
|
||||
HiLink erlangDefine Define
|
||||
HiLink erlangPreCondit PreCondit
|
||||
HiLink erlangType Type
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
HiLink erlangKeyword Keyword
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
HiLink erlangBIF Function
|
||||
|
||||
if s:old_style
|
||||
HiLink erlangBoolean Statement
|
||||
HiLink erlangExtra Statement
|
||||
HiLink erlangSignal Statement
|
||||
else
|
||||
HiLink erlangBoolean Boolean
|
||||
HiLink erlangExtra Statement
|
||||
HiLink erlangSignal Statement
|
||||
endif
|
||||
|
||||
delcommand HiLink
|
||||
if s:old_style
|
||||
hi def link erlangQuotedAtom Type
|
||||
else
|
||||
hi def link erlangQuotedAtom String
|
||||
endif
|
||||
|
||||
hi def link erlangStringModifier Special
|
||||
hi def link erlangQuotedAtomModifier Special
|
||||
hi def link erlangModifier Special
|
||||
|
||||
" Operators, separators
|
||||
hi def link erlangOperator Operator
|
||||
hi def link erlangRightArrow Operator
|
||||
if s:old_style
|
||||
hi def link erlangBracket Normal
|
||||
hi def link erlangPipe Normal
|
||||
else
|
||||
hi def link erlangBracket Delimiter
|
||||
hi def link erlangPipe Delimiter
|
||||
endif
|
||||
|
||||
" Atoms, functions, variables, macros
|
||||
if s:old_style
|
||||
hi def link erlangAtom Normal
|
||||
hi def link erlangLocalFuncCall Normal
|
||||
hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Function
|
||||
hi def link erlangGlobalFuncRef Function
|
||||
hi def link erlangVariable Normal
|
||||
hi def link erlangMacro Normal
|
||||
hi def link erlangRecord Normal
|
||||
hi def link erlangQuotedRecord Normal
|
||||
hi def link erlangMap Normal
|
||||
else
|
||||
hi def link erlangAtom String
|
||||
hi def link erlangLocalFuncCall Normal
|
||||
hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Normal
|
||||
hi def link erlangGlobalFuncRef Normal
|
||||
hi def link erlangVariable Identifier
|
||||
hi def link erlangMacro Macro
|
||||
hi def link erlangRecord Structure
|
||||
hi def link erlangQuotedRecord Structure
|
||||
hi def link erlangMap Structure
|
||||
endif
|
||||
|
||||
" Bitstrings
|
||||
if !s:old_style
|
||||
hi def link erlangBitType Type
|
||||
endif
|
||||
|
||||
" Constants and Directives
|
||||
if s:old_style
|
||||
hi def link erlangAttribute Type
|
||||
hi def link erlangMacroDef Type
|
||||
hi def link erlangUnknownAttribute Normal
|
||||
hi def link erlangInclude Type
|
||||
hi def link erlangRecordDef Type
|
||||
hi def link erlangDefine Type
|
||||
hi def link erlangPreCondit Type
|
||||
hi def link erlangType Type
|
||||
else
|
||||
hi def link erlangAttribute Keyword
|
||||
hi def link erlangMacroDef Macro
|
||||
hi def link erlangUnknownAttribute Normal
|
||||
hi def link erlangInclude Include
|
||||
hi def link erlangRecordDef Keyword
|
||||
hi def link erlangDefine Define
|
||||
hi def link erlangPreCondit PreCondit
|
||||
hi def link erlangType Type
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
hi def link erlangKeyword Keyword
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
hi def link erlangBIF Function
|
||||
|
||||
if s:old_style
|
||||
hi def link erlangBoolean Statement
|
||||
hi def link erlangExtra Statement
|
||||
hi def link erlangSignal Statement
|
||||
else
|
||||
hi def link erlangBoolean Boolean
|
||||
hi def link erlangExtra Statement
|
||||
hi def link erlangSignal Statement
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax = "erlang"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -28,15 +28,15 @@ syn region glslPreProc start="^\s*#\s*\(error\|pragma\|extension\|versi
|
||||
syn keyword glslBoolean true false
|
||||
|
||||
" Integer Numbers
|
||||
syn match glslDecimalInt display "\(0\|[1-9]\d*\)"
|
||||
syn match glslOctalInt display "0\o\+"
|
||||
syn match glslHexInt display "0[xX]\x\+"
|
||||
syn match glslDecimalInt display "\(0\|[1-9]\d*\)[uU]\?"
|
||||
syn match glslOctalInt display "0\o\+[uU]\?"
|
||||
syn match glslHexInt display "0[xX]\x\+[uU]\?"
|
||||
|
||||
" Float Numbers
|
||||
syn match glslFloat display "\d\+\.\([eE][+-]\=\d\+\)\="
|
||||
syn match glslFloat display "\.\d\+\([eE][+-]\=\d\+\)\="
|
||||
syn match glslFloat display "\d\+[eE][+-]\=\d\+"
|
||||
syn match glslFloat display "\d\+\.\d\+\([eE][+-]\=\d\+\)\="
|
||||
syn match glslFloat display "\d\+\.\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\="
|
||||
syn match glslFloat display "\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\="
|
||||
syn match glslFloat display "\d\+[eE][+-]\=\d\+\(lf\|LF\|f\|F\)\="
|
||||
syn match glslFloat display "\d\+\.\d\+\([eE][+-]\=\d\+\)\=\(lf\|LF\|f\|F\)\="
|
||||
|
||||
" Swizzles
|
||||
syn match glslSwizzle display /\.[xyzw]\{1,4\}\>/
|
||||
|
||||
558
syntax/gnuplot.vim
Normal file
558
syntax/gnuplot.vim
Normal file
@@ -0,0 +1,558 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gnuplot') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: gnuplot 4.7.0
|
||||
" Maintainer: Andrew Rasmussen andyras@users.sourceforge.net
|
||||
" Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
|
||||
" Last Change: 2014-02-24
|
||||
" Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=4873
|
||||
" Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
|
||||
|
||||
" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz>
|
||||
|
||||
" credit also to Jim Eberle <jim.eberle@fastnlight.com>
|
||||
" for the script http://www.vim.org/scripts/script.php?script_id=1737
|
||||
|
||||
" some shortened names to make demo files look clean... jeh. 11/2000
|
||||
" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
|
||||
" added current commands, keywords, variables, todos, macros... amr 2014-02-24
|
||||
|
||||
" For vim version 5.x: Clear all syntax items
|
||||
" For vim version 6.x: Quit when a syntax file was already loaded
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" ---- Special characters ---- "
|
||||
|
||||
" no harm in just matching any \[char] within double quotes, right?
|
||||
syn match gnuplotSpecial "\\." contained
|
||||
" syn match gnuplotSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[a-z\\]" contained
|
||||
|
||||
" measurements in the units in, cm and pt are special
|
||||
syn match gnuplotUnit "[0-9]+in"
|
||||
syn match gnuplotUnit "[0-9]+cm"
|
||||
syn match gnuplotUnit "[0-9]+pt"
|
||||
|
||||
" external (shell) commands are special
|
||||
syn region gnuplotExternal start="!" end="$"
|
||||
|
||||
" ---- Comments ---- "
|
||||
|
||||
syn region gnuplotComment start="#" end="$" contains=gnuplotTodo
|
||||
|
||||
" ---- Constants ---- "
|
||||
|
||||
" strings
|
||||
syn region gnuplotString start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial
|
||||
syn region gnuplotString start="'" end="'"
|
||||
|
||||
" built-in variables
|
||||
syn keyword gnuplotNumber GNUTERM GPVAL_TERM GPVAL_TERMOPTIONS GPVAL_SPLOT
|
||||
syn keyword gnuplotNumber GPVAL_OUTPUT GPVAL_ENCODING GPVAL_VERSION
|
||||
syn keyword gnuplotNumber GPVAL_PATCHLEVEL GPVAL_COMPILE_OPTIONS
|
||||
syn keyword gnuplotNumber GPVAL_MULTIPLOT GPVAL_PLOT GPVAL_VIEW_ZSCALE
|
||||
syn keyword gnuplotNumber GPVAL_TERMINALS GPVAL_pi GPVAL_NaN
|
||||
syn keyword gnuplotNumber GPVAL_ERRNO GPVAL_ERRMSG GPVAL_PWD
|
||||
syn keyword gnuplotNumber pi NaN GPVAL_LAST_PLOT GPVAL_TERM_WINDOWID
|
||||
syn keyword gnuplotNumber GPVAL_X_MIN GPVAL_X_MAX GPVAL_X_LOG
|
||||
syn keyword gnuplotNumber GPVAL_DATA_X_MIN GPVAL_DATA_X_MAX GPVAL_Y_MIN
|
||||
syn keyword gnuplotNumber GPVAL_Y_MAX GPVAL_Y_LOG GPVAL_DATA_Y_MIN
|
||||
syn keyword gnuplotNumber GPVAL_DATA_Y_MAX GPVAL_X2_MIN GPVAL_X2_MAX
|
||||
syn keyword gnuplotNumber GPVAL_X2_LOG GPVAL_DATA_X2_MIN GPVAL_DATA_X2_MAX
|
||||
syn keyword gnuplotNumber GPVAL_Y2_MIN GPVAL_Y2_MAX GPVAL_Y2_LOG
|
||||
syn keyword gnuplotNumber GPVAL_DATA_Y2_MIN GPVAL_DATA_Y2_MAX GPVAL_Z_MIN
|
||||
syn keyword gnuplotNumber GPVAL_Z_MAX GPVAL_Z_LOG GPVAL_DATA_Z_MIN
|
||||
syn keyword gnuplotNumber GPVAL_DATA_Z_MAX GPVAL_CB_MIN GPVAL_CB_MAX
|
||||
syn keyword gnuplotNumber GPVAL_CB_LOG GPVAL_DATA_CB_MIN GPVAL_DATA_CB_MAX
|
||||
syn keyword gnuplotNumber GPVAL_T_MIN GPVAL_T_MAX GPVAL_T_LOG GPVAL_U_MIN
|
||||
syn keyword gnuplotNumber GPVAL_U_MAX GPVAL_U_LOG GPVAL_V_MIN GPVAL_V_MAX
|
||||
syn keyword gnuplotNumber GPVAL_V_LOG GPVAL_R_MIN GPVAL_R_LOG
|
||||
syn keyword gnuplotNumber GPVAL_TERM_XMIN GPVAL_TERM_XMAX GPVAL_TERM_YMIN
|
||||
syn keyword gnuplotNumber GPVAL_TERM_YMAX GPVAL_TERM_XSIZE
|
||||
syn keyword gnuplotNumber GPVAL_TERM_YSIZE GPVAL_VIEW_MAP GPVAL_VIEW_ROT_X
|
||||
syn keyword gnuplotNumber GPVAL_VIEW_ROT_Z GPVAL_VIEW_SCALE
|
||||
|
||||
" function name variables
|
||||
syn match gnuplotNumber "GPFUN_[a-zA-Z_]*"
|
||||
|
||||
" stats variables
|
||||
syn keyword gnuplotNumber STATS_records STATS_outofrange STATS_invalid
|
||||
syn keyword gnuplotNumber STATS_blank STATS_blocks STATS_columns STATS_min
|
||||
syn keyword gnuplotNumber STATS_max STATS_index_min STATS_index_max
|
||||
syn keyword gnuplotNumber STATS_lo_quartile STATS_median STATS_up_quartile
|
||||
syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_sum STATS_sumsq
|
||||
syn keyword gnuplotNumber STATS_correlation STATS_slope STATS_intercept
|
||||
syn keyword gnuplotNumber STATS_sumxy STATS_pos_min_y STATS_pos_max_y
|
||||
syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_mean_x STATS_sum_x
|
||||
syn keyword gnuplotNumber STATS_stddev_x STATS_sumsq_x STATS_min_x
|
||||
syn keyword gnuplotNumber STATS_max_x STATS_median_x STATS_lo_quartile_x
|
||||
syn keyword gnuplotNumber STATS_up_quartile_x STATS_index_min_x
|
||||
syn keyword gnuplotNumber STATS_index_max_x STATS_mean_y STATS_stddev_y
|
||||
syn keyword gnuplotNumber STATS_sum_y STATS_sumsq_y STATS_min_y
|
||||
syn keyword gnuplotNumber STATS_max_y STATS_median_y STATS_lo_quartile_y
|
||||
syn keyword gnuplotNumber STATS_up_quartile_y STATS_index_min_y
|
||||
syn keyword gnuplotNumber STATS_index_max_y STATS_correlation STATS_sumxy
|
||||
|
||||
" deprecated fit variables
|
||||
syn keyword gnuplotError FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
|
||||
syn keyword gnuplotError FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
|
||||
|
||||
" numbers, from c.vim
|
||||
|
||||
" integer number, or floating point number without a dot and with "f".
|
||||
syn case ignore
|
||||
syn match gnuplotNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
|
||||
|
||||
" floating point number, with dot, optional exponent
|
||||
syn match gnuplotFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
|
||||
|
||||
" floating point number, starting with a dot, optional exponent
|
||||
syn match gnuplotFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
|
||||
|
||||
" floating point number, without dot, with exponent
|
||||
syn match gnuplotFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
|
||||
|
||||
" hex number
|
||||
syn match gnuplotNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
|
||||
syn case match
|
||||
|
||||
" flag an octal number with wrong digits by not highlighting
|
||||
syn match gnuplotOctalError "\<0[0-7]*[89]"
|
||||
|
||||
" ---- Identifiers: Functions ---- "
|
||||
|
||||
" numerical functions
|
||||
syn keyword gnuplotFunc abs acos acosh airy arg asin asinh atan atan2
|
||||
syn keyword gnuplotFunc atanh EllipticK EllipticE EllipticPi besj0 besj1
|
||||
syn keyword gnuplotFunc besy0 besy1 ceil cos cosh erf erfc exp expint
|
||||
syn keyword gnuplotFunc floor gamma ibeta inverf igamma imag invnorm int
|
||||
syn keyword gnuplotFunc lambertw lgamma log log10 norm rand real sgn sin
|
||||
syn keyword gnuplotFunc sin sinh sqrt tan tanh voigt
|
||||
|
||||
" string functions
|
||||
syn keyword gnuplotFunc gprintf sprintf strlen strstrt substr strftime
|
||||
syn keyword gnuplotFunc strptime system word words
|
||||
|
||||
" other functions
|
||||
syn keyword gnuplotFunc column columnhead columnheader defined exists
|
||||
syn keyword gnuplotFunc hsv2rgb stringcolumn timecolumn tm_hour tm_mday
|
||||
syn keyword gnuplotFunc tm_min tm_mon tm_sec tm_wday tm_yday tm_year
|
||||
syn keyword gnuplotFunc time valid value
|
||||
|
||||
" ---- Statements ---- "
|
||||
|
||||
" common (builtin) variable names
|
||||
syn keyword gnuplotKeyword x y t u v z s
|
||||
|
||||
" conditionals
|
||||
syn keyword gnuplotConditional if else
|
||||
|
||||
" repeats
|
||||
syn keyword gnuplotRepeat do for while
|
||||
|
||||
" operators
|
||||
syn match gnuplotOperator "[-+*/^|&?:]"
|
||||
syn match gnuplotOperator "\*\*"
|
||||
syn match gnuplotOperator "&&"
|
||||
syn match gnuplotOperator "||"
|
||||
|
||||
" Keywords
|
||||
|
||||
" keywords for 'fit' command
|
||||
syn keyword gnuplotKeyword via z x:z x:z:s x:y:z:s
|
||||
syn keyword gnuplotKeyword x:y:t:z:s x:y:t:u:z:s x:y:t:u:v:z:s
|
||||
|
||||
" keywords for 'plot' command
|
||||
" 'axes' keyword
|
||||
syn keyword gnuplotKeyword axes x1y1 x1y2 x2y1 x2y2
|
||||
" 'binary' keyword
|
||||
syn keyword gnuplotKeyword binary matrix general array record format endian
|
||||
syn keyword gnuplotKeyword filetype avs edf png scan transpose dx dy dz
|
||||
syn keyword gnuplotKeyword flipx flipy flipz origin center rotate using
|
||||
syn keyword gnuplotKeyword perpendicular skip every
|
||||
" datafile keywords
|
||||
syn keyword gnuplotKeyword binary nonuniform matrix index every using
|
||||
syn keyword gnuplotKeyword smooth volatile noautoscale every index
|
||||
" 'smooth' keywords
|
||||
syn keyword gnuplotKeyword unique frequency cumulative cnormal kdensity
|
||||
syn keyword gnuplotKeyword csplines acsplines bezer sbezier
|
||||
" deprecated 'thru' keyword
|
||||
syn keyword gnuplotError thru
|
||||
" 'using' keyword
|
||||
syn keyword gnuplotKeyword using u xticlabels yticlabels zticlabels
|
||||
syn keyword gnuplotKeyword x2ticlabels y2ticlabels xtic ytic ztic
|
||||
" 'errorbars' keywords
|
||||
syn keyword gnuplotKeyword errorbars xerrorbars yerrorbars xyerrorbars
|
||||
" 'errorlines' keywords
|
||||
syn keyword gnuplotKeyword errorlines xerrorlines yerrorlines xyerrorlines
|
||||
" 'title' keywords
|
||||
syn keyword gnuplotKeyword title t tit notitle columnheader at beginning
|
||||
syn keyword gnuplotKeyword end
|
||||
" 'with' keywords
|
||||
syn keyword gnuplotKeyword with w linestyle ls linetype lt linewidth
|
||||
syn keyword gnuplotKeyword lw linecolor lc pointtype pt pointsize ps
|
||||
syn keyword gnuplotKeyword fill fs nohidden3d nocontours nosurface palette
|
||||
" styles for 'with'
|
||||
syn keyword gnuplotKeyword lines l points p linespoints lp surface dots
|
||||
syn keyword gnuplotKeyword impulses labels vectors steps fsteps histeps
|
||||
syn keyword gnuplotKeyword errorbars errorlines financebars xerrorbars
|
||||
syn keyword gnuplotKeyword xerrorlines xyerrorbars yerrorbars yerrorlines
|
||||
syn keyword gnuplotKeyword boxes boxerrorbars boxxyerrorbars boxplot
|
||||
syn keyword gnuplotKeyword candlesticks circles ellipses filledcurves
|
||||
syn keyword gnuplotKeyword histogram image rgbimage rgbalpha pm3d variable
|
||||
|
||||
" keywords for 'save' command
|
||||
syn keyword gnuplotKeyword save functions func variables all var terminal
|
||||
syn keyword gnuplotKeyword term set
|
||||
|
||||
" keywords for 'set/show' command
|
||||
" set angles
|
||||
syn keyword gnuplotKeyword angles degrees deg radians rad
|
||||
" set arrow
|
||||
syn keyword gnuplotKeyword arrow from to rto length angle arrowstyle as
|
||||
syn keyword gnuplotKeyword nohead head backhead heads size filled empty
|
||||
syn keyword gnuplotKeyword nofilled front back linestyle linetype linewidth
|
||||
" set autoscale
|
||||
" TODO regexp here
|
||||
syn keyword gnuplotKeyword autoscale x y z cb x2 y2 zy min max fixmin
|
||||
syn keyword gnuplotKeyword fixmax fix keepfix noextend
|
||||
" set bars
|
||||
syn keyword gnuplotKeyword bars small large fullwidth front back
|
||||
" set bind
|
||||
syn keyword gnuplotKeyword bind
|
||||
" set margins
|
||||
" TODO regexp
|
||||
syn keyword gnuplotKeyword margin bmargin lmargin rmargin tmargin
|
||||
" set border
|
||||
syn keyword gnuplotKeyword border front back
|
||||
" set boxwidth
|
||||
syn keyword gnuplotKeyword boxwidth absolute relative
|
||||
" deprecated set clabel
|
||||
syn keyword gnuplotError clabel
|
||||
" set clip
|
||||
syn keyword gnuplotKeyword clip points one two
|
||||
" set cntrlabel
|
||||
syn keyword gnuplotKeyword cntrlabel format font start interval onecolor
|
||||
" set cntrparam
|
||||
syn keyword gnuplotKeyword cntrparam linear cubicspline bspline points
|
||||
syn keyword gnuplotKeyword order levels auto discrete incremental
|
||||
" set colorbox
|
||||
syn keyword gnuplotKeyword colorbox vertical horizontal default user origin
|
||||
syn keyword gnuplotKeyword size front back noborder bdefault border
|
||||
" show colornames
|
||||
syn keyword gnuplotKeyword colornames
|
||||
" set contour
|
||||
syn keyword gnuplotKeyword contour base surface both
|
||||
" set datafile
|
||||
syn keyword gnuplotKeyword datafile fortran nofpe_trap missing separator
|
||||
syn keyword gnuplotKeyword whitespace tab comma commentschars binary
|
||||
" set decimalsign
|
||||
syn keyword gnuplotKeyword decimalsign locale
|
||||
" set dgrid3d
|
||||
syn keyword gnuplotKeyword dgrid3d splines qnorm gauss cauchy exp box hann
|
||||
syn keyword gnuplotKeyword kdensity
|
||||
" set dummy
|
||||
syn keyword gnuplotKeyword dummy
|
||||
" set encoding
|
||||
syn keyword gnuplotKeyword encoding default iso_8859_1 iso_8859_15
|
||||
syn keyword gnuplotKeyword iso_8859_2 iso_8859_9 koi8r koi8u cp437 cp850
|
||||
syn keyword gnuplotKeyword cp852 cp950 cp1250 cp1251 cp1254 sjis utf8
|
||||
" set fit
|
||||
syn keyword gnuplotKeyword fit logfile default quiet noquiet results brief
|
||||
syn keyword gnuplotKeyword verbose errorvariables noerrorvariables
|
||||
syn keyword gnuplotKeyword errorscaling noerrorscaling prescale noprescale
|
||||
syn keyword gnuplotKeyword maxiter none limit limit_abs start-lambda script
|
||||
syn keyword gnuplotKeyword lambda-factor
|
||||
" set fontpath
|
||||
syn keyword gnuplotKeyword fontpath
|
||||
" set format
|
||||
syn keyword gnuplotKeyword format
|
||||
" show functions
|
||||
syn keyword gnuplotKeyword functions
|
||||
" set grid
|
||||
syn keyword gnuplotKeyword grid polar layerdefault xtics ytics ztics x2tics
|
||||
syn keyword gnuplotKeyword y2tics cbtics mxtics mytics mztics mx2tics
|
||||
syn keyword gnuplotKeyword my2tics mcbtics xmtics ymtics zmtics x2mtics
|
||||
syn keyword gnuplotKeyword y2mtics cbmtics noxtics noytics noztics nox2tics
|
||||
syn keyword gnuplotKeyword noy2tics nocbtics nomxtics nomytics nomztics
|
||||
syn keyword gnuplotKeyword nomx2tics nomy2tics nomcbtics
|
||||
" set hidden3d
|
||||
syn keyword gnuplotKeyword hidden3d offset trianglepattern undefined
|
||||
syn keyword gnuplotKeyword altdiagonal noaltdiagonal bentover nobentover
|
||||
syn keyword gnuplotKeyword noundefined
|
||||
" set historysize
|
||||
syn keyword gnuplotKeyword historysize
|
||||
" set isosamples
|
||||
syn keyword gnuplotKeyword isosamples
|
||||
" set key
|
||||
syn keyword gnuplotKeyword key on off inside outside at left right center
|
||||
syn keyword gnuplotKeyword top bottom vertical horizontal Left Right
|
||||
syn keyword gnuplotKeyword opaque noopaque reverse noreverse invert maxrows
|
||||
syn keyword gnuplotKeyword noinvert samplen spacing width height autotitle
|
||||
syn keyword gnuplotKeyword noautotitle title enhanced noenhanced font
|
||||
syn keyword gnuplotKeyword textcolor box nobox linetype linewidth maxcols
|
||||
" set label
|
||||
syn keyword gnuplotKeyword label left center right rotate norotate by font
|
||||
syn keyword gnuplotKeyword front back textcolor point nopoint offset boxed
|
||||
syn keyword gnuplotKeyword hypertext
|
||||
" set linetype
|
||||
syn keyword gnuplotKeyword linetype
|
||||
" set link
|
||||
syn keyword gnuplotKeyword link via inverse
|
||||
" set loadpath
|
||||
syn keyword gnuplotKeyword loadpath
|
||||
" set locale
|
||||
syn keyword gnuplotKeyword locale
|
||||
" set logscale
|
||||
syn keyword gnuplotKeyword logscale log
|
||||
" set macros
|
||||
syn keyword gnuplotKeyword macros
|
||||
" set mapping
|
||||
syn keyword gnuplotKeyword mapping cartesian spherical cylindrical
|
||||
" set mouse
|
||||
syn keyword gnuplotKeyword mouse doubleclick nodoubleclick zoomcoordinates
|
||||
syn keyword gnuplotKeyword nozoomcoordinates ruler noruler at polardistance
|
||||
syn keyword gnuplotKeyword nopolardistance deg tan format clipboardformat
|
||||
syn keyword gnuplotKeyword mouseformat labels nolabels zoomjump nozoomjump
|
||||
syn keyword gnuplotKeyword verbose noverbose
|
||||
" set multiplot
|
||||
syn keyword gnuplotKeyword multiplot title font layout rowsfirst downwards
|
||||
syn keyword gnuplotKeyword downwards upwards scale offset
|
||||
" set object
|
||||
syn keyword gnuplotKeyword object behind fillcolor fc fs rectangle ellipse
|
||||
syn keyword gnuplotKeyword circle polygon at center size units xy xx yy to
|
||||
syn keyword gnuplotKeyword from
|
||||
" set offsets
|
||||
syn keyword gnuplotKeyword offsets
|
||||
" set origin
|
||||
syn keyword gnuplotKeyword origin
|
||||
" set output
|
||||
syn keyword gnuplotKeyword output
|
||||
" set parametric
|
||||
syn keyword gnuplotKeyword parametric
|
||||
" show plot
|
||||
syn keyword gnuplotKeyword plot add2history
|
||||
" set pm3d
|
||||
syn keyword gnuplotKeyword hidden3d interpolate scansautomatic scansforward
|
||||
syn keyword gnuplotKeyword scansbackward depthorder flush begin center end
|
||||
syn keyword gnuplotKeyword ftriangles noftriangles clip1in clip4in mean map
|
||||
syn keyword gnuplotKeyword corners2color geomean harmean rms median min max
|
||||
syn keyword gnuplotKeyword c1 c2 c3 c4 pm3d at nohidden3d implicit explicit
|
||||
" set palette
|
||||
syn keyword gnuplotKeyword palette gray color gamma rgbformulae defined
|
||||
syn keyword gnuplotKeyword file functions cubehelix start cycles saturation
|
||||
syn keyword gnuplotKeyword model RGB HSV CMY YIQ XYZ positive negative
|
||||
syn keyword gnuplotKeyword nops_allcF ps_allcF maxcolors float int gradient
|
||||
syn keyword gnuplotKeyword fit2rgbformulae rgbformulae
|
||||
" set pointintervalbox
|
||||
syn keyword gnuplotKeyword pointintervalbox
|
||||
" set pointsize
|
||||
syn keyword gnuplotKeyword pointsize
|
||||
" set polar
|
||||
syn keyword gnuplotKeyword polar
|
||||
" set print
|
||||
syn keyword gnuplotKeyword print append
|
||||
" set psdir
|
||||
syn keyword gnuplotKeyword psdir
|
||||
" set raxis
|
||||
syn keyword gnuplotKeyword raxis rrange rtics
|
||||
" set samples
|
||||
syn keyword gnuplotKeyword samples
|
||||
" set size
|
||||
syn keyword gnuplotKeyword size square nosquare ratio noratio
|
||||
" set style
|
||||
syn keyword gnuplotKeyword style function data noborder rectangle arrow
|
||||
syn keyword gnuplotKeyword default nohead head heads size filled empty
|
||||
syn keyword gnuplotKeyword nofilled front back boxplot range fraction
|
||||
syn keyword gnuplotKeyword outliers nooutliers pointtype candlesticks
|
||||
syn keyword gnuplotKeyword separation labels off auto x x2 sorted unsorted
|
||||
syn keyword gnuplotKeyword fill empty transparent solid pattern border
|
||||
syn keyword gnuplotKeyword increment userstyles financebars line default
|
||||
syn keyword gnuplotKeyword linetype lt linecolor lc linewidth lw pointtype
|
||||
syn keyword gnuplotKeyword pt pointsize ps pointinterval pi palette circle
|
||||
syn keyword gnuplotKeyword radius graph screen wedge nowedge ellipse size
|
||||
syn keyword gnuplotKeyword units xx xy yy histogram line textbox opaque
|
||||
syn keyword gnuplotKeyword border noborder
|
||||
" set surface
|
||||
syn keyword gnuplotKeyword surface implicit explicit
|
||||
" set table
|
||||
syn keyword gnuplotKeyword table
|
||||
" set terminal (list of terminals)
|
||||
syn keyword gnuplotKeyword terminal term push pop aed512 aed767 aifm aqua
|
||||
syn keyword gnuplotKeyword be cairo cairolatex canvas cgm context corel
|
||||
syn keyword gnuplotKeyword debug dumb dxf dxy800a eepic emf emxvga epscairo
|
||||
syn keyword gnuplotKeyword epslatex epson_180dpi excl fig ggi gif gpic hpgl
|
||||
syn keyword gnuplotKeyword grass hp2623a hp2648 hp500c hpljii hppj imagen
|
||||
syn keyword gnuplotKeyword jpeg kyo latex linux lua mf mif mp next openstep
|
||||
syn keyword gnuplotKeyword pbm pdf pdfcairo pm png pngcairo postscript
|
||||
syn keyword gnuplotKeyword pslatex pstex pstricks qms qt regis sun svg svga
|
||||
syn keyword gnuplotKeyword tek40 tek410x texdraw tgif tikz tkcanvas tpic
|
||||
syn keyword gnuplotKeyword vgagl vws vx384 windows wx wxt x11 xlib
|
||||
" keywords for 'set terminal'
|
||||
syn keyword gnuplotKeyword color monochrome dashlength dl eps pdf fontscale
|
||||
syn keyword gnuplotKeyword standalone blacktext colortext colourtext header
|
||||
syn keyword gnuplotKeyword noheader mono color solid dashed notransparent
|
||||
syn keyword gnuplotKeyword crop crop background input rounded butt square
|
||||
syn keyword gnuplotKeyword size fsize standalone name jsdir defaultsize
|
||||
syn keyword gnuplotKeyword timestamp notimestamp colour mitered beveled
|
||||
syn keyword gnuplotKeyword round squared palfuncparam blacktext nec_cp6
|
||||
syn keyword gnuplotKeyword mppoints inlineimages externalimages defaultfont
|
||||
syn keyword gnuplotKeyword aspect feed nofeed rotate small tiny standalone
|
||||
syn keyword gnuplotKeyword oldstyle newstyle level1 leveldefault level3
|
||||
syn keyword gnuplotKeyword background nobackground solid clip noclip
|
||||
syn keyword gnuplotKeyword colortext colourtext epson_60dpi epson_lx800
|
||||
syn keyword gnuplotKeyword okidata starc tandy_60dpi dpu414 nec_cp6 draft
|
||||
syn keyword gnuplotKeyword medium large normal landscape portrait big
|
||||
syn keyword gnuplotKeyword inches pointsmax textspecial texthidden
|
||||
syn keyword gnuplotKeyword thickness depth version acceleration giant
|
||||
syn keyword gnuplotKeyword delay loop optimize nooptimize pspoints
|
||||
syn keyword gnuplotKeyword FNT9X17 FNT13X25 interlace nointerlace courier
|
||||
syn keyword gnuplotKeyword originreset nooriginreset gparrows nogparrows
|
||||
syn keyword gnuplotKeyword picenvironment nopicenvironment tightboundingbox
|
||||
syn keyword gnuplotKeyword notightboundingbox charsize gppoints nogppoints
|
||||
syn keyword gnuplotKeyword fontscale textscale fulldoc nofulldoc standalone
|
||||
syn keyword gnuplotKeyword preamble header tikzplot tikzarrows notikzarrows
|
||||
syn keyword gnuplotKeyword cmykimages externalimages noexternalimages
|
||||
syn keyword gnuplotKeyword polyline vectors magnification psnfss nopsnfss
|
||||
syn keyword gnuplotKeyword psnfss-version7 prologues a4paper amstex fname
|
||||
syn keyword gnuplotKeyword fsize server persist widelines interlace
|
||||
syn keyword gnuplotKeyword truecolor notruecolor defaultplex simplex duplex
|
||||
syn keyword gnuplotKeyword nofontfiles adobeglyphnames noadobeglyphnames
|
||||
syn keyword gnuplotKeyword nostandalone metric textrigid animate nopspoints
|
||||
syn keyword gnuplotKeyword hpdj FNT5X9 roman emtex rgbimages bitmap
|
||||
syn keyword gnuplotKeyword nobitmap providevars nointerlace add delete
|
||||
syn keyword gnuplotKeyword auxfile hacktext unit raise palfuncparam
|
||||
syn keyword gnuplotKeyword noauxfile nohacktext nounit noraise ctrl noctrl
|
||||
syn keyword gnuplotKeyword close widget fixed dynamic tek40xx vttek
|
||||
syn keyword gnuplotKeyword kc-tek40xx km-tek40xx bitgraph perltk
|
||||
syn keyword gnuplotKeyword interactive red green blue interpolate mode
|
||||
syn keyword gnuplotKeyword position ctrlq replotonresize position noctrlq
|
||||
syn keyword gnuplotKeyword noreplotonresize
|
||||
" set termoption
|
||||
syn keyword gnuplotKeyword termoption font fontscale solid dashed
|
||||
" set tics
|
||||
syn keyword gnuplotKeyword tics add axis border mirror nomirror in out
|
||||
syn keyword gnuplotKeyword scale rotate norotate by offset nooffset left
|
||||
syn keyword gnuplotKeyword autojustify format font textcolor right center
|
||||
" deprecated set ticslevel
|
||||
syn keyword gnuplotError ticslevel ticscale
|
||||
" set timestamp
|
||||
syn keyword gnuplotKeyword timestamp top bottom offset font
|
||||
" set timefmt
|
||||
syn keyword gnuplotKeyword timefmt
|
||||
" set title
|
||||
syn keyword gnuplotKeyword title offset font textcolor tc
|
||||
" set ranges
|
||||
syn keyword gnuplotKeyword trange urange vrange
|
||||
" show variables
|
||||
syn keyword gnuplotKeyword variables
|
||||
" show version
|
||||
syn keyword gnuplotKeyword version
|
||||
" set view
|
||||
syn keyword gnuplotKeyword view map equal noequal xy xyz
|
||||
" set x2data
|
||||
syn keyword gnuplotKeyword xdata ydata zdata x2data y2data cbdata xdtics
|
||||
syn keyword gnuplotKeyword ydtics zdtics x2dtics y2dtics cbdtics xzeroaxis
|
||||
syn keyword gnuplotKeyword yzeroaxis zzeroaxis x2zeroaxis y2zeroaxis
|
||||
syn keyword gnuplotKeyword cbzeroaxis time geographic
|
||||
" set label
|
||||
syn keyword gnuplotKeyword xlabel ylabel zlabel x2label y2label cblabel
|
||||
syn keyword gnuplotKeyword offset font textcolor by parallel
|
||||
" set range
|
||||
syn keyword gnuplotKeyword xrange yrange zrange x2range y2range cbrange
|
||||
" set xyplane
|
||||
syn keyword gnuplotKeyword xyplane
|
||||
" set zeroaxis
|
||||
" set zero
|
||||
syn keyword gnuplotKeyword zero
|
||||
" set zeroaxis
|
||||
syn keyword gnuplotKeyword zeroaxis
|
||||
|
||||
" keywords for 'stats' command
|
||||
syn keyword gnuplotKeyword nooutput
|
||||
|
||||
" keywords for 'test' command
|
||||
syn keyword gnuplotKeyword terminal palette rgb rbg grb gbr brg bgr
|
||||
|
||||
" ---- Macros ---- "
|
||||
|
||||
syn region gnuplotMacro start="@" end=" "
|
||||
|
||||
" ---- Todos ---- "
|
||||
|
||||
syn keyword gnuplotTodo contained TODO FIXME XXX
|
||||
|
||||
" ---- Types: gnuplot commands ---- "
|
||||
|
||||
" I set the commands as Types to distinguish them visually from keywords for the
|
||||
" commands. This comes at the end of the syntax file because some commands
|
||||
" are redundant with keywords. It's probably too much trouble to go and
|
||||
" create special regions for each redundant keyword/command pair, which means
|
||||
" that some keywords (e.g. 'p') will be highlighted as commands.
|
||||
|
||||
syn keyword gnuplotStatement cd call clear evaluate exit fit help history
|
||||
syn keyword gnuplotStatement load lower pause plot p print pwd quit raise
|
||||
syn keyword gnuplotStatement refresh replot rep reread reset save set show
|
||||
syn keyword gnuplotStatement shell splot spstats system test undefine unset
|
||||
syn keyword gnuplotStatement update
|
||||
|
||||
" ---- Define the default highlighting ---- "
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_gnuplot_syntax_inits")
|
||||
if version < 508
|
||||
let did_gnuplot_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" ---- Comments ---- "
|
||||
HiLink gnuplotComment Comment
|
||||
|
||||
" ---- Constants ---- "
|
||||
HiLink gnuplotString String
|
||||
HiLink gnuplotNumber Number
|
||||
HiLink gnuplotFloat Float
|
||||
|
||||
" ---- Identifiers ---- "
|
||||
HiLink gnuplotIdentifier Identifier
|
||||
|
||||
" ---- Statements ---- "
|
||||
HiLink gnuplotConditional Conditional
|
||||
HiLink gnuplotRepeat Repeat
|
||||
HiLink gnuplotKeyword Keyword
|
||||
HiLink gnuplotOperator Operator
|
||||
|
||||
" ---- PreProcs ---- "
|
||||
HiLink gnuplotMacro Macro
|
||||
|
||||
" ---- Types ---- "
|
||||
HiLink gnuplotStatement Type
|
||||
HiLink gnuplotFunc Identifier
|
||||
|
||||
" ---- Specials ---- "
|
||||
HiLink gnuplotSpecial Special
|
||||
HiLink gnuplotUnit Special
|
||||
HiLink gnuplotExternal Special
|
||||
|
||||
" ---- Errors ---- "
|
||||
HiLink gnuplotError Error
|
||||
HiLink gnuplotOctalError Error
|
||||
|
||||
" ---- Todos ---- "
|
||||
HiLink gnuplotTodo Todo
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "gnuplot"
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
endif
|
||||
@@ -76,8 +76,8 @@ hi def link goTplVariable Special
|
||||
|
||||
syn region gotplAction start="{{" end="}}" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable,goTplIdentifier display
|
||||
syn region gotplAction start="\[\[" end="\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable display
|
||||
syn region goTplComment start="{{/\*" end="\*/}}" display
|
||||
syn region goTplComment start="\[\[/\*" end="\*/\]\]" display
|
||||
syn region goTplComment start="{{\(- \)\?/\*" end="\*/\( -\)\?}}" display
|
||||
syn region goTplComment start="\[\[\(- \)\?/\*" end="\*/\( -\)\?\]\]" display
|
||||
|
||||
hi def link gotplAction PreProc
|
||||
hi def link goTplComment Comment
|
||||
|
||||
64
syntax/graphql.vim
Normal file
64
syntax/graphql.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match graphqlComment "#.*$" contains=@Spell
|
||||
|
||||
syn match graphqlOperator "="
|
||||
syn match graphqlOperator "!"
|
||||
syn match graphqlOperator "|"
|
||||
syn match graphqlOperator "\M..."
|
||||
|
||||
syn keyword graphqlBoolean true false
|
||||
syn keyword graphqlNull null
|
||||
syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
|
||||
syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
|
||||
|
||||
syn keyword graphqlStructure enum scalar type union nextgroup=graphqlType skipwhite
|
||||
syn keyword graphqlStructure input interface subscription nextgroup=graphqlType skipwhite
|
||||
syn keyword graphqlStructure implements on nextgroup=graphqlType skipwhite
|
||||
syn keyword graphqlStructure query mutation fragment nextgroup=graphqlIdentifier skipwhite
|
||||
syn keyword graphqlStructure directive nextgroup=graphqlDirective skipwhite
|
||||
syn keyword graphqlStructure extend nextgroup=graphqlStructure skipwhite
|
||||
|
||||
syn match graphqlDirective "\<@\h\w*\>" display
|
||||
syn match graphqlVariable "\<\$\h\w*\>" display
|
||||
|
||||
syn match graphqlIdentifier "\<\h\w*\>" display contained
|
||||
syn match graphqlType "\<_*\u\w*\>" display contained
|
||||
syn match graphqlConstant "\<[A-Z_]\+\>" display contained
|
||||
|
||||
syn keyword graphqlMetaFields __schema __type __typename
|
||||
|
||||
syn region graphqlFold matchgroup=graphqlBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold contains=ALLBUT,graphqlStructure
|
||||
syn region graphqlList matchgroup=graphqlBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent contains=ALLBUT,graphqlDirective,graphqlStructure
|
||||
|
||||
hi def link graphqlComment Comment
|
||||
hi def link graphqlOperator Operator
|
||||
|
||||
hi def link graphqlBraces Delimiter
|
||||
|
||||
hi def link graphqlBoolean Boolean
|
||||
hi def link graphqlNull Keyword
|
||||
hi def link graphqlNumber Number
|
||||
hi def link graphqlString String
|
||||
|
||||
hi def link graphqlConstant Constant
|
||||
hi def link graphqlDirective PreProc
|
||||
hi def link graphqlIdentifier Identifier
|
||||
hi def link graphqlMetaFields Special
|
||||
hi def link graphqlStructure Structure
|
||||
hi def link graphqlType Type
|
||||
hi def link graphqlVariable Identifier
|
||||
|
||||
syn sync minlines=500
|
||||
|
||||
let b:current_syntax = "graphql"
|
||||
|
||||
endif
|
||||
@@ -13,25 +13,21 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:haskell_disable_TH')
|
||||
let g:haskell_disable_TH = 0
|
||||
endif
|
||||
|
||||
if exists('g:haskell_backpack') && g:haskell_backpack == 1
|
||||
if get(g:, 'haskell_backpack', 0)
|
||||
syn keyword haskellBackpackStructure unit signature
|
||||
syn keyword haskellBackpackDependency dependency
|
||||
endif
|
||||
|
||||
syn spell notoplevel
|
||||
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\+::\s"
|
||||
\ contains=
|
||||
\ haskellIdentifier,
|
||||
\ haskellOperators,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens
|
||||
syn match haskellTypeSig
|
||||
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
||||
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\_s\+::\s"
|
||||
\ contains=
|
||||
\ haskellWhere,
|
||||
\ haskellLet,
|
||||
@@ -47,7 +43,7 @@ syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
|
||||
syn keyword haskellDefault default
|
||||
syn keyword haskellImportKeywords import qualified safe as hiding contained
|
||||
syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained
|
||||
syn region haskellForeignImport start="\<foreign\>" end="::" keepend
|
||||
syn region haskellForeignImport start="\<foreign\>" end="\_s\+::\s" keepend
|
||||
\ contains=
|
||||
\ haskellString,
|
||||
\ haskellOperators,
|
||||
@@ -63,7 +59,7 @@ syn match haskellImport "^\s*\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+
|
||||
\ haskellBlockComment,
|
||||
\ haskellPragma
|
||||
syn keyword haskellKeyword do case of
|
||||
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
|
||||
if get(g:, 'haskell_enable_static_pointers', 0)
|
||||
syn keyword haskellStatic static
|
||||
endif
|
||||
syn keyword haskellConditional if then else
|
||||
@@ -107,29 +103,29 @@ syn match haskellPreProc "^#.*$"
|
||||
syn keyword haskellTodo TODO FIXME contained
|
||||
" Treat a shebang line at the start of the file as a comment
|
||||
syn match haskellShebang "\%^#!.*$"
|
||||
if exists('g:haskell_disable_TH') && g:haskell_disable_TH == 0
|
||||
if !get(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 get(g:, 'haskell_enable_typeroles', 0)
|
||||
syn keyword haskellTypeRoles phantom representational nominal contained
|
||||
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend
|
||||
\ contains=
|
||||
\ haskellType,
|
||||
\ haskellTypeRoles
|
||||
endif
|
||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
||||
if get(g:, 'haskell_enable_quantification', 0)
|
||||
syn keyword haskellForall forall
|
||||
endif
|
||||
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
|
||||
if get(g:, 'haskell_enable_recursivedo', 0)
|
||||
syn keyword haskellRecursiveDo mdo rec
|
||||
endif
|
||||
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
|
||||
if get(g:, 'haskell_enable_arrowsyntax', 0)
|
||||
syn keyword haskellArrowSyntax proc
|
||||
endif
|
||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
||||
if get(g:, 'haskell_enable_pattern_synonyms', 0)
|
||||
syn keyword haskellPatternKeyword pattern
|
||||
endif
|
||||
|
||||
@@ -161,7 +157,7 @@ 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 get(g:, 'haskell_classic_highlighting', 0)
|
||||
highlight def link haskellDeclKeyword Keyword
|
||||
highlight def link haskellDecl Keyword
|
||||
highlight def link haskellWhere Keyword
|
||||
@@ -173,35 +169,35 @@ else
|
||||
highlight def link haskellLet Structure
|
||||
endif
|
||||
|
||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
||||
if get(g:, 'haskell_enable_quantification', 0)
|
||||
highlight def link haskellForall Operator
|
||||
endif
|
||||
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
|
||||
if get(g:, 'haskell_enable_recursivedo', 0)
|
||||
highlight def link haskellRecursiveDo Keyword
|
||||
endif
|
||||
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
|
||||
if get(g:, 'haskell_enable_arrowsyntax', 0)
|
||||
highlight def link haskellArrowSyntax Keyword
|
||||
endif
|
||||
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
|
||||
if get(g:, 'haskell_enable_static_pointers', 0)
|
||||
highlight def link haskellStatic Keyword
|
||||
endif
|
||||
if exists('g:haskell_classic_highlighting') && g:haskell_classic_highlighting == 1
|
||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
||||
if get(g:, 'haskell_classic_highlighting', 0)
|
||||
if get(g:, 'haskell_enable_pattern_synonyms', 0)
|
||||
highlight def link haskellPatternKeyword Keyword
|
||||
endif
|
||||
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
|
||||
if get(g:, 'haskell_enable_typeroles', 0)
|
||||
highlight def link haskellTypeRoles Keyword
|
||||
endif
|
||||
else
|
||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
||||
if get(g:, 'haskell_enable_pattern_synonyms', 0)
|
||||
highlight def link haskellPatternKeyword Structure
|
||||
endif
|
||||
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
|
||||
if get(g:, 'haskell_enable_typeroles', 0)
|
||||
highlight def link haskellTypeRoles Structure
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('g:haskell_backpack') && g:haskell_backpack == 1
|
||||
if get(g:, 'haskell_backpack', 0)
|
||||
highlight def link haskellBackpackStructure Structure
|
||||
highlight def link haskellBackpackDependency Include
|
||||
endif
|
||||
|
||||
@@ -2,8 +2,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: HTML (version 5.1)
|
||||
" SVG (SVG 1.1 (Second Edition) )
|
||||
" Last Change: 2016 Jan 20
|
||||
" SVG (SVG 1.1 Second Edition)
|
||||
" MathML (MathML 3.0 Second Edition)
|
||||
" Last Change: 2017 Mar 07
|
||||
" License: Public domain
|
||||
" (but let me know if you like :) )
|
||||
"
|
||||
@@ -18,6 +19,15 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
" Modified: htdebeer <H.T.de.Beer@gmail.com>
|
||||
" Changes: add common SVG elements and attributes for inline SVG
|
||||
|
||||
" Patch 7.4.1142
|
||||
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
|
||||
endif
|
||||
|
||||
" HTML 5 tags
|
||||
syn keyword htmlTagName contained article aside audio canvas command
|
||||
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
||||
@@ -90,7 +100,7 @@ syn keyword htmlArg contained xml:lang xml:space xml:base xmlns
|
||||
syn keyword htmlArg contained onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload
|
||||
syn keyword htmlArg contained onmessage onoffline ononline onpopstate onredo onresize onstorage onundo onunload
|
||||
" <video>, <audio>, <source>, <track>
|
||||
syn keyword htmlArg contained autoplay preload controls loop poster media kind charset srclang track
|
||||
syn keyword htmlArg contained autoplay preload controls loop poster media kind charset srclang track playsinline
|
||||
" <form>, <input>, <button>
|
||||
syn keyword htmlArg contained form autocomplete autofocus list min max step
|
||||
syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate
|
||||
@@ -102,7 +112,7 @@ syn keyword htmlArg contained async
|
||||
" <content>
|
||||
syn keyword htmlArg contained select
|
||||
" <iframe>
|
||||
syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen
|
||||
syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen allowusermedia allowpaymentrequest
|
||||
" <picture>
|
||||
syn keyword htmlArg contained srcset sizes
|
||||
" <a>
|
||||
@@ -111,17 +121,19 @@ syn keyword htmlArg contained download media
|
||||
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
|
||||
" <link>
|
||||
syn keyword htmlArg contained prefetch
|
||||
" syn keyword htmlArg contained preload
|
||||
|
||||
" Custom Data Attributes
|
||||
" 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_.\-]*\)\+\)\{1,}\>" contained
|
||||
syn match htmlArg "\<data[-.0-9_a-z]*-[-.0-9_a-z]*\>" 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
|
||||
syn match htmlArg "\<x[-.0-9_a-z]*-[-.0-9_a-z]*\>" contained
|
||||
|
||||
" Microdata
|
||||
" http://dev.w3.org/html5/md/
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: WAI-ARIA
|
||||
" Language: WAI-ARIA
|
||||
" Maintainer: othree <othree@gmail.com>
|
||||
" URL: http://github.com/othree/html5-syntax.vim
|
||||
" Last Change: 2014-05-02
|
||||
" URL: https://github.com/othree/html5.vim
|
||||
" Last Change: 2017-03-07
|
||||
" License: MIT
|
||||
" Changes: Add match rules
|
||||
" update to Draft 16 September 2010
|
||||
" Changes: update to Candidate Recommendation 27 October 2016
|
||||
|
||||
" WAI-ARIA States and Properties
|
||||
" http://www.w3.org/TR/wai-aria/states_and_properties
|
||||
" https://www.w3.org/TR/wai-aria-1.1/#states_and_properties
|
||||
syn keyword htmlArg contained role
|
||||
|
||||
" Global States and Properties
|
||||
@@ -18,6 +17,8 @@ syn keyword htmlArg contained aria-atomic aria-busy aria-controls aria-describe
|
||||
syn keyword htmlArg contained aria-disabled aria-dropeffect aria-flowto aria-grabbed
|
||||
syn keyword htmlArg contained aria-haspopup aria-hidden aria-invalid aria-label
|
||||
syn keyword htmlArg contained aria-labelledby aria-live aria-owns aria-relevant
|
||||
" 1.1
|
||||
syn keyword htmlArg contained aria-current aria-details aria-keyshortcuts aria-roledescription
|
||||
|
||||
" Widget Attributes
|
||||
syn keyword htmlArg contained aria-autocomplete aria-checked aria-disabled aria-expanded
|
||||
@@ -25,6 +26,8 @@ syn keyword htmlArg contained aria-haspopup aria-hidden aria-invalid aria-label
|
||||
syn keyword htmlArg contained aria-level aria-multiline aria-multiselectable aria-orientation
|
||||
syn keyword htmlArg contained aria-pressed aria-readonly aria-required aria-selected
|
||||
syn keyword htmlArg contained aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext
|
||||
" 1.1
|
||||
syn keyword htmlArg contained aria-errormessage aria-hasgroup aria-modal aria-placeholder
|
||||
|
||||
" Live Region Attributes
|
||||
syn keyword htmlArg contained aria-atomic aria-busy aria-live aria-relevant
|
||||
@@ -35,6 +38,9 @@ syn keyword htmlArg contained aria-dropeffect aria-grabbed
|
||||
" Relationship Attributes
|
||||
syn keyword htmlArg contained aria-activedescendant aria-controls aria-describedby aria-flowto
|
||||
syn keyword htmlArg contained aria-labelledby aria-owns aria-posinset aria-setsize
|
||||
" 1.1
|
||||
syn keyword htmlArg contained aria-colcount aria-colindex aria-colspan
|
||||
syn keyword htmlArg contained aria-rowcount aria-rowindex aria-rowspan
|
||||
|
||||
|
||||
" Use match: https://github.com/othree/html5.vim/issues/39
|
||||
@@ -44,6 +50,8 @@ syn match htmlArg contained "\<aria-\%(\|atomic\|busy\|controls\|describedby\
|
||||
syn match htmlArg contained "\<aria-\%(\|disabled\|dropeffect\|flowto\|grabbed\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|haspopup\|hidden\|invalid\|label\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|labelledby\|live\|owns\|relevant\)\>"
|
||||
" 1.1
|
||||
syn match htmlArg contained "\<aria-\%(\|current\|details\|keyshortcuts\|roledescription\)\>"
|
||||
|
||||
" Widget Attributes
|
||||
syn match htmlArg contained "\<aria-\%(\|autocomplete\|checked\|disabled\|expanded\)\>"
|
||||
@@ -51,6 +59,8 @@ syn match htmlArg contained "\<aria-\%(\|haspopup\|hidden\|invalid\|label\)\>
|
||||
syn match htmlArg contained "\<aria-\%(\|level\|multiline\|multiselectable\|orientation\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|pressed\|readonly\|required\|selected\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|sort\|valuemax\|valuemin\|valuenow\|valuetext\)\>"
|
||||
" 1.1
|
||||
syn match htmlArg contained "\<aria-\%(\|errormessage\|hasgroup\|modal\|placeholder\)\>"
|
||||
|
||||
" Live Region Attributes
|
||||
syn match htmlArg contained "\<aria-\%(\|atomic\|busy\|live\|relevant\)\>"
|
||||
@@ -61,6 +71,9 @@ syn match htmlArg contained "\<aria-\%(\|dropeffect\|grabbed\)\>"
|
||||
" Relationship Attributes
|
||||
syn match htmlArg contained "\<aria-\%(\|activedescendant\|controls\|describedby\|flowto\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|labelledby\|owns\|posinset\|setsize\)\>"
|
||||
" 1.1
|
||||
syn match htmlArg contained "\<aria-\%(\|colcount\|colindex\|colspan\)\>"
|
||||
syn match htmlArg contained "\<aria-\%(\|rowcount\|rowindex\|rowspan\)\>"
|
||||
|
||||
|
||||
endif
|
||||
|
||||
19
syntax/html/electron.vim
Normal file
19
syntax/html/electron.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Electron
|
||||
" Maintainer: othree <othree@gmail.com>
|
||||
" URL: https://github.com/othree/html5.vim
|
||||
" Last Change: 2017-03-15
|
||||
" License: MIT
|
||||
|
||||
" <webview> https://electron.atom.io/docs/api/webview-tag/
|
||||
syn keyword htmlTagName contained webview
|
||||
|
||||
syn keyword htmlArg contained autosize nodeintegration plugins preload httpreferrer
|
||||
syn keyword htmlArg contained useragent disablewebsecurity partition allowpopups
|
||||
syn keyword htmlArg contained webpreferences blinkfeatures disableblinkfeatures
|
||||
syn keyword htmlArg contained guestinstance disableguestresize
|
||||
|
||||
|
||||
endif
|
||||
@@ -27,7 +27,8 @@ syntax sync fromstart
|
||||
syntax case match
|
||||
|
||||
syntax match jsNoise /[:,\;]\{1}/
|
||||
syntax match jsNoise /[\.]\{1}/ skipwhite skipempty nextgroup=jsObjectProp
|
||||
syntax match jsNoise /[\.]\{1}/ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype
|
||||
syntax match jsObjectProp contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/
|
||||
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||
syntax match jsParensError /[)}\]]/
|
||||
|
||||
@@ -54,7 +55,7 @@ syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=
|
||||
" 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 jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial extend
|
||||
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
|
||||
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
|
||||
syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
|
||||
syntax keyword jsNumber Infinity
|
||||
@@ -71,9 +72,9 @@ syntax match jsRegexpOr contained "\v\<@!\|"
|
||||
syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]"
|
||||
syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
||||
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=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
|
||||
else
|
||||
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
|
||||
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
|
||||
endif
|
||||
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||
|
||||
@@ -105,7 +106,7 @@ syntax match jsBlockLabelKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*\%(;
|
||||
syntax keyword jsStatement contained with yield debugger
|
||||
syntax keyword jsStatement contained break continue skipwhite skipempty nextgroup=jsBlockLabelKey
|
||||
syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
|
||||
syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock
|
||||
syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock
|
||||
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
|
||||
syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat,jsForAwait
|
||||
syntax keyword jsDo do skipwhite skipempty nextgroup=jsRepeatBlock
|
||||
@@ -143,9 +144,9 @@ syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus
|
||||
" Code blocks
|
||||
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 jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock extend fold
|
||||
syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsRepeatBlock extend fold
|
||||
syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock extend fold
|
||||
syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock extend fold
|
||||
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||
syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock 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
|
||||
@@ -217,13 +218,14 @@ syntax region jsCommentFunction contained start=/\/\// end=/$/ contains=j
|
||||
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
|
||||
syntax region jsCommentIfElse contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock extend keepend
|
||||
syntax region jsCommentIfElse contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock fold extend keepend
|
||||
syntax region jsCommentRepeat contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock extend keepend
|
||||
syntax region jsCommentRepeat contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock 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")
|
||||
runtime extras/jsdoc.vim
|
||||
@@ -237,8 +239,8 @@ if exists("javascript_plugin_flow")
|
||||
runtime extras/flow.vim
|
||||
endif
|
||||
|
||||
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,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword,jsNoise,,jsBlockLabel
|
||||
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,jsForAwait
|
||||
syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword,jsNoise,jsBlockLabel
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
@@ -364,7 +366,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
|
||||
HiLink jsCommentFunction jsComment
|
||||
HiLink jsCommentClass jsComment
|
||||
HiLink jsCommentMisc jsComment
|
||||
HiLink jsCommentIfElse jsComment
|
||||
HiLink jsCommentRepeat jsComment
|
||||
|
||||
HiLink jsDomErrNo Constant
|
||||
HiLink jsDomNodeConsts Constant
|
||||
@@ -381,7 +384,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
endif
|
||||
|
||||
" Define the htmlJavaScript for HTML syntax html.vim
|
||||
syntax cluster htmlJavaScript contains=@jsAll
|
||||
syntax cluster htmlJavaScript contains=@jsAll,jsImport,jsExport
|
||||
syntax cluster javaScriptExpression contains=@jsAll
|
||||
|
||||
" Vim's default html.vim highlights all javascript as 'Special'
|
||||
|
||||
@@ -44,4 +44,7 @@ syn keyword javascriptDomElemAttrs videoWidth videoHeight poster
|
||||
" drag and drop
|
||||
syn keyword javascriptDomElemAttrs onDragStart onDragEnd onDragEnter onDragLeave onDragOver onDrag onDrop draggable dropzone
|
||||
|
||||
" <checkbox>
|
||||
syn keyword javascriptDomElemAttrs indeterminate
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,675 +0,0 @@
|
||||
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
|
||||
27
syntax/litcoffee.vim
Normal file
27
syntax/litcoffee.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
" Language: Literate CoffeeScript
|
||||
" Maintainer: Michael Smith <michael@diglumi.com>
|
||||
" URL: https://github.com/mintplant/vim-literate-coffeescript
|
||||
" License: MIT
|
||||
|
||||
if exists('b:current_syntax') && b:current_syntax == 'litcoffee'
|
||||
finish
|
||||
endif
|
||||
|
||||
syn include @markdown syntax/markdown.vim
|
||||
syn include @coffee syntax/coffee.vim
|
||||
|
||||
" Partition the file into notCoffee and inlineCoffee. Each line will match
|
||||
" exactly one of these regions. notCoffee matches with a zero-width
|
||||
" look-behind.
|
||||
syn region notCoffee start='^\%( \|\t\)\@<!' end='$' contains=@markdown
|
||||
syn region inlineCoffee start='^ \|\t' end='$' contains=@coffee
|
||||
|
||||
" We defined notCoffee as a region so we can highlight every element in it
|
||||
" that doesn't have it's own explicit rule.
|
||||
highlight default link notCoffee Comment
|
||||
|
||||
let b:current_syntax = "litcoffee"
|
||||
|
||||
endif
|
||||
@@ -63,7 +63,7 @@ execute 'syn region htmlBoldItalic matchgroup=mkdBoldItalic start="\%(^\|\s\)\zs
|
||||
syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]"
|
||||
execute 'syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained oneline' . s:conceal
|
||||
execute 'syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained oneline' . s:conceal
|
||||
execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[" end="\n\{-,1}[^]]\{-}\zs\]\ze[[(]" contains=@mkdNonListItem,@Spell nextgroup=mkdURL,mkdID skipwhite oneline' . s:concealends
|
||||
execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[\ze[^]\n]*\n\?[^]\n]*\][[(]" end="\]" contains=@mkdNonListItem,@Spell nextgroup=mkdURL,mkdID skipwhite' . s:concealends
|
||||
|
||||
" Autolink without angle brackets.
|
||||
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
|
||||
@@ -77,7 +77,7 @@ syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:
|
||||
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
|
||||
|
||||
" Link definitions: [id]: URL (Optional Title)
|
||||
syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
|
||||
syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[\^\@!" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
|
||||
syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
|
||||
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained
|
||||
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
|
||||
@@ -145,8 +145,8 @@ endif
|
||||
|
||||
if get(g:, 'vim_markdown_math', 0)
|
||||
syn include @tex syntax/tex.vim
|
||||
syn region mkdMath start="\\\@<!\$" end="\$" contains=@tex keepend
|
||||
syn region mkdMath start="\\\@<!\$\$" end="\$\$" contains=@tex keepend
|
||||
syn region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
|
||||
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
|
||||
endif
|
||||
|
||||
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath
|
||||
|
||||
173
syntax/mma.vim
Normal file
173
syntax/mma.vim
Normal file
@@ -0,0 +1,173 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||
|
||||
"Vim syntax file
|
||||
" Language: Mathematica
|
||||
" Maintainer: R. Menon <rsmenon@icloud.com>
|
||||
" Last Change: Feb 25, 2013
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syntax case match
|
||||
setlocal iskeyword+=`,$
|
||||
setlocal iskeyword-=:,-
|
||||
"
|
||||
"Functions in the System` context as of 9.0.1
|
||||
syntax keyword mmaSystemSymbol AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis
|
||||
syntax keyword mmaSystemSymbol BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering
|
||||
syntax keyword mmaSystemSymbol C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements
|
||||
syntax keyword mmaSystemSymbol ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition
|
||||
syntax keyword mmaSystemSymbol D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform
|
||||
syntax keyword mmaSystemSymbol DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions
|
||||
syntax keyword mmaSystemSymbol E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution
|
||||
syntax keyword mmaSystemSymbol FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve
|
||||
syntax keyword mmaSystemSymbol FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance
|
||||
syntax keyword mmaSystemSymbol GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion
|
||||
syntax keyword mmaSystemSymbol GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution
|
||||
syntax keyword mmaSystemSymbol HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData
|
||||
syntax keyword mmaSystemSymbol I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction
|
||||
syntax keyword mmaSystemSymbol InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess
|
||||
syntax keyword mmaSystemSymbol JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition
|
||||
syntax keyword mmaSystemSymbol K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter
|
||||
syntax keyword mmaSystemSymbol Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions
|
||||
syntax keyword mmaSystemSymbol LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy
|
||||
syntax keyword mmaSystemSymbol MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution
|
||||
syntax keyword mmaSystemSymbol N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator
|
||||
syntax keyword mmaSystemSymbol NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot
|
||||
syntax keyword mmaSystemSymbol O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues
|
||||
syntax keyword mmaSystemSymbol PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList
|
||||
syntax keyword mmaSystemSymbol PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions
|
||||
syntax keyword mmaSystemSymbol QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder
|
||||
syntax keyword mmaSystemSymbol RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity
|
||||
syntax keyword mmaSystemSymbol SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity
|
||||
syntax keyword mmaSystemSymbol SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders
|
||||
syntax keyword mmaSystemSymbol SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub
|
||||
syntax keyword mmaSystemSymbol Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine
|
||||
syntax keyword mmaSystemSymbol Transparent "Vim keyword!
|
||||
syntax keyword mmaSystemSymbol UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd
|
||||
syntax keyword mmaSystemSymbol V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution
|
||||
syntax keyword mmaSystemSymbol WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian
|
||||
syntax keyword mmaSystemSymbol XMLElement XMLObject Xnor Xor
|
||||
syntax keyword mmaSystemSymbol Yellow YuleDissimilarity
|
||||
syntax keyword mmaSystemSymbol ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform
|
||||
syntax keyword mmaSystemSymbol $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber
|
||||
|
||||
"Symbols added in version 10.0.0
|
||||
syntax keyword mmaSystemSymbol AASTriangle Activate AdministrativeDivisionData AffineStateSpaceModel AircraftData AirportData AirPressureData AirTemperatureData AllowedHeads AllowIncomplete AllowLooseGrammar AllowTransliteration AllTrue AlternateImage AlternatingFactorial AmbiguityFunction AmbiguityList AntihermitianMatrixQ AntisymmetricMatrixQ AnyOrder AnyTrue APIFunction APIFunctionGroup AppearanceRules ArcCurvature ARCHProcess ArcLength Area ArrayResample ASATriangle AssociateTo Association AssociationFormat AssociationMap AssociationQ AssociationThread AsymptoticOutputTracker AutocorrelationTest Ball BarcodeImage BarcodeRecognize BooleanQ BooleanRegion BooleanStrings BoundaryDiscretizeGraphics BoundaryDiscretizeRegion BoundaryMesh BoundaryMeshRegion BoundaryMeshRegionQ BoundedRegionQ BoxObject BridgeData BroadcastStationData BuildingData CalendarConvert CanonicalGraph CanonicalName CantorStaircase CarlemanLinearize CaseSensitive Catenate CelestialSystem ChromaticityPlot ChromaticityPlot3D ChromaticPolynomial Circumsphere ClassifierFunction ClassifierInformation ClassifierMeasurements Classify ClassPriors ClipPlanesStyle CloudAccountData CloudBase CloudConnect CloudDeploy CloudDirectory CloudDisconnect CloudEvaluate CloudExport CloudFunction CloudGet CloudImport CloudObject CloudObjectInformation CloudObjectInformationData CloudObjects CloudPut CloudSave CloudSymbol CodeAssistOptions ColorCoverage ColorDistance ColorQ ColumnSpans CombinerFunction CometData CommonName CompanyData CompositeQ ConformImages ConicHullRegion ConicHullRegion3DBox ConicHullRegionBox ConnectedMeshComponents ConnectLibraryCallbackFunction ConstantImage ConstantRegionQ ConstellationData ConvexHullMesh CountDistinct CountDistinctBy Counts CountsBy CreateDatabin CreateManagedLibraryExpression CreateNotebook CreateUUID CurrencyConvert DamData Databin DatabinAdd Databins DataForm Dataset DatedUnit DateFormat DateObject DateObjectQ DateValue DayHemisphere DaylightQ DayNightTerminator DeepSpaceProbeData DefaultParameterType DefaultReturnType DefaultValue DefaultView DelaunayMesh Delayed DeleteDuplicatesBy DeleteMissing DelimitedSequence DestroyAfterEvaluation DeviceClose DeviceConfigure DeviceExecute DeviceExecuteAsynchronous DeviceObject DeviceOpen DeviceOpenQ DeviceRead DeviceReadBuffer DeviceReadLatest DeviceReadList DeviceReadTimeSeries Devices DeviceStreams DeviceWrite DeviceWriteBuffer DiagonalizableMatrixQ DimensionalCombinations DimensionalMeshComponents DirichletBeta DirichletCondition DirichletEta DirichletLambda DiscretizeGraphics DiscretizeRegion DisjointQ DispatchQ DSolveValue
|
||||
|
||||
syntax keyword mmaSystemSymbol EarthImpactData EarthquakeData EclipseType EdgeContract EdgeCycleMatrix ElidedForms Ellipsoid EmbedCode EmbeddedHTML EmbeddingObject EmptyRegion EndOfBuffer EngineEnvironment Entity EntityClass EntityClassList EntityList EntityProperties EntityProperty EntityPropertyClass EntityTypeName EntityValue EstimatedBackground EvaluationBox EvaluationData EventSeries ExcludedLines ExcludedPhysicalQuantities ExecuteScheduledTask ExoplanetData ExportForm ExternalBundle ExternalFunctionName ExternalOptions ExternalTypeSignature Failure FailureAction FareySequence FeedbackLinearize Fibonorial FileTemplate FileTemplateApply FindCycle FindDevices FindEdgeIndependentPaths FindFundamentalCycles FindHiddenMarkovStates FindPath FindPeaks FindSpanningTree FindVertexIndependentPaths FirstCase FirstPosition FixedOrder FlowPolynomial FormatName FormFunction FormLayoutFunction FormObject FormTemplate FormTheme FormulaData FormulaLookup FractionalGaussianNoiseProcess FrenetSerretSystem FresnelF FresnelG FromEntity FullInformationOutputRegulator FullRegion FunctionDomain FunctionPeriod FunctionRange GalaxyData GARCHProcess GenerateDocument GeoBackground GeoBoundingBox GeoBounds GeoCenter GeoCircle GeoDisk GeoDisplacement GeoElevationData GeoEntities GeoGraphics GeoGridLines GeoGridLinesStyle GeoGroup GeoIdentify GeoLabels GeoListPlot GeoLocation GeologicalPeriodData GeoMarker GeoModel GeoNearest GeoPath GeoProjection GeoRange GeoRangePadding GeoRegionValuePlot GeoScaleBar GeoStyling GeoStylingImageFunction GeoVariant GeoVisibleRegion GeoVisibleRegionBoundary GeoWithinQ GeoZoomLevel Grammar GrammarToken Graph3D GraphAutomorphismGroup GroupBy GroupTogetherGrouping GroupTogetherNestedGrouping GrowCutComponents HalfLine HalfPlane HeaderLines Here HiddenMarkovProcess HighlightMesh HistoricalPeriodData HTTPRedirect HTTPRequestData HTTPResponse IconData IconRules IgnoringInactive ImageApplyIndexed ImageCollage ImageFormattingWidth ImageSaliencyFilter ImagingDevice ImplicitRegion Inactivate Inactive IncludeQuantities IncludeWindowTimes IndefiniteMatrixQ IndeterminateThreshold IndexBy InfiniteLine InfinitePlane InflationAdjust InflationMethod InlinePart InsertionFunction IntegerName Interpreter IntersectingQ IntervalSlider InverseTransformedRegion IslandData JoinAcross JuliaSetBoettcher JuliaSetIterationCount JuliaSetPlot JuliaSetPoints KEdgeConnectedComponents KEdgeConnectedGraphQ Key KeyComplement KeyDrop KeyDropFrom KeyExistsQ KeyFreeQ KeyIntersection KeyMap KeyMemberQ KeypointStrength KeyRenaming Keys KeySelect KeySort KeySortBy KeyTake KeyUnion KillProcess KVertexConnectedComponents KVertexConnectedGraphQ
|
||||
syntax keyword mmaSystemSymbol LABColor LakeData LaminaData LanguageData LCHColor LibraryDataType LinearGradientImage LinearizingTransformationData LinebreakSemicolonWeighting LinkRankCentrality LinkService ListFormat LocalAdaptiveBinarize LocalizeDefinitions LocalTime LocalTimeZone LogisticSigmoid Lookup LunarEclipse LUVColor ManagedLibraryExpressionID ManagedLibraryExpressionQ MandelbrotSetBoettcher MandelbrotSetDistance MandelbrotSetIterationCount MandelbrotSetMemberQ MandelbrotSetPlot MannedSpaceMissionData MaxCellMeasure MaximalBy MedicalTestData MemoryConstraint Merge MeshCellCentroid MeshCellCount MeshCellIndex MeshCellLabel MeshCellMarker MeshCellMeasure MeshCellQuality MeshCells MeshCellStyle MeshCoordinates MeshPrimitives MeshQualityGoal MeshRefinementFunction MeshRegion MeshRegionQ MeteorShowerData MinColorDistance MineralData MinimalBy MinimumTimeIncrement MinIntervalSize MinkowskiQuestionMark MinorPlanetData MissingBehavior MissingDataRules MissingString MissingStyle MixedGraphQ MoonPhase MoonPosition MountainData MovieData MovingMap Multicolumn MultigraphQ NebulaData NegativeDefiniteMatrixQ NegativeSemidefiniteMatrixQ NeighborhoodData NeumannValue NextScheduledTaskTime NightHemisphere NoneTrue NonlinearStateSpaceModel Normalized NormalMatrixQ NotebookTemplate Now NuclearExplosionData NuclearReactorData NumberLinePlot OceanData OptionalElement OrthogonalMatrixQ OverwriteTarget Package Parallelepiped Parallelogram ParametricRegion ParentBox ParentCell ParentNotebook ParkData Parse PartBehavior ParticleAcceleratorData PeakDetect Permissions PersonData PhaseRange PhysicalSystemData Pivot PlanckRadiationLaw PlaneCurveData PlanetaryMoonData PlanetData PlantData PlotRangeClipPlanesStyle PlotTheme Pluralize PositionIndex PositiveSemidefiniteMatrixQ PowerRange Predict PredictorFunction PredictorInformation PredictorMeasurements PrimitiveRootList ProcessConnection ProcessDirectory ProcessEnvironment Processes ProcessInformation ProcessObject ProcessStatus PulsarData Qualifiers QuantityThread QuantityVariable QuantityVariableCanonicalUnit QuantityVariableDimensions QuantityVariableIdentifier QuantityVariablePhysicalQuantity Query RadialGradientImage RandomColor ReadLine ReadString RegionBoundary RegionBounds RegionCentroid RegionDifference RegionDimension RegionDistance RegionDistanceFunction RegionEmbeddingDimension RegionIntersection RegionMeasure RegionMember RegionMemberFunction RegionNearest RegionNearestFunction RegionProduct RegionQ RegionSymmetricDifference RegionUnion RegularlySampledQ RemoveBackground RequiredPhysicalQuantities ResamplingMethod ResponseForm Restricted RiemannXi RightComposition RSolveValue RunProcess
|
||||
|
||||
syntax keyword mmaSystemSymbol SASTriangle SatelliteData SavitzkyGolayMatrix ScheduledTask ScorerGi ScorerGiPrime ScorerHi ScorerHiPrime ScriptForm SelectFirst SemanticImport SemanticImportString SemanticInterpretation SendMessage ServiceConnect ServiceDisconnect ServiceExecute ServiceObject SetCloudDirectory SiderealTime SignedRegionDistance Simplex SolarEclipse SolarSystemFeatureData SolidData SourceEntityType SpaceCurveData SpeciesData SquareMatrixQ SSSTriangle StandardAtmosphereData StarClusterData StarData StartProcess StateTransformationLinearize StringTemplate String$ SubsetQ SunPosition Sunrise Sunset SupernovaData SurfaceData SystemGet SystemsModelLinearity SystemsModelMerge SystemsModelVectorRelativeOrders TemplateApply TemplateExpression TemplateIf TemplateObject TemplateSequence TemplateSlot TemplateWith TemporalRegularity TestID TestReport TestReportObject TestResultObject TextLegend TextString ThermodynamicData ThreadDepth TimeDirection TimeFormat TimeObject Timeout TimeSeries TimeSeriesAggregate TimeSeriesInsert TimeSeriesMap TimeSeriesMapThread TimeSeriesModel TimeSeriesModelFit TimeSeriesResample TimeSeriesRescale TimeSeriesShift TimeSeriesThread TimeSeriesWindow TimeZoneConvert Today ToEntity Tomorrow TouchPosition TrackingFunction TransformationClass TransformedProcess TransformedRegion TransitionDirection TransitionDuration TransitionEffect TransitiveClosureGraph TransitiveReductionGraph TrapSelection Triangle TriangulateMesh TropicalStormData TunnelData TuttePolynomial UnderseaFeatureData UndoOptions UndoTrackedVariables UnitaryMatrixQ UnitSystem UnityDimensions UniversityData URLBuild URLDecode URLEncode URLExecute URLExistsQ URLExpand URLParse URLQueryDecode URLQueryEncode URLShorten UserDefinedWavelet UtilityFunction ValidateQuery ValidationSet ValueDimensions Values VerificationTest VertexContract VolcanoData Volume VoronoiMesh WhiteNoiseProcess WhitePoint WindDirectionData WindSpeedData WindVectorData WrapAround WriteLine XMLTemplate XYZColor Yesterday ZIPCodeData $CloudBase $CloudConnected $CloudCreditsAvailable $CloudEvaluation $CloudRootDirectory $CloudSymbolBase $EmbedCodeEnvironments $EvaluationCloudObject $EvaluationEnvironment $GeoEntityTypes $GeoLocationCity $GeoLocationCountry $GeoLocationPrecision $GeoLocationSource $HTMLExportRules $ImageFormattingWidth $ImagingDevice $InterpreterTypes $Permissions $PlotTheme $RegisteredDeviceClasses $RegisteredUserName $RequesterAddress $RequesterWolframID $RequesterWolframUUID $Services $SystemShell $TemplatePath $UnitSystem $UserAgentLanguages $UserAgentMachine $UserAgentName $UserAgentOperatingSystem $UserAgentString $UserAgentVersion $WolframID $WolframUUID
|
||||
|
||||
"User Symbols
|
||||
syntax match mmaSymbol "[^0-9][A-Za-z0-9`$]\+\s*\%([@[]\|/:\|/\=/@\)\@=" contains=mmaOperator,mmaSystemSymbol,mmaBrackets
|
||||
syntax match mmaSymbol "\<[^0-9][A-Za-z0-9`$]\+\>" contains=mmaOperator,mmaSystemSymbol,mmaBrackets
|
||||
syntax match mmaSymbol "\~\s*[^~]\+\s*\~"ms=s+1,me=e-1 contains=mmaOperator,mmaSystemSymbol,mmaBrackets
|
||||
syntax match mmaSymbol "//\s*[A-Za-z0-9`$]\+"ms=s+2 contains=mmaOperator,mmaSystemSymbol,mmaBrackets
|
||||
|
||||
"Comments and TODOs
|
||||
syntax keyword mmaTodo TODO FIX FIXME BUG contained
|
||||
syntax region mmaComment start=+(\*+ end=+\*)+ skipempty contains=mmaComment, mmaTodo
|
||||
|
||||
"Strings
|
||||
syntax region mmaString start=+"+ skip=+\(\\\)\@<!\\"+ end=+"+ skipempty
|
||||
|
||||
"Numbers
|
||||
syntax match mmaNumber "\<\%(\d\+\.\=\d*\|\d*\.\=\d\+\)\>"
|
||||
syntax match mmaNumber "\d\+`\d*\%(\d\@!\.\|\>\)"
|
||||
syntax match mmaNumber "[A-Za-z]\+`\d\+\%(\d\@!\.\|\>\)" contains=mmaSymbol,mmaSystemSymbol
|
||||
|
||||
"Slots & Slotsequences
|
||||
syntax match mmaSlot "#\%(#\d*\|\d\+\)\="
|
||||
syntax match mmaSlot "#\%([A-Za-z0-9`$]*\)"
|
||||
|
||||
"Patterns
|
||||
syntax match mmaPattern "[A-Za-z0-9`$]*_\{1,3}\%([A-Za-z0-9`$]\+\)\="
|
||||
syntax match mmaPatternName "[A-Za-z0-9`$]\+\s*:[^:=>]"me=e-2
|
||||
syntax match mmaPattern "[A-Za-z0-9`]*_\+\%([A-Za-z0-9`]\+\)"
|
||||
|
||||
"Brackets
|
||||
syntax match mmaBrackets "[({[}\])]" contained
|
||||
syntax match mmaBrackets "\%(<|\||>\)" contained
|
||||
|
||||
"OPERATORS
|
||||
"Apply, Postfix, MapAll, ReplaceRepeated
|
||||
syntax match mmaOperator "\%(@\{1,3}\|//[.@]\=\)"
|
||||
"Condition, TagSet*, UpSet*, Map, ReplaceAll
|
||||
syntax match mmaOperator "\%(/[;:@.]\=\|\^\=:\==\)"
|
||||
"Rule, RuleDelayed
|
||||
syntax match mmaOperator "\%([-:]\=>\|<=\=\)"
|
||||
"SubtractFrom, AddTo, TimesBy, DivideBy
|
||||
syntax match mmaOperator "[-+*/]="
|
||||
"Plus, Subtract, Times, Divide, Power, Optional/Default, PatternTest
|
||||
syntax match mmaOperator "[*+=^/.:?-]"
|
||||
"Infix, StringExpression
|
||||
syntax match mmaOperator "\%(\~\~\=\)"
|
||||
"Equal, SameQ, UnsameQ,
|
||||
syntax match mmaOperator "\%(=\{2,3}\|=\=!=\|||\=\|&&\|!\)"
|
||||
"Composition, RightComposition
|
||||
syntax match mmaOperator "\%(@\*\|\/\*\)"
|
||||
|
||||
"Special characters
|
||||
syntax match mmaSpecial "\\\[[A-Za-z0-9]\+\]"
|
||||
|
||||
"Messages
|
||||
syntax match mmaMessage "::\s*[A-Za-z0-9]\+"hs=s+2
|
||||
|
||||
"Highlighting
|
||||
if version >= 508 || !exists("did_mma_syn_inits")
|
||||
if version < 508
|
||||
let did_mma_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
if exists("g:mma_highlight_option")
|
||||
if g:mma_highlight_option == "default"
|
||||
"TODO implement default FE colors
|
||||
elseif g:mma_highlight_option == "solarized"
|
||||
HiLink mmaComment Comment
|
||||
HiLink mmaSymbol Function
|
||||
HiLink mmaSystemSymbol Normal
|
||||
HiLink mmaOperator Normal
|
||||
HiLink mmaSlot Operator
|
||||
HiLink mmaString String
|
||||
HiLink mmaSpecial Function
|
||||
HiLink mmaNumber Normal
|
||||
HiLink mmaPattern Operator
|
||||
HiLink mmaPatternName Operator
|
||||
HiLink mmaError Error
|
||||
HiLink mmaBracket Normal
|
||||
HiLink mmaTodo Todo
|
||||
HiLink mmaMessage Type
|
||||
endif
|
||||
else
|
||||
HiLink mmaComment Comment
|
||||
HiLink mmaSymbol Normal
|
||||
HiLink mmaSystemSymbol Function
|
||||
HiLink mmaOperator Operator
|
||||
HiLink mmaSlot Operator
|
||||
HiLink mmaString String
|
||||
HiLink mmaSpecial Normal
|
||||
HiLink mmaNumber Number
|
||||
HiLink mmaPattern Type
|
||||
HiLink mmaPatternName Type
|
||||
HiLink mmaBracket Normal
|
||||
HiLink mmaTodo Todo
|
||||
HiLink mmaMessage Type
|
||||
endif
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
let b:current_syntax = "mma"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,42 +0,0 @@
|
||||
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
|
||||
@@ -1,10 +0,0 @@
|
||||
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
|
||||
@@ -1,8 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,13 +0,0 @@
|
||||
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
|
||||
@@ -1,9 +0,0 @@
|
||||
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
|
||||
@@ -1,14 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,39 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Nginx-Clojure Module <http://nginx-clojure.github.io/index.html>
|
||||
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
|
||||
syn keyword ngxDirectiveThirdParty jvm_path
|
||||
syn keyword ngxDirectiveThirdParty jvm_var
|
||||
syn keyword ngxDirectiveThirdParty jvm_classpath
|
||||
syn keyword ngxDirectiveThirdParty jvm_classpath_check
|
||||
syn keyword ngxDirectiveThirdParty jvm_workers
|
||||
syn keyword ngxDirectiveThirdParty jvm_options
|
||||
syn keyword ngxDirectiveThirdParty jvm_handler_type
|
||||
syn keyword ngxDirectiveThirdParty jvm_init_handler_name
|
||||
syn keyword ngxDirectiveThirdParty jvm_init_handler_code
|
||||
syn keyword ngxDirectiveThirdParty jvm_exit_handler_name
|
||||
syn keyword ngxDirectiveThirdParty jvm_exit_handler_code
|
||||
syn keyword ngxDirectiveThirdParty handlers_lazy_init
|
||||
syn keyword ngxDirectiveThirdParty auto_upgrade_ws
|
||||
syn keyword ngxDirectiveThirdParty content_handler_type
|
||||
syn keyword ngxDirectiveThirdParty content_handler_name
|
||||
syn keyword ngxDirectiveThirdParty content_handler_code
|
||||
syn keyword ngxDirectiveThirdParty rewrite_handler_type
|
||||
syn keyword ngxDirectiveThirdParty rewrite_handler_name
|
||||
syn keyword ngxDirectiveThirdParty rewrite_handler_code
|
||||
syn keyword ngxDirectiveThirdParty access_handler_type
|
||||
syn keyword ngxDirectiveThirdParty access_handler_name
|
||||
syn keyword ngxDirectiveThirdParty access_handler_code
|
||||
syn keyword ngxDirectiveThirdParty header_filter_type
|
||||
syn keyword ngxDirectiveThirdParty header_filter_name
|
||||
syn keyword ngxDirectiveThirdParty header_filter_code
|
||||
syn keyword ngxDirectiveThirdParty content_handler_property
|
||||
syn keyword ngxDirectiveThirdParty rewrite_handler_property
|
||||
syn keyword ngxDirectiveThirdParty access_handler_property
|
||||
syn keyword ngxDirectiveThirdParty header_filter_property
|
||||
syn keyword ngxDirectiveThirdParty always_read_body
|
||||
syn keyword ngxDirectiveThirdParty shared_map
|
||||
syn keyword ngxDirectiveThirdParty write_page_size
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Upstream Consistent Hash <https://www.nginx.com/resources/wiki/modules/consistent_hash/>
|
||||
" A load balancer that uses an internal consistent hash ring to select the right backend node.
|
||||
syn keyword ngxDirectiveThirdParty consistent_hash
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,10 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Nginx Development Kit <https://github.com/simpl/ngx_devel_kit>
|
||||
" The NDK is an Nginx module that is designed to extend the core functionality of the excellent Nginx webserver in a way that can be used as a basis of other Nginx modules.
|
||||
" NDK_UPSTREAM_LIST
|
||||
" This submodule provides a directive that creates a list of upstreams, with optional weighting. This list can then be used by other modules to hash over the upstreams however they choose.
|
||||
syn keyword ngxDirectiveThirdParty upstream_list
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,18 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Drizzle Module <https://www.nginx.com/resources/wiki/modules/drizzle/>
|
||||
" Upstream module for talking to MySQL and Drizzle directly
|
||||
syn keyword ngxDirectiveThirdParty drizzle_server
|
||||
syn keyword ngxDirectiveThirdParty drizzle_keepalive
|
||||
syn keyword ngxDirectiveThirdParty drizzle_query
|
||||
syn keyword ngxDirectiveThirdParty drizzle_pass
|
||||
syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
|
||||
syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
|
||||
syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
|
||||
syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
|
||||
syn keyword ngxDirectiveThirdParty drizzle_buffer_size
|
||||
syn keyword ngxDirectiveThirdParty drizzle_module_header
|
||||
syn keyword ngxDirectiveThirdParty drizzle_status
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Dynamic ETags Module <https://github.com/kali/nginx-dynamic-etags>
|
||||
" Attempt at handling ETag / If-None-Match on proxied content.
|
||||
syn keyword ngxDirectiveThirdParty dynamic_etags
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,25 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Echo Module <https://www.nginx.com/resources/wiki/modules/echo/>
|
||||
" Bringing the power of "echo", "sleep", "time" and more to Nginx's config file
|
||||
syn keyword ngxDirectiveThirdParty echo
|
||||
syn keyword ngxDirectiveThirdParty echo_duplicate
|
||||
syn keyword ngxDirectiveThirdParty echo_flush
|
||||
syn keyword ngxDirectiveThirdParty echo_sleep
|
||||
syn keyword ngxDirectiveThirdParty echo_blocking_sleep
|
||||
syn keyword ngxDirectiveThirdParty echo_reset_timer
|
||||
syn keyword ngxDirectiveThirdParty echo_read_request_body
|
||||
syn keyword ngxDirectiveThirdParty echo_location_async
|
||||
syn keyword ngxDirectiveThirdParty echo_location
|
||||
syn keyword ngxDirectiveThirdParty echo_subrequest_async
|
||||
syn keyword ngxDirectiveThirdParty echo_subrequest
|
||||
syn keyword ngxDirectiveThirdParty echo_foreach_split
|
||||
syn keyword ngxDirectiveThirdParty echo_end
|
||||
syn keyword ngxDirectiveThirdParty echo_request_body
|
||||
syn keyword ngxDirectiveThirdParty echo_exec
|
||||
syn keyword ngxDirectiveThirdParty echo_status
|
||||
syn keyword ngxDirectiveThirdParty echo_before_body
|
||||
syn keyword ngxDirectiveThirdParty echo_after_body
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,12 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Encrypted Session Module <https://github.com/openresty/encrypted-session-nginx-module>
|
||||
" Encrypt and decrypt nginx variable values
|
||||
syn keyword ngxDirectiveThirdParty encrypted_session_key
|
||||
syn keyword ngxDirectiveThirdParty encrypted_session_iv
|
||||
syn keyword ngxDirectiveThirdParty encrypted_session_expires
|
||||
syn keyword ngxDirectiveThirdParty set_encrypt_session
|
||||
syn keyword ngxDirectiveThirdParty set_decrypt_session
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,19 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Enhanced Memcached Module <https://github.com/bpaquet/ngx_http_enhanced_memcached_module>
|
||||
" This module is based on the standard Nginx Memcached module, with some additonal features
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_pass
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_hash_keys_with_md5
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_put
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_delete
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_stats
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_flush
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_flush_namespace
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_bind
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_connect_timeout
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_send_timeout
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_buffer_size
|
||||
syn keyword ngxDirectiveThirdParty enhanced_memcached_read_timeout
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Events Module (DEPRECATED) <http://docs.dutov.org/nginx_modules_events_en.html>
|
||||
" Provides options for start/stop events.
|
||||
syn keyword ngxDirectiveDeprecated on_start
|
||||
syn keyword ngxDirectiveDeprecated on_stop
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,10 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" EY Balancer Module <https://github.com/ezmobius/nginx-ey-balancer>
|
||||
" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
|
||||
syn keyword ngxDirectiveThirdParty max_connections
|
||||
syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
|
||||
syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Upstream Fair Balancer <https://www.nginx.com/resources/wiki/modules/fair_balancer/>
|
||||
" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
|
||||
syn keyword ngxDirectiveThirdParty fair
|
||||
syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,20 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Fancy Indexes Module <https://github.com/aperezdc/ngx-fancyindex>
|
||||
" Like the built-in autoindex module, but fancier.
|
||||
syn keyword ngxDirectiveThirdParty fancyindex
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_default_sort
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_directories_first
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_css_href
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_exact_size
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_name_length
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_footer
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_header
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_show_path
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_ignore
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_hide_symlinks
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_localtime
|
||||
syn keyword ngxDirectiveThirdParty fancyindex_time_format
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,12 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Form Auth Module <https://github.com/veruu/ngx_form_auth>
|
||||
" Provides authentication and authorization with credentials submitted via POST request
|
||||
syn keyword ngxDirectiveThirdParty form_auth
|
||||
syn keyword ngxDirectiveThirdParty form_auth_pam_service
|
||||
syn keyword ngxDirectiveThirdParty form_auth_login
|
||||
syn keyword ngxDirectiveThirdParty form_auth_password
|
||||
syn keyword ngxDirectiveThirdParty form_auth_remote_user
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Form Input Module <https://github.com/calio/form-input-nginx-module>
|
||||
" Reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded" and parses the arguments into nginx variables.
|
||||
syn keyword ngxDirectiveThirdParty set_form_input
|
||||
syn keyword ngxDirectiveThirdParty set_form_input_multi
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
|
||||
" Country code lookups via the MaxMind GeoIP API.
|
||||
syn keyword ngxDirectiveDeprecated geoip_country_file
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" GeoIP 2 Module <https://github.com/leev/ngx_http_geoip2_module>
|
||||
" Creates variables with values from the maxmind geoip2 databases based on the client IP
|
||||
syn keyword ngxDirectiveThirdParty geoip2
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,8 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" GridFS Module <https://github.com/mdirolf/nginx-gridfs>
|
||||
" Nginx module for serving files from MongoDB's GridFS
|
||||
syn keyword ngxDirectiveThirdParty gridfs
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,11 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Headers More Module <https://github.com/openresty/headers-more-nginx-module>
|
||||
" Set and clear input and output headers...more than "add"!
|
||||
syn keyword ngxDirectiveThirdParty more_clear_headers
|
||||
syn keyword ngxDirectiveThirdParty more_clear_input_headers
|
||||
syn keyword ngxDirectiveThirdParty more_set_headers
|
||||
syn keyword ngxDirectiveThirdParty more_set_input_headers
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,15 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Health Checks Upstreams Module <https://www.nginx.com/resources/wiki/modules/healthcheck/>
|
||||
" Polls backends and if they respond with HTTP 200 + an optional request body, they are marked good. Otherwise, they are marked bad.
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_enabled
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_delay
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_timeout
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_failcount
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_send
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_expected
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_buffer
|
||||
syn keyword ngxDirectiveThirdParty healthcheck_status
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,12 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" HTTP Accounting Module <https://github.com/Lax/ngx_http_accounting_module>
|
||||
" Add traffic stat function to nginx. Useful for http accounting based on nginx configuration logic
|
||||
syn keyword ngxDirectiveThirdParty http_accounting
|
||||
syn keyword ngxDirectiveThirdParty http_accounting_log
|
||||
syn keyword ngxDirectiveThirdParty http_accounting_id
|
||||
syn keyword ngxDirectiveThirdParty http_accounting_interval
|
||||
syn keyword ngxDirectiveThirdParty http_accounting_perturb
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,13 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
" Nginx Digest Authentication module <https://github.com/atomx/nginx-http-auth-digest>
|
||||
" Digest Authentication for Nginx
|
||||
syn keyword ngxDirectiveThirdParty auth_digest
|
||||
syn keyword ngxDirectiveThirdParty auth_digest_user_file
|
||||
syn keyword ngxDirectiveThirdParty auth_digest_timeout
|
||||
syn keyword ngxDirectiveThirdParty auth_digest_expires
|
||||
syn keyword ngxDirectiveThirdParty auth_digest_replays
|
||||
syn keyword ngxDirectiveThirdParty auth_digest_shm_size
|
||||
|
||||
|
||||
endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user