mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 03:53:52 -05:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2edc785a5e | ||
|
|
445e026010 | ||
|
|
fca45b2c2b | ||
|
|
ebf9ec9d62 | ||
|
|
9caa678708 | ||
|
|
8f2a71643a | ||
|
|
af763ef221 | ||
|
|
5ded0682bd | ||
|
|
26c678b08d | ||
|
|
17ecfbdabc | ||
|
|
0217fb50fe | ||
|
|
5023da62ec | ||
|
|
957228cc25 | ||
|
|
7aae831309 | ||
|
|
671078ef6c | ||
|
|
aebef2c2e7 | ||
|
|
e8245dbf17 | ||
|
|
9fd5c11a20 | ||
|
|
679ccf0303 | ||
|
|
eacf785f5a | ||
|
|
83bd298476 | ||
|
|
415261dd1f | ||
|
|
4d18a5e5dd | ||
|
|
a55b6aa3aa | ||
|
|
1d45a6d4f0 |
@@ -7,6 +7,5 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- vim-gtk
|
- vim-gtk
|
||||||
before_script:
|
before_script:
|
||||||
- "export DISPLAY=:99.0"
|
- "./build"
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
script: xvfb-run bundle exec rspec --format=documentation
|
||||||
script: bundle exec rspec --format=documentation
|
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -10,7 +10,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.
|
> 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 **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||||
- It **installs and updates 100+ times faster** than the <!--Package Count-->133<!--/Package Count--> packages it consists of.
|
- It **installs and updates 120+ times faster** than the <!--Package Count-->143<!--/Package Count--> packages it consists of.
|
||||||
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
||||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||||
@@ -68,6 +68,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
|
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
|
||||||
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax)
|
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax)
|
||||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin)
|
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin)
|
||||||
|
- [dlang](https://github.com/JesseKPhillips/d.vim) (syntax, indent)
|
||||||
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
|
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin)
|
- [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin)
|
||||||
@@ -84,7 +85,6 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
|
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
|
||||||
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent)
|
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent)
|
||||||
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
||||||
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, ftplugin)
|
|
||||||
- [groovy-indent](https://github.com/vim-scripts/groovyindent-unix) (indent)
|
- [groovy-indent](https://github.com/vim-scripts/groovyindent-unix) (indent)
|
||||||
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
|
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
|
||||||
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
||||||
@@ -92,9 +92,12 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
||||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
||||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||||
|
- [hcl](https://github.com/b4b4r07/vim-hcl) (syntax, indent, ftplugin)
|
||||||
|
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
|
||||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
||||||
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
||||||
|
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
||||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
|
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
|
||||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
||||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
||||||
@@ -102,19 +105,19 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
||||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||||
- [jsx](https://github.com/amadeus/vim-jsx) (syntax, indent, ftplugin)
|
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, syntax, indent, ftplugin)
|
||||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin)
|
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin)
|
||||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
||||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
|
||||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
||||||
- [llvm](https://github.com/rhysd/vim-llvm) (syntax, indent, ftplugin)
|
- [llvm](https://github.com/rhysd/vim-llvm) (syntax, indent, ftplugin)
|
||||||
|
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax)
|
||||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
||||||
- [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin)
|
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin)
|
||||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
||||||
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
||||||
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
|
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
|
||||||
@@ -126,7 +129,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
||||||
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
|
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
|
||||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
|
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
|
||||||
- [pgsql](https://github.com/exu/pgsql.vim) (syntax)
|
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent)
|
||||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
||||||
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
|
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
|
||||||
@@ -141,31 +144,36 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [qmake](https://github.com/artoj/qmake-syntax-vim) (syntax)
|
- [qmake](https://github.com/artoj/qmake-syntax-vim) (syntax)
|
||||||
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin)
|
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin)
|
||||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
||||||
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, autoload, ftplugin)
|
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, ftplugin)
|
||||||
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
||||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
||||||
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
||||||
|
- [rego](https://github.com/tsandall/vim-rego) (syntax)
|
||||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax)
|
- [rspec](https://github.com/sheerun/rspec.vim) (syntax)
|
||||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin)
|
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin)
|
||||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
- [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)
|
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
||||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
|
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
|
||||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin)
|
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin)
|
||||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
||||||
|
- [styled-components](https://github.com/styled-components/vim-styled-components#main) (syntax, indent, ftplugin)
|
||||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||||
|
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
||||||
|
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
||||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
|
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
|
||||||
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
|
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
|
||||||
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax)
|
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax)
|
||||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftplugin)
|
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, ftplugin)
|
||||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
||||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||||
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin)
|
- [tmux](https://github.com/ericpruitt/tmux.vim) ()
|
||||||
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
||||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin)
|
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin)
|
||||||
|
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin)
|
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin)
|
||||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
||||||
@@ -174,10 +182,12 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
||||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||||
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
||||||
|
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (syntax)
|
||||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||||
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
||||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
|
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
||||||
<!--/Language Packs-->
|
<!--/Language Packs-->
|
||||||
|
|
||||||
## Updating
|
## Updating
|
||||||
|
|||||||
@@ -14,3 +14,75 @@ if exists('b:undo_ftplugin')
|
|||||||
else
|
else
|
||||||
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
||||||
endif
|
endif
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim ftplugin file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" modified from html.vim
|
||||||
|
" For matchit plugin
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" For andymass/vim-matchup plugin
|
||||||
|
if exists("loaded_matchup")
|
||||||
|
setlocal matchpairs=(:),{:},[:],<:>
|
||||||
|
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||||
|
let b:match_skip = 's:comment\|string'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:original_commentstring = &l:commentstring
|
||||||
|
|
||||||
|
augroup jsx_comment
|
||||||
|
autocmd! CursorMoved <buffer>
|
||||||
|
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
setlocal suffixesadd+=.jsx
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: styled-components (js/ts)
|
||||||
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
|
|
||||||
|
fu! s:GetSyntaxNames(lnum, cnum)
|
||||||
|
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" re-implement SynSOL of vim-jsx
|
||||||
|
fu! s:SynSOL(lnum)
|
||||||
|
return s:GetSyntaxNames(a:lnum, 1)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Return whether the current line is a jsTemplateString
|
||||||
|
fu! IsStyledDefinition(lnum)
|
||||||
|
" iterate through all syntax items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if syntax-item is a jsTemplateString return 1 - true
|
||||||
|
" `==#` is a match case comparison of the item
|
||||||
|
if item ==# 'styledDefinition'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" fallback to 0 - false
|
||||||
|
return 0
|
||||||
|
endfu
|
||||||
|
|
||||||
|
if exists('&ofu')
|
||||||
|
let b:prevofu=&ofu
|
||||||
|
setl omnifunc=styledcomplete#CompleteSC
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim ftplugin file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" modified from html.vim
|
|
||||||
if exists("loaded_matchit")
|
|
||||||
let b:match_ignorecase = 0
|
|
||||||
let s:jsx_match_words = '<\([a-zA-Z0-9.]\+\)\(>\|$\|\s\):<\/\1>'
|
|
||||||
|
|
||||||
if !exists('b:loaded_jsx_match_words')
|
|
||||||
let b:loaded_jsx_match_words = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if b:loaded_jsx_match_words == 0
|
|
||||||
let b:match_words = exists('b:match_words')
|
|
||||||
\ ? b:match_words . ',' . s:jsx_match_words
|
|
||||||
\ : s:jsx_match_words
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:loaded_jsx_match_words = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal suffixesadd+=.jsx
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_align')
|
|
||||||
let g:terraform_align = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_remap_spacebar')
|
|
||||||
let g:terraform_remap_spacebar = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_fold_sections')
|
|
||||||
let g:terraform_fold_sections = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:terraform_align && exists(':Tabularize')
|
|
||||||
inoremap <buffer> <silent> = =<Esc>:call <SID>terraformalign()<CR>a
|
|
||||||
function! s:terraformalign()
|
|
||||||
let p = '^.*=[^>]*$'
|
|
||||||
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
|
||||||
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
|
|
||||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
|
|
||||||
Tabularize/=/l1
|
|
||||||
normal! 0
|
|
||||||
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:terraform_fold_sections
|
|
||||||
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"
|
|
||||||
elseif match(thisline, '^data') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^terraform') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^locals') >= 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()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Re-map the space bar to fold and unfold
|
|
||||||
if get(g:, "terraform_remap_spacebar", 1)
|
|
||||||
"inoremap <space> <C-O>za
|
|
||||||
nnoremap <space> za
|
|
||||||
onoremap <space> <C-C>za
|
|
||||||
vnoremap <space> zf
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 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
|
|
||||||
|
|
||||||
" Set the commentstring
|
|
||||||
if exists('g:terraform_commentstring')
|
|
||||||
let &l:commentstring=g:terraform_commentstring
|
|
||||||
else
|
|
||||||
setlocal commentstring=#%s
|
|
||||||
endif
|
|
||||||
27
after/ftplugin/typescript.vim
Normal file
27
after/ftplugin/typescript.vim
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" modified from html.vim
|
||||||
|
" For matchit plugin
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" For andymass/vim-matchup plugin
|
||||||
|
if exists("loaded_matchup")
|
||||||
|
setlocal matchpairs=(:),{:},[:],<:>
|
||||||
|
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||||
|
let b:match_skip = 's:comment\|string'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:original_commentstring = &l:commentstring
|
||||||
|
|
||||||
|
augroup jsx_comment
|
||||||
|
autocmd! CursorMoved <buffer>
|
||||||
|
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
setlocal suffixesadd+=.tsx
|
||||||
206
after/indent/javascript.vim
Normal file
206
after/indent/javascript.vim
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim indent file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if exists('b:did_indent')
|
||||||
|
let s:did_indent = b:did_indent
|
||||||
|
unlet b:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists('s:did_indent')
|
||||||
|
let b:did_indent = s:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal indentexpr=GetJsxIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
||||||
|
|
||||||
|
function! GetJsxIndent()
|
||||||
|
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: styled-components (js/ts)
|
||||||
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
|
|
||||||
|
" initialize variable to check, if the indentation expression is run
|
||||||
|
" multiple times in a row, which indicates an infinite recursion
|
||||||
|
let s:is_recursion = 0
|
||||||
|
|
||||||
|
" store current indentexpr for later
|
||||||
|
let b:js_ts_indent=&indentexpr
|
||||||
|
|
||||||
|
" set indentexpr for this filetype (styled-components)
|
||||||
|
setlocal indentexpr=GetStyledIndent()
|
||||||
|
|
||||||
|
" add the following keys to trigger reindenting, when in insert mode
|
||||||
|
" - *; - Indent and insert on press of ';' key.
|
||||||
|
" - *<:> - Indent and insert on press of ':' key.
|
||||||
|
set indentkeys+=*;,*<:>,*<Return>
|
||||||
|
|
||||||
|
fu! s:GetSyntaxNames(lnum, cnum)
|
||||||
|
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" re-implement SynSOL of vim-jsx
|
||||||
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
|
fu! s:SynSOL(lnum)
|
||||||
|
return s:GetSyntaxNames(a:lnum, 1)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" re-implement SynEOL of vim-jsx
|
||||||
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
|
fu! s:SynEOL(lnum, offset)
|
||||||
|
let l:lnum = prevnonblank(a:lnum)
|
||||||
|
let l:col = strlen(getline(l:lnum))
|
||||||
|
|
||||||
|
return s:GetSyntaxNames(l:lnum, l:col + a:offset)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
|
||||||
|
"" Return whether the current line is a jsTemplateString
|
||||||
|
fu! s:IsStyledDefinition(lnum)
|
||||||
|
" iterate through all syntax items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if syntax-item is a jsTemplateString return 1 - true
|
||||||
|
" `==#` is a match case comparison of the item
|
||||||
|
if item ==# 'styledDefinition'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" fallback to 0 - false
|
||||||
|
return 0
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Count occurences of `str` at the beginning of the given `lnum` line
|
||||||
|
fu! s:CountOccurencesInSOL(lnum, str)
|
||||||
|
let l:occurence = 0
|
||||||
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case isensitive equal operation
|
||||||
|
if item ==? a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Count occurences of `str` at the end of the given `lnum` line
|
||||||
|
fu! s:CountOccurencesInEOL(lnum, str, offset)
|
||||||
|
let l:occurence = 0
|
||||||
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynEOL(a:lnum, a:offset)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case insensitive equal operation
|
||||||
|
if item == a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Get the indentation of the current line
|
||||||
|
fu! GetStyledIndent()
|
||||||
|
if s:IsStyledDefinition(v:lnum)
|
||||||
|
let l:baseIndent = 0
|
||||||
|
|
||||||
|
" find last non-styled line
|
||||||
|
let l:cnum = v:lnum
|
||||||
|
while s:IsStyledDefinition(l:cnum)
|
||||||
|
let l:cnum -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" get indentation of the last non-styled line as base indentation
|
||||||
|
let l:baseIndent = indent(l:cnum)
|
||||||
|
|
||||||
|
" incrementally build indentation based on current indentation
|
||||||
|
" - one shiftwidth for the styled definition region
|
||||||
|
" - one shiftwidth per open nested definition region
|
||||||
|
let l:styledIndent = &sw
|
||||||
|
let l:styledIndent += min([
|
||||||
|
\ s:CountOccurencesInSOL(v:lnum, 'styledNestedRegion'),
|
||||||
|
\ s:CountOccurencesInEOL(v:lnum, 'styledNestedRegion', 0)
|
||||||
|
\ ]) * &sw
|
||||||
|
|
||||||
|
" decrease indentation by one shiftwidth, if the styled definition
|
||||||
|
" region ends on the current line
|
||||||
|
" - either directly via styled definition region, or
|
||||||
|
" - if the very last
|
||||||
|
if s:CountOccurencesInEOL(v:lnum, 'styledDefinition', 1) == 0
|
||||||
|
let l:styledIndent -= &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" return the base indentation
|
||||||
|
" (for nested styles inside classes/objects/etc.) plus the actual
|
||||||
|
" indentation inside the styled definition region
|
||||||
|
return l:baseIndent + l:styledIndent
|
||||||
|
elseif len(b:js_ts_indent)
|
||||||
|
let l:result = 0
|
||||||
|
let l:offset = 0
|
||||||
|
|
||||||
|
" increase indentation by one shiftwidth, if the last line ended on a
|
||||||
|
" styledXmlRegion and this line does not continue with it
|
||||||
|
" this is a fix for an incorrectly indented xml prop after a
|
||||||
|
" glamor-styled styledXmlRegion
|
||||||
|
if s:CountOccurencesInEOL(v:lnum-1, 'styledXmlRegion', 0) == 1 &&
|
||||||
|
\ s:CountOccurencesInSOL(v:lnum, 'styledXmlRegion') == 0
|
||||||
|
let l:offset = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" make sure `GetStyledIndent` and `GetJsxIndent` don't infinitely
|
||||||
|
" recurse by incrementing a counter variable, before evaluating the
|
||||||
|
" stored indent expression
|
||||||
|
if s:is_recursion == 0
|
||||||
|
let s:is_recursion = 1
|
||||||
|
let l:result = eval(b:js_ts_indent)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" `is_recursion` being 0 at this point indicates, that
|
||||||
|
" `eval(b:js_ts_indent)` did itself evaluate it's stored indentexpr
|
||||||
|
" and thus it can be assumed, that the current line should be
|
||||||
|
" indented as JS
|
||||||
|
if s:is_recursion == 0
|
||||||
|
" use one of `GetJavascriptIndent` or `GetJsIndent` if existing
|
||||||
|
" fallback to cindent, if not
|
||||||
|
if exists('*GetJavascriptIndent')
|
||||||
|
let l:result = GetJavascriptIndent()
|
||||||
|
elseif exists('*GetJsIndent')
|
||||||
|
let l:result = GetJsIndent()
|
||||||
|
else
|
||||||
|
let l:result = cindent(v:lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" reset `is_recursion` counter and return the indentation value
|
||||||
|
let s:is_recursion = 0
|
||||||
|
return l:result + l:offset
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if all else fails indent according to C-syntax
|
||||||
|
return cindent(v:lnum)
|
||||||
|
endfu
|
||||||
@@ -1,118 +1,173 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
" Vim syntax file
|
||||||
" Vim indent file
|
" Language: styled-components (js/ts)
|
||||||
"
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
" Language: JSX (JavaScript)
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" Save the current JavaScript indentexpr.
|
" initialize variable to check, if the indentation expression is run
|
||||||
let b:jsx_js_indentexpr = &indentexpr
|
" multiple times in a row, which indicates an infinite recursion
|
||||||
|
let s:is_recursion = 0
|
||||||
|
|
||||||
" Prologue; load in XML indentation.
|
" store current indentexpr for later
|
||||||
if exists('b:did_indent')
|
let b:js_ts_indent=&indentexpr
|
||||||
let s:did_indent=b:did_indent
|
|
||||||
unlet b:did_indent
|
|
||||||
endif
|
|
||||||
exe 'runtime! indent/xml.vim'
|
|
||||||
if exists('s:did_indent')
|
|
||||||
let b:did_indent=s:did_indent
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal indentexpr=GetJsxIndent()
|
" set indentexpr for this filetype (styled-components)
|
||||||
|
setlocal indentexpr=GetStyledIndent()
|
||||||
|
|
||||||
" JS indentkeys
|
" add the following keys to trigger reindenting, when in insert mode
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
" - *; - Indent and insert on press of ';' key.
|
||||||
" XML indentkeys
|
" - *<:> - Indent and insert on press of ':' key.
|
||||||
setlocal indentkeys+=*<Return>,<>>,<<>,/
|
set indentkeys+=*;,*<:>,*<Return>
|
||||||
|
|
||||||
" Multiline end tag regex (line beginning with '>' or '/>')
|
fu! s:GetSyntaxNames(lnum, cnum)
|
||||||
let s:endtag = '^\s*\/\?>\s*;\='
|
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
|
||||||
|
|
||||||
" Get all syntax types at the beginning of a given line.
|
|
||||||
fu! SynSOL(lnum)
|
|
||||||
return map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
|
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Get all syntax types at the end of a given line.
|
" re-implement SynSOL of vim-jsx
|
||||||
fu! SynEOL(lnum)
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
let lnum = prevnonblank(a:lnum)
|
fu! s:SynSOL(lnum)
|
||||||
let col = strlen(getline(lnum))
|
return s:GetSyntaxNames(a:lnum, 1)
|
||||||
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Check if a syntax attribute is XMLish.
|
" re-implement SynEOL of vim-jsx
|
||||||
fu! SynAttrXMLish(synattr)
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
return a:synattr =~ "^xml" || a:synattr =~ "^jsx"
|
fu! s:SynEOL(lnum, offset)
|
||||||
|
let l:lnum = prevnonblank(a:lnum)
|
||||||
|
let l:col = strlen(getline(l:lnum))
|
||||||
|
|
||||||
|
return s:GetSyntaxNames(l:lnum, l:col + a:offset)
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Check if a synstack is XMLish (i.e., has an XMLish last attribute).
|
|
||||||
fu! SynXMLish(syns)
|
"" Return whether the current line is a jsTemplateString
|
||||||
return SynAttrXMLish(get(a:syns, -1))
|
fu! s:IsStyledDefinition(lnum)
|
||||||
|
" iterate through all syntax items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if syntax-item is a jsTemplateString return 1 - true
|
||||||
|
" `==#` is a match case comparison of the item
|
||||||
|
if item ==# 'styledDefinition'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" fallback to 0 - false
|
||||||
|
return 0
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Check if a synstack denotes the end of a JSX block.
|
"" Count occurences of `str` at the beginning of the given `lnum` line
|
||||||
fu! SynJSXBlockEnd(syns)
|
fu! s:CountOccurencesInSOL(lnum, str)
|
||||||
return get(a:syns, -1) =~ '\%(js\|javascript\)Braces' &&
|
let l:occurence = 0
|
||||||
\ SynAttrXMLish(get(a:syns, -2))
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case isensitive equal operation
|
||||||
|
if item ==? a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Determine how many jsxRegions deep a synstack is.
|
"" Count occurences of `str` at the end of the given `lnum` line
|
||||||
fu! SynJSXDepth(syns)
|
fu! s:CountOccurencesInEOL(lnum, str, offset)
|
||||||
return len(filter(copy(a:syns), 'v:val ==# "jsxRegion"'))
|
let l:occurence = 0
|
||||||
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynEOL(a:lnum, a:offset)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case insensitive equal operation
|
||||||
|
if item == a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
" Check whether `cursyn' continues the same jsxRegion as `prevsyn'.
|
"" Get the indentation of the current line
|
||||||
fu! SynJSXContinues(cursyn, prevsyn)
|
fu! GetStyledIndent()
|
||||||
let curdepth = SynJSXDepth(a:cursyn)
|
if s:IsStyledDefinition(v:lnum)
|
||||||
let prevdepth = SynJSXDepth(a:prevsyn)
|
let l:baseIndent = 0
|
||||||
|
|
||||||
" In most places, we expect the nesting depths to be the same between any
|
" find last non-styled line
|
||||||
" two consecutive positions within a jsxRegion (e.g., between a parent and
|
let l:cnum = v:lnum
|
||||||
" child node, between two JSX attributes, etc.). The exception is between
|
while s:IsStyledDefinition(l:cnum)
|
||||||
" sibling nodes, where after a completed element (with depth N), we return
|
let l:cnum -= 1
|
||||||
" to the parent's nesting (depth N - 1). This case is easily detected,
|
endwhile
|
||||||
" since it is the only time when the top syntax element in the synstack is
|
|
||||||
" jsxRegion---specifically, the jsxRegion corresponding to the parent.
|
|
||||||
return prevdepth == curdepth ||
|
|
||||||
\ (prevdepth == curdepth + 1 && get(a:cursyn, -1) ==# 'jsxRegion')
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Cleverly mix JS and XML indentation.
|
" get indentation of the last non-styled line as base indentation
|
||||||
fu! GetJsxIndent()
|
let l:baseIndent = indent(l:cnum)
|
||||||
let cursyn = SynSOL(v:lnum)
|
|
||||||
let prevsyn = SynEOL(v:lnum - 1)
|
|
||||||
|
|
||||||
" Use XML indenting iff:
|
" incrementally build indentation based on current indentation
|
||||||
" - the syntax at the end of the previous line was either JSX or was the
|
" - one shiftwidth for the styled definition region
|
||||||
" closing brace of a jsBlock whose parent syntax was JSX; and
|
" - one shiftwidth per open nested definition region
|
||||||
" - the current line continues the same jsxRegion as the previous line.
|
let l:styledIndent = &sw
|
||||||
if (SynXMLish(prevsyn) || SynJSXBlockEnd(prevsyn)) &&
|
let l:styledIndent += min([
|
||||||
\ SynJSXContinues(cursyn, prevsyn)
|
\ s:CountOccurencesInSOL(v:lnum, 'styledNestedRegion'),
|
||||||
let ind = XmlIndentGet(v:lnum, 0)
|
\ s:CountOccurencesInEOL(v:lnum, 'styledNestedRegion', 0)
|
||||||
|
\ ]) * &sw
|
||||||
|
|
||||||
" Align '/>' and '>' with '<' for multiline tags.
|
" decrease indentation by one shiftwidth, if the styled definition
|
||||||
if getline(v:lnum) =~? s:endtag
|
" region ends on the current line
|
||||||
let ind = ind - &sw
|
" - either directly via styled definition region, or
|
||||||
|
" - if the very last
|
||||||
|
if s:CountOccurencesInEOL(v:lnum, 'styledDefinition', 1) == 0
|
||||||
|
let l:styledIndent -= &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Then correct the indentation of any JSX following '/>' or '>'.
|
" return the base indentation
|
||||||
if getline(v:lnum - 1) =~? s:endtag
|
" (for nested styles inside classes/objects/etc.) plus the actual
|
||||||
let ind = ind + &sw
|
" indentation inside the styled definition region
|
||||||
|
return l:baseIndent + l:styledIndent
|
||||||
|
elseif len(b:js_ts_indent)
|
||||||
|
let l:result = 0
|
||||||
|
let l:offset = 0
|
||||||
|
|
||||||
|
" increase indentation by one shiftwidth, if the last line ended on a
|
||||||
|
" styledXmlRegion and this line does not continue with it
|
||||||
|
" this is a fix for an incorrectly indented xml prop after a
|
||||||
|
" glamor-styled styledXmlRegion
|
||||||
|
if s:CountOccurencesInEOL(v:lnum-1, 'styledXmlRegion', 0) == 1 &&
|
||||||
|
\ s:CountOccurencesInSOL(v:lnum, 'styledXmlRegion') == 0
|
||||||
|
let l:offset = &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" make sure `GetStyledIndent` and `GetJsxIndent` don't infinitely
|
||||||
|
" recurse by incrementing a counter variable, before evaluating the
|
||||||
|
" stored indent expression
|
||||||
|
if s:is_recursion == 0
|
||||||
|
let s:is_recursion = 1
|
||||||
|
let l:result = eval(b:js_ts_indent)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" `is_recursion` being 0 at this point indicates, that
|
||||||
|
" `eval(b:js_ts_indent)` did itself evaluate it's stored indentexpr
|
||||||
|
" and thus it can be assumed, that the current line should be
|
||||||
|
" indented as JS
|
||||||
|
if s:is_recursion == 0
|
||||||
|
" use one of `GetJavascriptIndent` or `GetJsIndent` if existing
|
||||||
|
" fallback to cindent, if not
|
||||||
|
if exists('*GetJavascriptIndent')
|
||||||
|
let l:result = GetJavascriptIndent()
|
||||||
|
elseif exists('*GetJsIndent')
|
||||||
|
let l:result = GetJsIndent()
|
||||||
else
|
else
|
||||||
if len(b:jsx_js_indentexpr)
|
let l:result = cindent(v:lnum)
|
||||||
" Invoke the base JS package's custom indenter. (For vim-javascript,
|
|
||||||
" e.g., this will be GetJavascriptIndent().)
|
|
||||||
let ind = eval(b:jsx_js_indentexpr)
|
|
||||||
else
|
|
||||||
let ind = cindent(v:lnum)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ind
|
" reset `is_recursion` counter and return the indentation value
|
||||||
|
let s:is_recursion = 0
|
||||||
|
return l:result + l:offset
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if all else fails indent according to C-syntax
|
||||||
|
return cindent(v:lnum)
|
||||||
endfu
|
endfu
|
||||||
|
|||||||
207
after/indent/typescript.vim
Normal file
207
after/indent/typescript.vim
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim indent file
|
||||||
|
"
|
||||||
|
" Language: typescript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
" Depends: leafgarland/typescript-vim
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if exists('b:did_indent')
|
||||||
|
let s:did_indent = b:did_indent
|
||||||
|
unlet b:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists('s:did_indent')
|
||||||
|
let b:did_indent = s:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal indentexpr=GetJsxIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
||||||
|
|
||||||
|
function! GetJsxIndent()
|
||||||
|
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: styled-components (js/ts)
|
||||||
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
|
|
||||||
|
" initialize variable to check, if the indentation expression is run
|
||||||
|
" multiple times in a row, which indicates an infinite recursion
|
||||||
|
let s:is_recursion = 0
|
||||||
|
|
||||||
|
" store current indentexpr for later
|
||||||
|
let b:js_ts_indent=&indentexpr
|
||||||
|
|
||||||
|
" set indentexpr for this filetype (styled-components)
|
||||||
|
setlocal indentexpr=GetStyledIndent()
|
||||||
|
|
||||||
|
" add the following keys to trigger reindenting, when in insert mode
|
||||||
|
" - *; - Indent and insert on press of ';' key.
|
||||||
|
" - *<:> - Indent and insert on press of ':' key.
|
||||||
|
set indentkeys+=*;,*<:>,*<Return>
|
||||||
|
|
||||||
|
fu! s:GetSyntaxNames(lnum, cnum)
|
||||||
|
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" re-implement SynSOL of vim-jsx
|
||||||
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
|
fu! s:SynSOL(lnum)
|
||||||
|
return s:GetSyntaxNames(a:lnum, 1)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" re-implement SynEOL of vim-jsx
|
||||||
|
" TODO: add dependency to the readme and remove duplicate implementation
|
||||||
|
fu! s:SynEOL(lnum, offset)
|
||||||
|
let l:lnum = prevnonblank(a:lnum)
|
||||||
|
let l:col = strlen(getline(l:lnum))
|
||||||
|
|
||||||
|
return s:GetSyntaxNames(l:lnum, l:col + a:offset)
|
||||||
|
endfu
|
||||||
|
|
||||||
|
|
||||||
|
"" Return whether the current line is a jsTemplateString
|
||||||
|
fu! s:IsStyledDefinition(lnum)
|
||||||
|
" iterate through all syntax items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if syntax-item is a jsTemplateString return 1 - true
|
||||||
|
" `==#` is a match case comparison of the item
|
||||||
|
if item ==# 'styledDefinition'
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" fallback to 0 - false
|
||||||
|
return 0
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Count occurences of `str` at the beginning of the given `lnum` line
|
||||||
|
fu! s:CountOccurencesInSOL(lnum, str)
|
||||||
|
let l:occurence = 0
|
||||||
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynSOL(a:lnum)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case isensitive equal operation
|
||||||
|
if item ==? a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Count occurences of `str` at the end of the given `lnum` line
|
||||||
|
fu! s:CountOccurencesInEOL(lnum, str, offset)
|
||||||
|
let l:occurence = 0
|
||||||
|
|
||||||
|
" iterate through all items in the given line
|
||||||
|
for item in s:SynEOL(a:lnum, a:offset)
|
||||||
|
" if the syntax-item equals the given str increment the counter
|
||||||
|
" `==?` is a case insensitive equal operation
|
||||||
|
if item == a:str
|
||||||
|
let l:occurence += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" return the accumulated count of occurences
|
||||||
|
return l:occurence
|
||||||
|
endfu
|
||||||
|
|
||||||
|
"" Get the indentation of the current line
|
||||||
|
fu! GetStyledIndent()
|
||||||
|
if s:IsStyledDefinition(v:lnum)
|
||||||
|
let l:baseIndent = 0
|
||||||
|
|
||||||
|
" find last non-styled line
|
||||||
|
let l:cnum = v:lnum
|
||||||
|
while s:IsStyledDefinition(l:cnum)
|
||||||
|
let l:cnum -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" get indentation of the last non-styled line as base indentation
|
||||||
|
let l:baseIndent = indent(l:cnum)
|
||||||
|
|
||||||
|
" incrementally build indentation based on current indentation
|
||||||
|
" - one shiftwidth for the styled definition region
|
||||||
|
" - one shiftwidth per open nested definition region
|
||||||
|
let l:styledIndent = &sw
|
||||||
|
let l:styledIndent += min([
|
||||||
|
\ s:CountOccurencesInSOL(v:lnum, 'styledNestedRegion'),
|
||||||
|
\ s:CountOccurencesInEOL(v:lnum, 'styledNestedRegion', 0)
|
||||||
|
\ ]) * &sw
|
||||||
|
|
||||||
|
" decrease indentation by one shiftwidth, if the styled definition
|
||||||
|
" region ends on the current line
|
||||||
|
" - either directly via styled definition region, or
|
||||||
|
" - if the very last
|
||||||
|
if s:CountOccurencesInEOL(v:lnum, 'styledDefinition', 1) == 0
|
||||||
|
let l:styledIndent -= &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" return the base indentation
|
||||||
|
" (for nested styles inside classes/objects/etc.) plus the actual
|
||||||
|
" indentation inside the styled definition region
|
||||||
|
return l:baseIndent + l:styledIndent
|
||||||
|
elseif len(b:js_ts_indent)
|
||||||
|
let l:result = 0
|
||||||
|
let l:offset = 0
|
||||||
|
|
||||||
|
" increase indentation by one shiftwidth, if the last line ended on a
|
||||||
|
" styledXmlRegion and this line does not continue with it
|
||||||
|
" this is a fix for an incorrectly indented xml prop after a
|
||||||
|
" glamor-styled styledXmlRegion
|
||||||
|
if s:CountOccurencesInEOL(v:lnum-1, 'styledXmlRegion', 0) == 1 &&
|
||||||
|
\ s:CountOccurencesInSOL(v:lnum, 'styledXmlRegion') == 0
|
||||||
|
let l:offset = &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" make sure `GetStyledIndent` and `GetJsxIndent` don't infinitely
|
||||||
|
" recurse by incrementing a counter variable, before evaluating the
|
||||||
|
" stored indent expression
|
||||||
|
if s:is_recursion == 0
|
||||||
|
let s:is_recursion = 1
|
||||||
|
let l:result = eval(b:js_ts_indent)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" `is_recursion` being 0 at this point indicates, that
|
||||||
|
" `eval(b:js_ts_indent)` did itself evaluate it's stored indentexpr
|
||||||
|
" and thus it can be assumed, that the current line should be
|
||||||
|
" indented as JS
|
||||||
|
if s:is_recursion == 0
|
||||||
|
" use one of `GetJavascriptIndent` or `GetJsIndent` if existing
|
||||||
|
" fallback to cindent, if not
|
||||||
|
if exists('*GetJavascriptIndent')
|
||||||
|
let l:result = GetJavascriptIndent()
|
||||||
|
elseif exists('*GetJsIndent')
|
||||||
|
let l:result = GetJsIndent()
|
||||||
|
else
|
||||||
|
let l:result = cindent(v:lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" reset `is_recursion` counter and return the indentation value
|
||||||
|
let s:is_recursion = 0
|
||||||
|
return l:result + l:offset
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if all else fails indent according to C-syntax
|
||||||
|
return cindent(v:lnum)
|
||||||
|
endfu
|
||||||
317
after/syntax/javascript.vim
Normal file
317
after/syntax/javascript.vim
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim syntax file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
let s:jsx_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
syntax case match
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
let s:current_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('s:current_syntax')
|
||||||
|
let b:current_syntax = s:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if hlexists("jsNoise") " pangloss/vim-javascript
|
||||||
|
syntax cluster jsExpression add=jsxRegion
|
||||||
|
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||||
|
" refine the javascript line comment
|
||||||
|
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||||
|
syntax cluster javascriptValue add=jsxRegion
|
||||||
|
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
||||||
|
|
||||||
|
" add support to arrow function which returns a tagged template string, e.g.
|
||||||
|
" () => html`<div></div>`
|
||||||
|
syntax cluster afterArrowFunc add=javascriptTagRef
|
||||||
|
else " build-in javascript syntax
|
||||||
|
" refine the javascript line comment
|
||||||
|
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||||
|
" add a javaScriptBlock group for build-in syntax
|
||||||
|
syntax region javaScriptBlockBuildIn
|
||||||
|
\ contained
|
||||||
|
\ matchgroup=javaScriptBraces
|
||||||
|
\ start="{"
|
||||||
|
\ end="}"
|
||||||
|
\ extend
|
||||||
|
\ contains=javaScriptBlockBuildIn,@javaScriptEmbededExpr,javaScript.*
|
||||||
|
\ fold
|
||||||
|
syntax cluster javaScriptEmbededExpr add=jsxRegion
|
||||||
|
|
||||||
|
" refine the template string syntax
|
||||||
|
syntax region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend
|
||||||
|
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr,javaScript.*
|
||||||
|
endif
|
||||||
|
|
||||||
|
" because this is autoloaded, when developing you're going to need to source
|
||||||
|
" the autoload/jsx_pretty/*.vim file manually, or restart vim
|
||||||
|
call jsx_pretty#syntax#highlight()
|
||||||
|
|
||||||
|
let b:current_syntax = 'javascript.jsx'
|
||||||
|
|
||||||
|
let &cpo = s:jsx_cpo
|
||||||
|
unlet s:jsx_cpo
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: styled-components (js/ts)
|
||||||
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
let s:current_syntax=b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" fix for "-" before cssPositioningProp
|
||||||
|
" - needs to be above CSS include to not match cssVendor definitions
|
||||||
|
syn region cssCustomPositioningPrefix contained
|
||||||
|
\ start='-' end='\%(\s\{-}:\)\@='
|
||||||
|
\ contains=cssPositioningProp
|
||||||
|
|
||||||
|
" introduce CSS cluster from built-in (or single third party syntax file)
|
||||||
|
syn include @CSS syntax/css.vim
|
||||||
|
|
||||||
|
" try to include CSS3 definitions from multiple files
|
||||||
|
" this is only possible on vim version above 7
|
||||||
|
if v:version >= 700
|
||||||
|
try
|
||||||
|
syn include @CSS3 syntax/css/*.vim
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
|
" TODO: include react-native keywords
|
||||||
|
|
||||||
|
" define custom cssAttrRegion
|
||||||
|
" - add ",", "`" and "{" to the end characters
|
||||||
|
" - add "cssPseudoClassId" to it's containing elements
|
||||||
|
" this will incorrectly highlight pseudo elements incorrectly used as
|
||||||
|
" attributes but correctly highlight actual attributes
|
||||||
|
syn region cssCustomAttrRegion contained
|
||||||
|
\ start=":" end="\ze\%(;\|)\|{\|}\|`\)"
|
||||||
|
\ contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,
|
||||||
|
\ cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssError,cssAttrComma,cssNoise,cssPseudoClassId,
|
||||||
|
\ jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution
|
||||||
|
syn region cssCustomAttrRegion contained
|
||||||
|
\ start="transition\s*:" end="\ze\%(;\|)\|{\|}\|`\)"
|
||||||
|
\ contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,
|
||||||
|
\ cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,
|
||||||
|
\ cssVendor,cssError,cssAttrComma,cssNoise,cssPseudoClassId,
|
||||||
|
\ jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution
|
||||||
|
|
||||||
|
" define custom css elements to not utilize cssDefinition
|
||||||
|
syn region cssCustomMediaBlock contained fold transparent matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
\ contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,
|
||||||
|
\ cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,
|
||||||
|
\ cssUnicodeEscape,cssVendor,cssTagName,cssClassName,
|
||||||
|
\ cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,
|
||||||
|
\ cssAttributeSelector
|
||||||
|
syn region cssCustomPageWrap contained transparent matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
\ contains=cssPageMargin,cssPageProp,cssCustomAttrRegion,css.*Prop,
|
||||||
|
\ cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,
|
||||||
|
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssHacks
|
||||||
|
syn match cssCustomPageMargin contained skipwhite skipnl
|
||||||
|
\ "@\%(\%(top\|left\|right\|bottom\)-\%(left\|center\|right\|middle\|bottom\)\)\%(-corner\)\="
|
||||||
|
syn match cssCustomKeyFrameSelector "\%(\d*%\|\<from\>\|\<to\>\)" contained
|
||||||
|
\ skipwhite skipnl
|
||||||
|
|
||||||
|
" define css include customly to overwrite nextgroup
|
||||||
|
syn region cssInclude start="@media\>" end="\ze{" skipwhite skipnl
|
||||||
|
\ contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,
|
||||||
|
\ cssMediaMediaAttr,cssVencor,cssMediaType,cssIncludeKeyword,
|
||||||
|
\ cssMediaComma,cssComment
|
||||||
|
\ nextgroup=cssCustomMediaBlock
|
||||||
|
|
||||||
|
" define all non-contained css definitions
|
||||||
|
syn cluster CSSTop
|
||||||
|
\ contains=cssTagName,cssSelectorOp,cssAttributeSelector,cssClassName,
|
||||||
|
\ cssBraces,cssIdentifier,cssIncludeKeyword,cssPage,cssKeyFrame,
|
||||||
|
\ cssFontDescriptor,cssAttrComma,cssPseudoClass,cssUnicodeEscape
|
||||||
|
|
||||||
|
" custom highlights for styled components
|
||||||
|
" - "&" inside top level
|
||||||
|
" - cssTagName inside of jsStrings inside of styledPrefix regions
|
||||||
|
" TODO: override highlighting of cssTagName with more subtle one
|
||||||
|
syn match styledAmpersand contained "&"
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+'+ end=+'+ skip=+\\\%(\'\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+"+ end=+"+ skip=+\\\%(\"\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+`+ end=+`+ skip=+\\\%(\`\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
|
||||||
|
" define custom API sections that trigger the styledDefinition highlighting
|
||||||
|
syn match styledPrefix "\<styled\>\.\k\+"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,javascriptTagRef
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
syn match styledPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=jsObject,jsParen
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
syn match styledPrefix "\.\<extend\>"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
|
||||||
|
" define custom API section, that contains typescript annotations
|
||||||
|
" this is structurally similar to `jsFuncCall`, but allows type
|
||||||
|
" annotations (delimited by brackets (e.g. "<>")) between `styled` and
|
||||||
|
" the function call parenthesis
|
||||||
|
syn match styledTypescriptPrefix
|
||||||
|
\ "\<styled\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>(\%('\k\+'\|\"\k\+\"\|\k\+\))"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix
|
||||||
|
\ "\<styled\>\%((\%('\k\+'\|\"\k\+\"\|\k\+\))\|\.\k\+\)<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix "\.\<extend\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
|
||||||
|
" define emotion css prop
|
||||||
|
" to bypass problems from top-level defined xml/js definitions, this
|
||||||
|
" plugin re-defines keywords/noise for highlighting inside of the custom
|
||||||
|
" xmlAttrib definition
|
||||||
|
syn keyword styledXmlRegionKeyword css contained
|
||||||
|
syn match styledXmlRegionNoise "\%(=\|{\|}\)" contained
|
||||||
|
" only include styledDefinitions inside of xmlAttribs, that are wrapped
|
||||||
|
" in `css={}` regions, `keepend` is necessary to correctly break on the
|
||||||
|
" higher-level xmlAttrib region end
|
||||||
|
syn region styledXmlRegion
|
||||||
|
\ start="\<css\>={" end="}"
|
||||||
|
\ keepend fold
|
||||||
|
\ containedin=xmlAttrib
|
||||||
|
\ contains=styledXmlRegionKeyword,styledXmlRegionNoise,styledDefinition
|
||||||
|
|
||||||
|
" define nested region for indenting
|
||||||
|
syn region styledNestedRegion contained transparent
|
||||||
|
\ matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
|
||||||
|
" re-define cssError to be highlighted correctly in styledNestedRegion
|
||||||
|
syn match cssError contained "{@<>"
|
||||||
|
|
||||||
|
" extend javascript matches to trigger styledDefinition highlighting
|
||||||
|
syn match jsTaggedTemplate extend
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(.\+)" transparent
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ contains=typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\.\<withComponent\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
syn match jsFuncCall "\<dc\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))\%((\)\@="
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
\ nextgroup=styledDefinitionArgument
|
||||||
|
|
||||||
|
" inject css highlighting into custom jsTemplateString region
|
||||||
|
" - use `extend` to not end all nested jsTemplateExpression on the first
|
||||||
|
" closing one
|
||||||
|
syn region styledDefinition contained transparent fold extend
|
||||||
|
\ start="`" end="`" skip="\\\%(`\|$\)"
|
||||||
|
\ contains=@CSSTop,
|
||||||
|
\ css.*Prop,cssValue.*,cssColor,cssUrl,cssImportant,cssError,
|
||||||
|
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssHacks,
|
||||||
|
\ cssCustom.*,
|
||||||
|
\ jsComment,jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution,
|
||||||
|
\ styledAmpersand,styledNestedRegion
|
||||||
|
syn region styledDefinitionArgument contained transparent start=+(+ end=+)+
|
||||||
|
\ contains=styledDefinition
|
||||||
|
|
||||||
|
syn cluster typescriptValue add=styledPrefix,jsFuncCall,styledTypescriptPrefix
|
||||||
|
|
||||||
|
""" yajs specific extensions
|
||||||
|
" define template tag keywords, that trigger styledDefinitions again to be
|
||||||
|
" contained in and also do contain the `javascriptTagRef` region
|
||||||
|
syn match javascriptTagRefStyledPrefix transparent fold
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ containedin=javascriptTagRef
|
||||||
|
\ contains=javascriptTagRef
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
" extend the yajs clusters to include the previously and extraneously defined
|
||||||
|
" styled-related matches
|
||||||
|
syn cluster javascriptExpression
|
||||||
|
\ add=styledPrefix,jsFuncCall,javascriptTagRefStyledPrefix
|
||||||
|
syn cluster javascriptAfterIdentifier add=styledPrefix,jsFuncCall
|
||||||
|
|
||||||
|
""" yats specific extensions
|
||||||
|
" extend typescriptIdentifierName to allow styledDefinitions in their
|
||||||
|
" tagged templates
|
||||||
|
syn match typescriptIdentifierName extend
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
|
||||||
|
" color the custom highlight elements
|
||||||
|
hi def link cssCustomKeyFrameSelector Constant
|
||||||
|
hi def link cssCustomPositioningPrefix StorageClass
|
||||||
|
hi def link styledAmpersand Special
|
||||||
|
|
||||||
|
hi def link styledXmlRegionKeyword Type
|
||||||
|
hi def link styledXmlRegionNoise Noise
|
||||||
|
hi def link styledXmlRegion String
|
||||||
|
|
||||||
|
|
||||||
|
if exists("s:current_syntax")
|
||||||
|
let b:current_syntax=s:current_syntax
|
||||||
|
endif
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
let s:current_syntax = b:current_syntax
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
syn include @GraphQLSyntax syntax/graphql.vim
|
|
||||||
if exists('s:current_syntax')
|
|
||||||
let b:current_syntax = s:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:tags = '\%(' . join(g:graphql_javascript_tags, '\|') . '\)'
|
|
||||||
|
|
||||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend'
|
|
||||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
|
||||||
|
|
||||||
" Support expression interpolation ((${...})) inside template strings.
|
|
||||||
syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=jsTemplateExpression containedin=graphqlFold keepend
|
|
||||||
|
|
||||||
hi def link graphqlTemplateString jsTemplateString
|
|
||||||
hi def link graphqlTaggedTemplate jsTaggedTemplate
|
|
||||||
hi def link graphqlTemplateExpression jsTemplateExpression
|
|
||||||
|
|
||||||
syn cluster jsExpression add=graphqlTaggedTemplate
|
|
||||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim syntax file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
" Depends: pangloss/vim-javascript
|
|
||||||
"
|
|
||||||
" CREDITS: Inspired by Facebook.
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" Prologue; load in XML syntax.
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
let s:current_syntax=b:current_syntax
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
syn include @XMLSyntax syntax/xml.vim
|
|
||||||
if exists('s:current_syntax')
|
|
||||||
let b:current_syntax=s:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Officially, vim-jsx depends on the pangloss/vim-javascript syntax package
|
|
||||||
" (and is tested against it exclusively). However, in practice, we make some
|
|
||||||
" effort towards compatibility with other packages.
|
|
||||||
"
|
|
||||||
" These are the plugin-to-syntax-element correspondences:
|
|
||||||
"
|
|
||||||
" - pangloss/vim-javascript: jsBlock, jsExpression
|
|
||||||
" - jelera/vim-javascript-syntax: javascriptBlock
|
|
||||||
" - othree/yajs.vim: javascriptNoReserved
|
|
||||||
|
|
||||||
|
|
||||||
" JSX attributes should color as JS. Note the trivial end pattern; we let
|
|
||||||
" jsBlock take care of ending the region.
|
|
||||||
syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock
|
|
||||||
|
|
||||||
" JSX comments inside XML tag should color as comment. Note the trivial end pattern; we let
|
|
||||||
" jsComment take care of ending the region.
|
|
||||||
syn region xmlString contained start=+//+ end=++ contains=jsComment
|
|
||||||
|
|
||||||
" JSX child blocks behave just like JSX attributes, except that (a) they are
|
|
||||||
" syntactically distinct, and (b) they need the syn-extend argument, or else
|
|
||||||
" nested XML end-tag patterns may end the outer jsxRegion.
|
|
||||||
syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Highlight JSX regions as XML; recursively match.
|
|
||||||
"
|
|
||||||
" Note that we prohibit JSX tags from having a < or word character immediately
|
|
||||||
" preceding it, to avoid conflicts with, respectively, the left shift operator
|
|
||||||
" and generic Flow type annotations (http://flowtype.org/).
|
|
||||||
syn region jsxRegion
|
|
||||||
\ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock
|
|
||||||
\ start=+\%(<\|\w\)\@<!<\z([a-zA-Z_][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*>(\)\@!+
|
|
||||||
\ skip=+<!--\_.\{-}-->+
|
|
||||||
\ end=+</\z1\_\s\{-}>+
|
|
||||||
\ end=+/>+
|
|
||||||
\ keepend
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Shorthand fragment support
|
|
||||||
"
|
|
||||||
" Note that since the main jsxRegion contains @XMLSyntax, we cannot simply
|
|
||||||
" adjust the regex above since @XMLSyntax will highlight the opening `<` as an
|
|
||||||
" XMLError. Instead we create a new group with the same name that does not
|
|
||||||
" include @XMLSyntax and instead uses matchgroup to get the same highlighting.
|
|
||||||
syn region jsxRegion
|
|
||||||
\ contains=@Spell,jsxRegion,jsxChild,jsBlock,javascriptBlock
|
|
||||||
\ matchgroup=xmlTag
|
|
||||||
\ start=/<>/
|
|
||||||
\ end=/<\/>/
|
|
||||||
\ keepend
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Add jsxRegion to the lowest-level JS syntax cluster.
|
|
||||||
syn cluster jsExpression add=jsxRegion
|
|
||||||
|
|
||||||
" Allow jsxRegion to contain reserved words.
|
|
||||||
syn cluster javascriptNoReserved add=jsxRegion
|
|
||||||
1411
after/syntax/mma.vim
1411
after/syntax/mma.vim
File diff suppressed because it is too large
Load Diff
303
after/syntax/typescript.vim
Normal file
303
after/syntax/typescript.vim
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim syntax file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
" Depends: leafgarland/typescript-vim
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
let s:jsx_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
syntax case match
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
let s:current_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('s:current_syntax')
|
||||||
|
let b:current_syntax = s:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
" refine the typescript line comment
|
||||||
|
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
||||||
|
|
||||||
|
" add a typescriptBlock group for typescript
|
||||||
|
syntax region typescriptBlock
|
||||||
|
\ contained
|
||||||
|
\ matchgroup=typescriptBraces
|
||||||
|
\ start="{"
|
||||||
|
\ end="}"
|
||||||
|
\ extend
|
||||||
|
\ contains=@typescriptAll,@typescriptExpression,typescriptBlock
|
||||||
|
\ fold
|
||||||
|
|
||||||
|
" because this is autoloaded, when developing you're going to need to source
|
||||||
|
" the autoload/jsx_pretty/*.vim file manually, or restart vim
|
||||||
|
call jsx_pretty#syntax#highlight()
|
||||||
|
|
||||||
|
syntax cluster typescriptExpression add=jsxRegion
|
||||||
|
|
||||||
|
let b:current_syntax = 'typescript.tsx'
|
||||||
|
|
||||||
|
let &cpo = s:jsx_cpo
|
||||||
|
unlet s:jsx_cpo
|
||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: styled-components (js/ts)
|
||||||
|
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
|
||||||
|
" URL: https://github.com/styled-components/vim-styled-components
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
let s:current_syntax=b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" fix for "-" before cssPositioningProp
|
||||||
|
" - needs to be above CSS include to not match cssVendor definitions
|
||||||
|
syn region cssCustomPositioningPrefix contained
|
||||||
|
\ start='-' end='\%(\s\{-}:\)\@='
|
||||||
|
\ contains=cssPositioningProp
|
||||||
|
|
||||||
|
" introduce CSS cluster from built-in (or single third party syntax file)
|
||||||
|
syn include @CSS syntax/css.vim
|
||||||
|
|
||||||
|
" try to include CSS3 definitions from multiple files
|
||||||
|
" this is only possible on vim version above 7
|
||||||
|
if v:version >= 700
|
||||||
|
try
|
||||||
|
syn include @CSS3 syntax/css/*.vim
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
|
" TODO: include react-native keywords
|
||||||
|
|
||||||
|
" define custom cssAttrRegion
|
||||||
|
" - add ",", "`" and "{" to the end characters
|
||||||
|
" - add "cssPseudoClassId" to it's containing elements
|
||||||
|
" this will incorrectly highlight pseudo elements incorrectly used as
|
||||||
|
" attributes but correctly highlight actual attributes
|
||||||
|
syn region cssCustomAttrRegion contained
|
||||||
|
\ start=":" end="\ze\%(;\|)\|{\|}\|`\)"
|
||||||
|
\ contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,
|
||||||
|
\ cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssError,cssAttrComma,cssNoise,cssPseudoClassId,
|
||||||
|
\ jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution
|
||||||
|
syn region cssCustomAttrRegion contained
|
||||||
|
\ start="transition\s*:" end="\ze\%(;\|)\|{\|}\|`\)"
|
||||||
|
\ contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,
|
||||||
|
\ cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,
|
||||||
|
\ cssVendor,cssError,cssAttrComma,cssNoise,cssPseudoClassId,
|
||||||
|
\ jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution
|
||||||
|
|
||||||
|
" define custom css elements to not utilize cssDefinition
|
||||||
|
syn region cssCustomMediaBlock contained fold transparent matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
\ contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,
|
||||||
|
\ cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,
|
||||||
|
\ cssUnicodeEscape,cssVendor,cssTagName,cssClassName,
|
||||||
|
\ cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,
|
||||||
|
\ cssAttributeSelector
|
||||||
|
syn region cssCustomPageWrap contained transparent matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
\ contains=cssPageMargin,cssPageProp,cssCustomAttrRegion,css.*Prop,
|
||||||
|
\ cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,
|
||||||
|
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssHacks
|
||||||
|
syn match cssCustomPageMargin contained skipwhite skipnl
|
||||||
|
\ "@\%(\%(top\|left\|right\|bottom\)-\%(left\|center\|right\|middle\|bottom\)\)\%(-corner\)\="
|
||||||
|
syn match cssCustomKeyFrameSelector "\%(\d*%\|\<from\>\|\<to\>\)" contained
|
||||||
|
\ skipwhite skipnl
|
||||||
|
|
||||||
|
" define css include customly to overwrite nextgroup
|
||||||
|
syn region cssInclude start="@media\>" end="\ze{" skipwhite skipnl
|
||||||
|
\ contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,
|
||||||
|
\ cssMediaMediaAttr,cssVencor,cssMediaType,cssIncludeKeyword,
|
||||||
|
\ cssMediaComma,cssComment
|
||||||
|
\ nextgroup=cssCustomMediaBlock
|
||||||
|
|
||||||
|
" define all non-contained css definitions
|
||||||
|
syn cluster CSSTop
|
||||||
|
\ contains=cssTagName,cssSelectorOp,cssAttributeSelector,cssClassName,
|
||||||
|
\ cssBraces,cssIdentifier,cssIncludeKeyword,cssPage,cssKeyFrame,
|
||||||
|
\ cssFontDescriptor,cssAttrComma,cssPseudoClass,cssUnicodeEscape
|
||||||
|
|
||||||
|
" custom highlights for styled components
|
||||||
|
" - "&" inside top level
|
||||||
|
" - cssTagName inside of jsStrings inside of styledPrefix regions
|
||||||
|
" TODO: override highlighting of cssTagName with more subtle one
|
||||||
|
syn match styledAmpersand contained "&"
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+'+ end=+'+ skip=+\\\%(\'\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+"+ end=+"+ skip=+\\\%(\"\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
syn region styledTagNameString matchgroup=jsString contained
|
||||||
|
\ start=+`+ end=+`+ skip=+\\\%(\`\|$\)+
|
||||||
|
\ contains=cssTagName
|
||||||
|
|
||||||
|
" define custom API sections that trigger the styledDefinition highlighting
|
||||||
|
syn match styledPrefix "\<styled\>\.\k\+"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,javascriptTagRef
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
syn match styledPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=jsObject,jsParen
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
syn match styledPrefix "\.\<extend\>"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ containedin=jsFuncBlock
|
||||||
|
|
||||||
|
" define custom API section, that contains typescript annotations
|
||||||
|
" this is structurally similar to `jsFuncCall`, but allows type
|
||||||
|
" annotations (delimited by brackets (e.g. "<>")) between `styled` and
|
||||||
|
" the function call parenthesis
|
||||||
|
syn match styledTypescriptPrefix
|
||||||
|
\ "\<styled\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>(\%('\k\+'\|\"\k\+\"\|\k\+\))"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix
|
||||||
|
\ "\<styled\>\%((\%('\k\+'\|\"\k\+\"\|\k\+\))\|\.\k\+\)<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
syn match styledTypescriptPrefix "\.\<extend\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ transparent fold extend
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
\ contains=cssTagName,
|
||||||
|
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
|
||||||
|
" define emotion css prop
|
||||||
|
" to bypass problems from top-level defined xml/js definitions, this
|
||||||
|
" plugin re-defines keywords/noise for highlighting inside of the custom
|
||||||
|
" xmlAttrib definition
|
||||||
|
syn keyword styledXmlRegionKeyword css contained
|
||||||
|
syn match styledXmlRegionNoise "\%(=\|{\|}\)" contained
|
||||||
|
" only include styledDefinitions inside of xmlAttribs, that are wrapped
|
||||||
|
" in `css={}` regions, `keepend` is necessary to correctly break on the
|
||||||
|
" higher-level xmlAttrib region end
|
||||||
|
syn region styledXmlRegion
|
||||||
|
\ start="\<css\>={" end="}"
|
||||||
|
\ keepend fold
|
||||||
|
\ containedin=xmlAttrib
|
||||||
|
\ contains=styledXmlRegionKeyword,styledXmlRegionNoise,styledDefinition
|
||||||
|
|
||||||
|
" define nested region for indenting
|
||||||
|
syn region styledNestedRegion contained transparent
|
||||||
|
\ matchgroup=cssBraces
|
||||||
|
\ start="{" end="}"
|
||||||
|
|
||||||
|
" re-define cssError to be highlighted correctly in styledNestedRegion
|
||||||
|
syn match cssError contained "{@<>"
|
||||||
|
|
||||||
|
" extend javascript matches to trigger styledDefinition highlighting
|
||||||
|
syn match jsTaggedTemplate extend
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(.\+)" transparent
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
|
||||||
|
\ contains=typescriptBraces,typescriptOpSymbols,typescriptEndColons,
|
||||||
|
\ typescriptParens,typescriptStringS,@typescriptType,
|
||||||
|
\ typescriptType,
|
||||||
|
\ styledTagNameString
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
syn match jsFuncCall "\.\<withComponent\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
syn match jsFuncCall "\<dc\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))\%((\)\@="
|
||||||
|
\ contains=styledTagNameString
|
||||||
|
\ nextgroup=styledDefinitionArgument
|
||||||
|
|
||||||
|
" inject css highlighting into custom jsTemplateString region
|
||||||
|
" - use `extend` to not end all nested jsTemplateExpression on the first
|
||||||
|
" closing one
|
||||||
|
syn region styledDefinition contained transparent fold extend
|
||||||
|
\ start="`" end="`" skip="\\\%(`\|$\)"
|
||||||
|
\ contains=@CSSTop,
|
||||||
|
\ css.*Prop,cssValue.*,cssColor,cssUrl,cssImportant,cssError,
|
||||||
|
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
|
||||||
|
\ cssHacks,
|
||||||
|
\ cssCustom.*,
|
||||||
|
\ jsComment,jsTemplateExpression,
|
||||||
|
\ typescriptInterpolation,typescriptTemplateSubstitution,
|
||||||
|
\ styledAmpersand,styledNestedRegion
|
||||||
|
syn region styledDefinitionArgument contained transparent start=+(+ end=+)+
|
||||||
|
\ contains=styledDefinition
|
||||||
|
|
||||||
|
syn cluster typescriptValue add=styledPrefix,jsFuncCall,styledTypescriptPrefix
|
||||||
|
|
||||||
|
""" yajs specific extensions
|
||||||
|
" define template tag keywords, that trigger styledDefinitions again to be
|
||||||
|
" contained in and also do contain the `javascriptTagRef` region
|
||||||
|
syn match javascriptTagRefStyledPrefix transparent fold
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ containedin=javascriptTagRef
|
||||||
|
\ contains=javascriptTagRef
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
" extend the yajs clusters to include the previously and extraneously defined
|
||||||
|
" styled-related matches
|
||||||
|
syn cluster javascriptExpression
|
||||||
|
\ add=styledPrefix,jsFuncCall,javascriptTagRefStyledPrefix
|
||||||
|
syn cluster javascriptAfterIdentifier add=styledPrefix,jsFuncCall
|
||||||
|
|
||||||
|
""" yats specific extensions
|
||||||
|
" extend typescriptIdentifierName to allow styledDefinitions in their
|
||||||
|
" tagged templates
|
||||||
|
syn match typescriptIdentifierName extend
|
||||||
|
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
|
||||||
|
\ nextgroup=styledDefinition
|
||||||
|
|
||||||
|
" color the custom highlight elements
|
||||||
|
hi def link cssCustomKeyFrameSelector Constant
|
||||||
|
hi def link cssCustomPositioningPrefix StorageClass
|
||||||
|
hi def link styledAmpersand Special
|
||||||
|
|
||||||
|
hi def link styledXmlRegionKeyword Type
|
||||||
|
hi def link styledXmlRegionNoise Noise
|
||||||
|
hi def link styledXmlRegion String
|
||||||
|
|
||||||
|
|
||||||
|
if exists("s:current_syntax")
|
||||||
|
let b:current_syntax=s:current_syntax
|
||||||
|
endif
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
let s:current_syntax = b:current_syntax
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
syn include @GraphQLSyntax syntax/graphql.vim
|
|
||||||
if exists('s:current_syntax')
|
|
||||||
let b:current_syntax = s:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:tags = '\%(' . join(g:graphql_javascript_tags, '\|') . '\)'
|
|
||||||
|
|
||||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend'
|
|
||||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
|
||||||
|
|
||||||
" Support expression interpolation ((${...})) inside template strings.
|
|
||||||
syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=typescriptTemplateSubstitution containedin=graphqlFold keepend
|
|
||||||
|
|
||||||
hi def link graphqlTemplateString typescriptTemplate
|
|
||||||
hi def link graphqlTemplateExpression typescriptTemplateSubstitution
|
|
||||||
|
|
||||||
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
|
||||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
|
||||||
@@ -37,21 +37,45 @@ function! s:run_cmd(cmd) abort
|
|||||||
return s:P.system(a:cmd)
|
return s:P.system(a:cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:find_root_by_spec(d) abort
|
function! s:find_root_by(search_dir, d) abort
|
||||||
let dir = finddir('spec', a:d . ';')
|
let found_dir = finddir(a:search_dir, a:d . ';')
|
||||||
if dir ==# ''
|
if found_dir ==# ''
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Note: ':h:h' for {root}/spec/ -> {root}/spec -> {root}
|
" Note: ':h:h' for {root}/{search_dir}/ -> {root}/{search_dir} -> {root}
|
||||||
return fnamemodify(dir, ':p:h:h')
|
return fnamemodify(found_dir, ':p:h:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Search the root directory containing a 'spec/' and a 'src/' directories.
|
||||||
|
"
|
||||||
|
" Searching for the 'spec/' directory is not enough: for example the crystal
|
||||||
|
" compiler has a 'cr_sources/src/spec/' directory that would otherwise give the root
|
||||||
|
" directory as 'cr_source/src/' instead of 'cr_sources/'.
|
||||||
|
function! s:find_root_by_spec_and_src(d) abort
|
||||||
|
" Search for 'spec/'
|
||||||
|
let root = s:find_root_by('spec', a:d)
|
||||||
|
" Check that 'src/' is also there
|
||||||
|
if root !=# '' && isdirectory(root . '/src')
|
||||||
|
return root
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Search for 'src/'
|
||||||
|
let root = s:find_root_by('src', a:d)
|
||||||
|
" Check that 'spec/' is also there
|
||||||
|
if root !=# '' && isdirectory(root . '/spec')
|
||||||
|
return root
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Cannot find a directory containing both 'src/' and 'spec/'
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! crystal_lang#entrypoint_for(file_path) abort
|
function! crystal_lang#entrypoint_for(file_path) abort
|
||||||
let parent_dir = fnamemodify(a:file_path, ':p:h')
|
let parent_dir = fnamemodify(a:file_path, ':p:h')
|
||||||
let root_dir = s:find_root_by_spec(parent_dir)
|
let root_dir = s:find_root_by_spec_and_src(parent_dir)
|
||||||
if root_dir ==# ''
|
if root_dir ==# ''
|
||||||
" No spec diretory found. No need to make temporary file
|
" No spec directory found. No need to make temporary file
|
||||||
return a:file_path
|
return a:file_path
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -232,7 +256,7 @@ endfunction
|
|||||||
|
|
||||||
function! crystal_lang#run_all_spec(...) abort
|
function! crystal_lang#run_all_spec(...) abort
|
||||||
let path = a:0 == 0 ? expand('%:p:h') : a:1
|
let path = a:0 == 0 ? expand('%:p:h') : a:1
|
||||||
let root_path = s:find_root_by_spec(path)
|
let root_path = s:find_root_by_spec_and_src(path)
|
||||||
if root_path ==# ''
|
if root_path ==# ''
|
||||||
return s:echo_error("'spec' directory is not found")
|
return s:echo_error("'spec' directory is not found")
|
||||||
endif
|
endif
|
||||||
@@ -250,9 +274,9 @@ function! crystal_lang#run_current_spec(...) abort
|
|||||||
let source_dir = fnamemodify(path, ':h')
|
let source_dir = fnamemodify(path, ':h')
|
||||||
|
|
||||||
" /foo/bar
|
" /foo/bar
|
||||||
let root_dir = s:find_root_by_spec(source_dir)
|
let root_dir = s:find_root_by_spec_and_src(source_dir)
|
||||||
if root_dir ==# ''
|
if root_dir ==# ''
|
||||||
return s:echo_error("'spec' directory is not found")
|
return s:echo_error("Root directory with 'src/' and 'spec/' not found")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" src
|
" src
|
||||||
|
|||||||
@@ -9,22 +9,35 @@ function! s:error(text) abort
|
|||||||
echohl None
|
echohl None
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:cexpr(errorformat, joined_lines) abort
|
function! s:cexpr(errorformat, lines, reason) abort
|
||||||
let temp_errorfomat = &errorformat
|
call setqflist([], ' ', {
|
||||||
try
|
\ 'lines': a:lines,
|
||||||
let &errorformat = a:errorformat
|
\ 'efm': a:errorformat,
|
||||||
cexpr a:joined_lines
|
\ 'context': {'reason': a:reason},
|
||||||
|
\})
|
||||||
copen
|
copen
|
||||||
finally
|
endfunction
|
||||||
let &errorformat = temp_errorfomat
|
|
||||||
endtry
|
" If the quickfix list has a context matching [reason], clear and close it.
|
||||||
|
function! s:clearQfList(reason) abort
|
||||||
|
let context = get(getqflist({'context': 1}), 'context', {})
|
||||||
|
if type(context) == v:t_dict &&
|
||||||
|
\ has_key(context, 'reason') &&
|
||||||
|
\ context.reason == a:reason
|
||||||
|
call setqflist([], 'r')
|
||||||
|
cclose
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#fmt(q_args) abort
|
function! dart#fmt(q_args) abort
|
||||||
if executable('dartfmt')
|
if executable('dartfmt')
|
||||||
let buffer_content = join(getline(1, '$'), "\n")
|
let buffer_content = join(getline(1, '$'), "\n")
|
||||||
let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content)
|
let args = '--stdin-name '.expand('%').' '.a:q_args
|
||||||
if buffer_content ==# joined_lines[:-2] | return | endif
|
let joined_lines = system(printf('dartfmt %s', args), buffer_content)
|
||||||
|
if buffer_content ==# joined_lines[:-2]
|
||||||
|
call s:clearQfList('dartfmt')
|
||||||
|
return
|
||||||
|
endif
|
||||||
if 0 == v:shell_error
|
if 0 == v:shell_error
|
||||||
let win_view = winsaveview()
|
let win_view = winsaveview()
|
||||||
let lines = split(joined_lines, "\n")
|
let lines = split(joined_lines, "\n")
|
||||||
@@ -33,12 +46,11 @@ function! dart#fmt(q_args) abort
|
|||||||
silent keepjumps execute string(len(lines)+1).',$ delete'
|
silent keepjumps execute string(len(lines)+1).',$ delete'
|
||||||
endif
|
endif
|
||||||
call winrestview(win_view)
|
call winrestview(win_view)
|
||||||
|
call s:clearQfList('dartfmt')
|
||||||
else
|
else
|
||||||
let errors = split(joined_lines, "\n")[2:]
|
let errors = split(joined_lines, "\n")[2:]
|
||||||
let file_path = expand('%')
|
let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
|
||||||
call map(errors, 'file_path.":".v:val')
|
call s:cexpr(error_format, errors, 'dartfmt')
|
||||||
let error_format = '%A%f:line %l\, column %c of stdin: %m,%C%.%#'
|
|
||||||
call s:cexpr(error_format, join(errors, "\n"))
|
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call s:error('cannot execute binary file: dartfmt')
|
call s:error('cannot execute binary file: dartfmt')
|
||||||
@@ -49,8 +61,9 @@ function! dart#analyzer(q_args) abort
|
|||||||
if executable('dartanalyzer')
|
if executable('dartanalyzer')
|
||||||
let path = expand('%:p:gs:\:/:')
|
let path = expand('%:p:gs:\:/:')
|
||||||
if filereadable(path)
|
if filereadable(path)
|
||||||
let joined_lines = system(printf('dartanalyzer %s %s', a:q_args, shellescape(path)))
|
let command = printf('dartanalyzer %s %s', a:q_args, shellescape(path))
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
let lines = systemlist(command)
|
||||||
|
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dartanalyzer')
|
||||||
else
|
else
|
||||||
call s:error(printf('cannot read a file: "%s"', path))
|
call s:error(printf('cannot read a file: "%s"', path))
|
||||||
endif
|
endif
|
||||||
@@ -63,8 +76,9 @@ function! dart#tojs(q_args) abort
|
|||||||
if executable('dart2js')
|
if executable('dart2js')
|
||||||
let path = expand('%:p:gs:\:/:')
|
let path = expand('%:p:gs:\:/:')
|
||||||
if filereadable(path)
|
if filereadable(path)
|
||||||
let joined_lines = system(printf('dart2js %s %s', a:q_args, shellescape(path)))
|
let command = printf('dart2js %s %s', a:q_args, shellescape(path))
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
let lines = systemlist(command)
|
||||||
|
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dart2js')
|
||||||
else
|
else
|
||||||
call s:error(printf('cannot read a file: "%s"', path))
|
call s:error(printf('cannot read a file: "%s"', path))
|
||||||
endif
|
endif
|
||||||
|
|||||||
24
autoload/db/adapter/ecto.vim
Normal file
24
autoload/db/adapter/ecto.vim
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elixir') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:path = expand('<sfile>:h')
|
||||||
|
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
|
||||||
|
|
||||||
|
function! s:repo_list() abort
|
||||||
|
return map(systemlist(s:cmd), 'split(v:val)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! db#adapter#ecto#canonicalize(url) abort
|
||||||
|
for l:item in s:repo_list()
|
||||||
|
let l:name = get(l:item, 0)
|
||||||
|
let l:url = get(l:item, 1)
|
||||||
|
if !empty(l:name) && 'ecto:'.l:name ==# a:url
|
||||||
|
return l:url
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! db#adapter#ecto#complete_opaque(url) abort
|
||||||
|
return map(s:repo_list(), 'v:val[0]')
|
||||||
|
endfunction
|
||||||
@@ -136,7 +136,13 @@ function! elm#util#GoToModule(name)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:findLocalModule(rel_path, root)
|
function! s:findLocalModule(rel_path, root)
|
||||||
let l:package_json = a:root . '/elm-package.json'
|
let l:old_match = findfile('elm-package.json', a:root . ';')
|
||||||
|
let l:new_match = findfile('elm.json', a:root . ';')
|
||||||
|
if !empty(l:new_match)
|
||||||
|
let l:package_json = l:new_match
|
||||||
|
elseif !empty(l:old_match)
|
||||||
|
let l:package_json = l:old_match
|
||||||
|
endif
|
||||||
if exists('*json_decode')
|
if exists('*json_decode')
|
||||||
let l:package = json_decode(readfile(l:package_json))
|
let l:package = json_decode(readfile(l:package_json))
|
||||||
let l:source_roots = l:package['source-directories']
|
let l:source_roots = l:package['source-directories']
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ function! go#config#VersionWarning() abort
|
|||||||
return get(g:, 'go_version_warning', 1)
|
return get(g:, 'go_version_warning', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#NullModuleWarning() abort
|
||||||
|
return get(g:, 'go_null_module_warning', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#BuildTags() abort
|
function! go#config#BuildTags() abort
|
||||||
return get(g:, 'go_build_tags', '')
|
return get(g:, 'go_build_tags', '')
|
||||||
endfunction
|
endfunction
|
||||||
@@ -52,7 +56,7 @@ function! go#config#TermMode() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#TermEnabled() abort
|
function! go#config#TermEnabled() abort
|
||||||
return get(g:, 'go_term_enabled', 0)
|
return has('nvim') && get(g:, 'go_term_enabled', 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#SetTermEnabled(value) abort
|
function! go#config#SetTermEnabled(value) abort
|
||||||
@@ -118,7 +122,7 @@ function! go#config#ListAutoclose() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#InfoMode() abort
|
function! go#config#InfoMode() abort
|
||||||
return get(g:, 'go_info_mode', 'gocode')
|
return get(g:, 'go_info_mode', 'gopls')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GuruScope() abort
|
function! go#config#GuruScope() abort
|
||||||
@@ -183,7 +187,7 @@ function! go#config#DefReuseBuffer() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#DefMode() abort
|
function! go#config#DefMode() abort
|
||||||
return get(g:, 'go_def_mode', 'guru')
|
return get(g:, 'go_def_mode', 'gopls')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#DeclsIncludes() abort
|
function! go#config#DeclsIncludes() abort
|
||||||
@@ -214,6 +218,16 @@ function! go#config#DebugCommands() abort
|
|||||||
return g:go_debug_commands
|
return g:go_debug_commands
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#DebugLogOutput() abort
|
||||||
|
return get(g:, 'go_debug_log_output', 'debugger, rpc')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#LspLog() abort
|
||||||
|
" make sure g:go_lsp_log is set so that it can be added to easily.
|
||||||
|
let g:go_lsp_log = get(g:, 'go_lsp_log', [])
|
||||||
|
return g:go_lsp_log
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#SetDebugDiag(value) abort
|
function! go#config#SetDebugDiag(value) abort
|
||||||
let g:go_debug_diag = a:value
|
let g:go_debug_diag = a:value
|
||||||
endfunction
|
endfunction
|
||||||
@@ -239,15 +253,27 @@ function! go#config#SetTemplateAutocreate(value) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterCommand() abort
|
function! go#config#MetalinterCommand() abort
|
||||||
return get(g:, "go_metalinter_command", "")
|
return get(g:, "go_metalinter_command", "gometalinter")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterAutosaveEnabled() abort
|
function! go#config#MetalinterAutosaveEnabled() abort
|
||||||
return get(g:, 'go_metalinter_autosave_enabled', ['vet', 'golint'])
|
let l:default_enabled = ["vet", "golint"]
|
||||||
|
|
||||||
|
if go#config#MetalinterCommand() == "golangci-lint"
|
||||||
|
let l:default_enabled = ["govet", "golint"]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(g:, "go_metalinter_autosave_enabled", default_enabled)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterEnabled() abort
|
function! go#config#MetalinterEnabled() abort
|
||||||
return get(g:, "go_metalinter_enabled", ['vet', 'golint', 'errcheck'])
|
let l:default_enabled = ["vet", "golint", "errcheck"]
|
||||||
|
|
||||||
|
if go#config#MetalinterCommand() == "golangci-lint"
|
||||||
|
let l:default_enabled = ["govet", "golint"]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(g:, "go_metalinter_enabled", default_enabled)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterDisabled() abort
|
function! go#config#MetalinterDisabled() abort
|
||||||
@@ -448,6 +474,9 @@ function! go#config#EchoGoInfo() abort
|
|||||||
return get(g:, "go_echo_go_info", 1)
|
return get(g:, "go_echo_go_info", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#CodeCompletionEnabled() abort
|
||||||
|
return get(g:, "go_code_completion_enabled", 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Set the default value. A value of "1" is a shortcut for this, for
|
" Set the default value. A value of "1" is a shortcut for this, for
|
||||||
" compatibility reasons.
|
" compatibility reasons.
|
||||||
|
|||||||
41
autoload/jsx_pretty/comment.vim
Normal file
41
autoload/jsx_pretty/comment.vim
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! jsx_pretty#comment#update_commentstring(original)
|
||||||
|
let syn_current = s:syn_name(line('.'), col('.'))
|
||||||
|
let syn_start = s:syn_name(line('.'), 1)
|
||||||
|
let save_cursor = getcurpos()
|
||||||
|
|
||||||
|
if syn_start =~ '^jsx'
|
||||||
|
let line = getline(".")
|
||||||
|
let start = len(matchstr(line, '^\s*'))
|
||||||
|
let syn_name = s:syn_name(line('.'), start + 1)
|
||||||
|
|
||||||
|
if line =~ '^\s*//'
|
||||||
|
let &l:commentstring = '// %s'
|
||||||
|
elseif s:syn_contains(line('.'), col('.'), 'jsxTaggedRegion')
|
||||||
|
let &l:commentstring = '<!-- %s -->'
|
||||||
|
elseif syn_name =~ '^jsxAttrib'
|
||||||
|
let &l:commentstring = '// %s'
|
||||||
|
else
|
||||||
|
let &l:commentstring = '{/* %s */}'
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let &l:commentstring = a:original
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Restore the cursor position
|
||||||
|
call setpos('.', save_cursor)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_name(lnum, cnum)
|
||||||
|
let syn_id = get(synstack(a:lnum, a:cnum), -1)
|
||||||
|
return synIDattr(syn_id, "name")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_contains(lnum, cnum, syn_name)
|
||||||
|
let stack = synstack(a:lnum, a:cnum)
|
||||||
|
let syn_names = map(stack, 'synIDattr(v:val, "name")')
|
||||||
|
return index(syn_names, a:syn_name) >= 0
|
||||||
|
endfunction
|
||||||
204
autoload/jsx_pretty/indent.vim
Normal file
204
autoload/jsx_pretty/indent.vim
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
function! s:sw()
|
||||||
|
return shiftwidth()
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:sw()
|
||||||
|
return &sw
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Get the syntax group of start of line
|
||||||
|
function! s:syn_sol(lnum)
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
let sol = matchstr(line, '^\s*')
|
||||||
|
return map(synstack(a:lnum, len(sol) + 1), 'synIDattr(v:val, "name")')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the syntax group of end of line
|
||||||
|
function! s:syn_eol(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum)
|
||||||
|
let col = strlen(getline(lnum))
|
||||||
|
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:prev_indent(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum - 1)
|
||||||
|
return indent(lnum)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:prev_line(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum - 1)
|
||||||
|
return substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_attr_jsx(synattr)
|
||||||
|
return a:synattr =~ "^jsx"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_xmlish(syns)
|
||||||
|
return s:syn_attr_jsx(get(a:syns, -1))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_jsx_element(syns)
|
||||||
|
return get(a:syns, -1) =~ 'jsxElement'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_js_comment(syns)
|
||||||
|
return get(a:syns, -1) =~ 'Comment$'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_jsx_escapejs(syns)
|
||||||
|
return get(a:syns, -1) =~ '\(\(js\(Template\)\?\|javaScript\(Embed\)\?\|typescript\)Braces\|javascriptTemplateSB\|typescriptInterpolationDelimiter\)' &&
|
||||||
|
\ (get(a:syns, -2) =~ 'jsxEscapeJs' ||
|
||||||
|
\ get(a:syns, -3) =~ 'jsxEscapeJs')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_jsx_attrib(syns)
|
||||||
|
return len(filter(copy(a:syns), 'v:val =~ "jsxAttrib"'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let s:start_tag = '<\s*\([-:_\.\$0-9A-Za-z]\+\|>\)'
|
||||||
|
" match `/end_tag>` and `//>`
|
||||||
|
let s:end_tag = '/\%(\s*[-:_\.\$0-9A-Za-z]*\s*\|/\)>'
|
||||||
|
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||||
|
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
|
||||||
|
|
||||||
|
function! jsx_pretty#indent#get(js_indent)
|
||||||
|
let lnum = v:lnum
|
||||||
|
let line = substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
||||||
|
let current_syn = s:syn_sol(lnum)
|
||||||
|
let current_syn_eol = s:syn_eol(lnum)
|
||||||
|
let prev_syn_sol = s:syn_sol(lnum - 1)
|
||||||
|
let prev_syn_eol = s:syn_eol(lnum - 1)
|
||||||
|
let prev_line = s:prev_line(lnum)
|
||||||
|
let prev_ind = s:prev_indent(lnum)
|
||||||
|
|
||||||
|
if s:syn_xmlish(current_syn)
|
||||||
|
|
||||||
|
" {
|
||||||
|
" <div></div>
|
||||||
|
" ##} <--
|
||||||
|
if s:syn_jsx_element(current_syn) && line =~ '}$'
|
||||||
|
let pair_line = searchpair('{', '', '}', 'b')
|
||||||
|
return indent(pair_line)
|
||||||
|
elseif line =~ '^-->$'
|
||||||
|
if prev_line =~ '^<!--'
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
endif
|
||||||
|
elseif prev_line =~ '-->$'
|
||||||
|
return prev_ind
|
||||||
|
" close tag </tag> or /> including </>
|
||||||
|
elseif prev_line =~ s:end_tag . '$'
|
||||||
|
if line =~ '^<\s*' . s:end_tag
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
elseif s:syn_jsx_attrib(prev_syn_sol)
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
elseif line =~ '^\(>\|/\s*>\)'
|
||||||
|
if prev_line =~ '^<'
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
endif
|
||||||
|
elseif prev_line =~ '^\(<\|>\)' &&
|
||||||
|
\ (s:syn_xmlish(prev_syn_eol) || s:syn_js_comment(prev_syn_eol))
|
||||||
|
if line =~ '^<\s*' . s:end_tag
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return prev_ind + s:sw()
|
||||||
|
endif
|
||||||
|
elseif line =~ '^<\s*' . s:end_tag
|
||||||
|
if !s:syn_xmlish(prev_syn_sol)
|
||||||
|
if s:syn_jsx_escapejs(prev_syn_eol)
|
||||||
|
\ || s:syn_jsx_escapejs(prev_syn_sol)
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return prev_ind - s:sw()
|
||||||
|
endif
|
||||||
|
elseif !s:syn_xmlish(prev_syn_eol)
|
||||||
|
if prev_line =~ '\(&&\|||\|=>\|[([{]\|`\)$'
|
||||||
|
" <div>
|
||||||
|
" {
|
||||||
|
" }
|
||||||
|
" </div>
|
||||||
|
if line =~ '^[)\]}]'
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return prev_ind + s:sw()
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
elseif !s:syn_xmlish(prev_syn_sol)
|
||||||
|
if prev_line =~ '^\<\(return\|default\|await\|yield\)'
|
||||||
|
if line !~ '^/\s*>' || line !~ '^<\s*' . s:end_tag
|
||||||
|
return prev_ind + s:sw()
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return prev_ind
|
||||||
|
endif
|
||||||
|
elseif s:syn_jsx_escapejs(current_syn)
|
||||||
|
if line =~ '^}'
|
||||||
|
let char = getline('.')[col('.') - 1]
|
||||||
|
" When pressing enter after the }, keep the indent
|
||||||
|
if char != '}' && search('}', 'b', lnum)
|
||||||
|
return indent(lnum)
|
||||||
|
else
|
||||||
|
let pair_line = searchpair('{', '', '}', 'bW')
|
||||||
|
return indent(pair_line)
|
||||||
|
endif
|
||||||
|
elseif line =~ '^{' || line =~ '^\${'
|
||||||
|
if s:syn_jsx_escapejs(prev_syn_eol)
|
||||||
|
\ || s:syn_jsx_attrib(prev_syn_sol)
|
||||||
|
return prev_ind
|
||||||
|
elseif s:syn_xmlish(prev_syn_eol) && (prev_line =~ s:end_tag || prev_line =~ '-->$')
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return prev_ind + s:sw()
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
elseif s:syn_jsx_escapejs(current_syn_eol)
|
||||||
|
let pair_line = searchpair('{', '', '}', 'bW')
|
||||||
|
return indent(pair_line)
|
||||||
|
elseif line =~ '^/[/*]' " js comment in jsx tag
|
||||||
|
if get(prev_syn_sol, -1) =~ 'Punct'
|
||||||
|
return prev_ind + s:sw()
|
||||||
|
elseif synIDattr(synID(lnum - 1, 1, 1), 'name') =~ 'jsxTag'
|
||||||
|
return prev_ind
|
||||||
|
else
|
||||||
|
return a:js_indent()
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let ind = a:js_indent()
|
||||||
|
|
||||||
|
" If current syntax is not a jsx syntax group
|
||||||
|
if s:syn_xmlish(prev_syn_eol) && line !~ '^[)\]}]'
|
||||||
|
let sol = matchstr(line, s:opfirst)
|
||||||
|
if sol is ''
|
||||||
|
" Fix javascript continue indent
|
||||||
|
return ind - s:sw()
|
||||||
|
else
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfunction
|
||||||
218
autoload/jsx_pretty/syntax.vim
Normal file
218
autoload/jsx_pretty/syntax.vim
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! jsx_pretty#syntax#highlight()
|
||||||
|
|
||||||
|
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~~~~~~~~~~~~~~~~~
|
||||||
|
" and self close tag
|
||||||
|
" <tag id="sample" />
|
||||||
|
" ~~~~~~~~~~~~~~~~~~~
|
||||||
|
syntax region jsxTag
|
||||||
|
\ start=+<+
|
||||||
|
\ matchgroup=jsxOpenPunct
|
||||||
|
\ end=+>+
|
||||||
|
\ matchgroup=NONE
|
||||||
|
\ end=+\(/\_s*>\)\@=+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxOpenTag,jsxEscapeJs,jsxAttrib,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment,jsxSpreadOperator
|
||||||
|
\ keepend
|
||||||
|
\ extend
|
||||||
|
|
||||||
|
" <tag></tag>
|
||||||
|
" ~~~~~~~~~~~
|
||||||
|
" and fragment
|
||||||
|
" <></>
|
||||||
|
" ~~~~~
|
||||||
|
" and self close tag
|
||||||
|
" <tag />
|
||||||
|
" ~~~~~~~
|
||||||
|
syntax region jsxElement
|
||||||
|
\ start=+<\_s*\(>\|\${\|\z(\<[-:_\.\$0-9A-Za-z]\+\>\)\)+
|
||||||
|
\ end=+/\_s*>+
|
||||||
|
\ end=+<\_s*/\_s*\z1\_s*>+
|
||||||
|
\ contains=jsxElement,jsxEscapeJs,jsxTag,jsxComment,jsxCloseString,jsxCloseTag,@Spell
|
||||||
|
\ keepend
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ fold
|
||||||
|
|
||||||
|
" detect jsx region
|
||||||
|
syntax region jsxRegion
|
||||||
|
\ start=+\(\(\_[([,?:=+\-*/<>{}]\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\(>\|\z(\(script\)\@!\<[_\$A-Za-z][-:_\.\$0-9A-Za-z]*\>\)\(\_s*\([-+*)\]}&|?]\|/\([/*]\|\_s*>\)\@!\)\)\@!\)+
|
||||||
|
\ end=++
|
||||||
|
\ contains=jsxElement
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~~~~~~~~~~~~~~
|
||||||
|
syntax region jsxEscapeJs
|
||||||
|
\ start=+{+
|
||||||
|
\ end=++
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ contains=jsBlock,javascriptBlock,javaScriptBlockBuildIn,typescriptBlock
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~~
|
||||||
|
" and fragment start tag
|
||||||
|
" <>
|
||||||
|
" ~~
|
||||||
|
exe 'syntax region jsxOpenTag
|
||||||
|
\ matchgroup=jsxOpenPunct
|
||||||
|
\ start=+<+
|
||||||
|
\ end=+>+
|
||||||
|
\ matchgroup=NONE
|
||||||
|
\ end=+\>+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxTagName
|
||||||
|
\ nextgroup=jsxAttrib
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||||
|
|
||||||
|
" <foo.bar>
|
||||||
|
" ~
|
||||||
|
syntax match jsxDot +\.+ contained display
|
||||||
|
|
||||||
|
" <foo:bar>
|
||||||
|
" ~
|
||||||
|
syntax match jsxNamespace +:+ contained display
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~
|
||||||
|
syntax match jsxEqual +=+ contained display nextgroup=jsxString,jsxEscapeJs,jsxRegion skipwhite
|
||||||
|
|
||||||
|
" <tag />
|
||||||
|
" ~~
|
||||||
|
syntax match jsxCloseString +/\_s*>+ contained
|
||||||
|
|
||||||
|
" </tag>
|
||||||
|
" ~~~~~~
|
||||||
|
" and fragment close tag
|
||||||
|
" </>
|
||||||
|
" ~~~
|
||||||
|
syntax region jsxCloseTag
|
||||||
|
\ matchgroup=jsxClosePunct
|
||||||
|
\ start=+<\_s*/+
|
||||||
|
\ end=+>+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxTagName
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~
|
||||||
|
syntax match jsxAttrib
|
||||||
|
\ +\<[-A-Za-z_][-:_\$0-9A-Za-z]*\>+
|
||||||
|
\ contained
|
||||||
|
\ nextgroup=jsxEqual
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty
|
||||||
|
\ contains=jsxAttribKeyword
|
||||||
|
\ display
|
||||||
|
|
||||||
|
" <MyComponent ...>
|
||||||
|
" ~~~~~~~~~~~
|
||||||
|
" NOT
|
||||||
|
" <someCamel ...>
|
||||||
|
" ~~~~~
|
||||||
|
exe 'syntax match jsxComponentName
|
||||||
|
\ +\<[A-Z][\$0-9A-Za-z]\+\>+
|
||||||
|
\ contained
|
||||||
|
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~
|
||||||
|
exe 'syntax match jsxTagName
|
||||||
|
\ +\<[-:_\.\$0-9A-Za-z]\+\>+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxComponentName,jsxDot,jsxNamespace
|
||||||
|
\ nextgroup=jsxAttrib
|
||||||
|
\ skipempty
|
||||||
|
\ skipwhite
|
||||||
|
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~~~~~~~~
|
||||||
|
" and
|
||||||
|
" <tag id='sample'>
|
||||||
|
" ~~~~~~~~
|
||||||
|
syntax region jsxString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ contained contains=@Spell display
|
||||||
|
|
||||||
|
let s:tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'raw'])
|
||||||
|
let s:enable_tagged_jsx = !empty(s:tags)
|
||||||
|
|
||||||
|
" add support to JSX inside the tagged template string
|
||||||
|
" https://github.com/developit/htm
|
||||||
|
if s:enable_tagged_jsx
|
||||||
|
exe 'syntax region jsxTaggedRegion
|
||||||
|
\ start=+\%('. join(s:tags, '\|') .'\)\@<=`+ms=s+1
|
||||||
|
\ end=+`+me=e-1
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ containedin=jsTemplateString,javascriptTemplate,javaScriptStringT,typescriptStringB
|
||||||
|
\ contains=jsxElement'
|
||||||
|
|
||||||
|
syntax region jsxEscapeJs
|
||||||
|
\ start=+\${+
|
||||||
|
\ end=++
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ contains=jsTemplateExpression,javascriptTemplateSubstitution,javaScriptEmbed,typescriptInterpolation
|
||||||
|
|
||||||
|
syntax region jsxOpenTag
|
||||||
|
\ matchgroup=jsxOpenPunct
|
||||||
|
\ start=+<\%(\${\)\@=+
|
||||||
|
\ matchgroup=NONE
|
||||||
|
\ end=++
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxEscapeJs
|
||||||
|
\ nextgroup=jsxAttrib,jsxSpreadOperator
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty
|
||||||
|
|
||||||
|
syntax keyword jsxAttribKeyword class contained display
|
||||||
|
|
||||||
|
syntax match jsxSpreadOperator +\.\.\.+ contained display nextgroup=jsxEscapeJs skipwhite
|
||||||
|
|
||||||
|
syntax match jsxCloseTag +<//>+ display
|
||||||
|
|
||||||
|
syntax match jsxComment +<!--\_.\{-}-->+ display
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Highlight the tag name
|
||||||
|
highlight def link jsxTag Function
|
||||||
|
highlight def link jsxTagName Identifier
|
||||||
|
highlight def link jsxComponentName Function
|
||||||
|
|
||||||
|
highlight def link jsxAttrib Type
|
||||||
|
highlight def link jsxAttribKeyword jsxAttrib
|
||||||
|
highlight def link jsxEqual Operator
|
||||||
|
highlight def link jsxString String
|
||||||
|
highlight def link jsxDot Operator
|
||||||
|
highlight def link jsxNamespace Operator
|
||||||
|
|
||||||
|
" Highlight the jsxCloseString (i.e. />), jsxPunct (i.e. <,>) and jsxCloseTag (i.e. <//>)
|
||||||
|
highlight def link jsxCloseString Comment
|
||||||
|
highlight def link jsxPunct jsxCloseString
|
||||||
|
highlight def link jsxOpenPunct jsxPunct
|
||||||
|
highlight def link jsxClosePunct jsxPunct
|
||||||
|
highlight def link jsxCloseTag jsxCloseString
|
||||||
|
|
||||||
|
highlight def link jsxComment Comment
|
||||||
|
highlight def link jsxSpreadOperator Operator
|
||||||
|
|
||||||
|
if s:highlight_close_tag
|
||||||
|
highlight! def link jsxOpenPunct jsxTag
|
||||||
|
highlight! def link jsxCloseString Identifier
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:vim_jsx_pretty_colorful_config = get(g:, 'vim_jsx_pretty_colorful_config', 0)
|
||||||
|
|
||||||
|
if s:vim_jsx_pretty_colorful_config == 1
|
||||||
|
highlight def link jsObjectKey Label
|
||||||
|
highlight def link jsArrowFuncArgs Type
|
||||||
|
highlight def link jsFuncArgs Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfunction
|
||||||
@@ -3,7 +3,7 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
||||||
" The symbols are based on Julia version 1.1.0-DEV.695
|
" The symbols are based on Julia version 1.3.0-DEV.263
|
||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
@@ -392,6 +392,7 @@ function! julia_latex_symbols#get_dict()
|
|||||||
\ '\trademark': '™',
|
\ '\trademark': '™',
|
||||||
\ '\:tm:': '™',
|
\ '\:tm:': '™',
|
||||||
\ '\bbZ': 'ℤ',
|
\ '\bbZ': 'ℤ',
|
||||||
|
\ '\ohm': 'Ω',
|
||||||
\ '\mho': '℧',
|
\ '\mho': '℧',
|
||||||
\ '\frakZ': 'ℨ',
|
\ '\frakZ': 'ℨ',
|
||||||
\ '\turnediota': '℩',
|
\ '\turnediota': '℩',
|
||||||
@@ -498,8 +499,8 @@ function! julia_latex_symbols#get_dict()
|
|||||||
\ '\circlearrowright': '↻',
|
\ '\circlearrowright': '↻',
|
||||||
\ '\leftharpoonup': '↼',
|
\ '\leftharpoonup': '↼',
|
||||||
\ '\leftharpoondown': '↽',
|
\ '\leftharpoondown': '↽',
|
||||||
\ '\upharpoonleft': '↾',
|
\ '\upharpoonright': '↾',
|
||||||
\ '\upharpoonright': '↿',
|
\ '\upharpoonleft': '↿',
|
||||||
\ '\rightharpoonup': '⇀',
|
\ '\rightharpoonup': '⇀',
|
||||||
\ '\rightharpoondown': '⇁',
|
\ '\rightharpoondown': '⇁',
|
||||||
\ '\downharpoonright': '⇂',
|
\ '\downharpoonright': '⇂',
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'racket') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:raco_command")
|
|
||||||
let g:raco_command = system("which raco")
|
|
||||||
endif
|
|
||||||
@@ -149,6 +149,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
|
|
||||||
call delete(l:stderr_tmpname)
|
call delete(l:stderr_tmpname)
|
||||||
|
|
||||||
|
let l:open_lwindow = 0
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0
|
||||||
" remove undo point caused via BufWritePre
|
" remove undo point caused via BufWritePre
|
||||||
try | silent undojoin | catch | endtry
|
try | silent undojoin | catch | endtry
|
||||||
@@ -169,7 +170,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
if s:got_fmt_error
|
if s:got_fmt_error
|
||||||
let s:got_fmt_error = 0
|
let s:got_fmt_error = 0
|
||||||
call setloclist(0, [])
|
call setloclist(0, [])
|
||||||
lwindow
|
let l:open_lwindow = 1
|
||||||
endif
|
endif
|
||||||
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
|
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
|
||||||
" otherwise get the errors and put them in the location list
|
" otherwise get the errors and put them in the location list
|
||||||
@@ -201,7 +202,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:got_fmt_error = 1
|
let s:got_fmt_error = 1
|
||||||
lwindow
|
let l:open_lwindow = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Restore the current directory if needed
|
" Restore the current directory if needed
|
||||||
@@ -213,6 +214,11 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Open lwindow after we have changed back to the previous directory
|
||||||
|
if l:open_lwindow == 1
|
||||||
|
lwindow
|
||||||
|
endif
|
||||||
|
|
||||||
silent! loadview
|
silent! loadview
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -234,6 +240,9 @@ function! rustfmt#Cmd()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rustfmt#PreWrite()
|
function! rustfmt#PreWrite()
|
||||||
|
if !filereadable(expand("%@"))
|
||||||
|
return
|
||||||
|
endif
|
||||||
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
|
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
|
||||||
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
|
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
|
||||||
let b:rustfmt_autosave = 1
|
let b:rustfmt_autosave = 1
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" usage:
|
|
||||||
" set indentexpr=scss_indent#GetIndent(v:lnum)
|
|
||||||
fun! scss_indent#GetIndent(lnum)
|
|
||||||
" { -> increase indent
|
|
||||||
" } -> decrease indent
|
|
||||||
if a:lnum == 1
|
|
||||||
" start at 0 indentation
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" try to find last line ending with { or }
|
|
||||||
" ignoring // comments
|
|
||||||
let regex = '\([{}]\)\%(\/\/.*\)\?$'
|
|
||||||
let nr = search(regex, 'bnW')
|
|
||||||
if nr > 0
|
|
||||||
let last = indent(nr)
|
|
||||||
let m = matchlist(getline(nr), regex)
|
|
||||||
let m_curr = matchlist(getline(a:lnum), regex)
|
|
||||||
echoe string(m).string(m_curr)
|
|
||||||
if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
|
|
||||||
" last was open, current is close, use same indent
|
|
||||||
return last
|
|
||||||
elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
|
|
||||||
" } line and last line was }: decrease
|
|
||||||
return last - &sw
|
|
||||||
endif
|
|
||||||
if m[1] == '{'
|
|
||||||
" line after {: increase indent
|
|
||||||
return last + &sw
|
|
||||||
else
|
|
||||||
" line after } or { - same indent
|
|
||||||
return last
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
25
autoload/terraform.vim
Normal file
25
autoload/terraform.vim
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Adapted from vim-hclfmt:
|
||||||
|
" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim
|
||||||
|
function! terraform#fmt()
|
||||||
|
if !filereadable(expand('%:p'))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
let l:tmpfile = tempname() . '.tf'
|
||||||
|
call writefile(getline(1, '$'), l:tmpfile)
|
||||||
|
let output = system('terraform fmt -write ' . l:tmpfile)
|
||||||
|
if v:shell_error == 0
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
call rename(l:tmpfile, resolve(expand('%')))
|
||||||
|
silent edit!
|
||||||
|
let &syntax = &syntax
|
||||||
|
else
|
||||||
|
echo output
|
||||||
|
call delete(l:tmpfile)
|
||||||
|
endif
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endfunction
|
||||||
43
autoload/zig/config.vim
Normal file
43
autoload/zig/config.vim
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! zig#config#ListTypeCommands() abort
|
||||||
|
return get(g:, 'zig_list_type_commands', {})
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListType() abort
|
||||||
|
return get(g:, 'zig_list_type', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListAutoclose() abort
|
||||||
|
return get(g:, 'zig_list_autoclose', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListHeight() abort
|
||||||
|
return get(g:, "zig_list_height", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtAutosave() abort
|
||||||
|
return get(g:, "zig_fmt_autosave", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#SetFmtAutosave(value) abort
|
||||||
|
let g:zig_fmt_autosave = a:value
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtCommand() abort
|
||||||
|
return get(g:, "zig_fmt_command", ['zig', 'fmt', '--color', 'off'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtFailSilently() abort
|
||||||
|
return get(g:, "zig_fmt_fail_silently", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtExperimental() abort
|
||||||
|
return get(g:, "zig_fmt_experimental", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#Debug() abort
|
||||||
|
return get(g:, 'zig_debug', [])
|
||||||
|
endfunction
|
||||||
170
autoload/zig/fmt.vim
Normal file
170
autoload/zig/fmt.vim
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Adapted from fatih/vim-go: autoload/go/fmt.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
function! zig#fmt#Format() abort
|
||||||
|
if zig#config#FmtExperimental()
|
||||||
|
" Using winsaveview to save/restore cursor state has the problem of
|
||||||
|
" closing folds on save:
|
||||||
|
" https://github.com/fatih/vim-go/issues/502
|
||||||
|
" One fix is to use mkview instead. Unfortunately, this sometimes causes
|
||||||
|
" other bad side effects:
|
||||||
|
" https://github.com/fatih/vim-go/issues/728
|
||||||
|
" and still closes all folds if foldlevel>0:
|
||||||
|
" https://github.com/fatih/vim-go/issues/732
|
||||||
|
let l:curw = {}
|
||||||
|
try
|
||||||
|
mkview!
|
||||||
|
catch
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
endtry
|
||||||
|
|
||||||
|
" save our undo file to be restored after we are done. This is needed to
|
||||||
|
" prevent an additional undo jump due to BufWritePre auto command and also
|
||||||
|
" restore 'redo' history because it's getting being destroyed every
|
||||||
|
" BufWritePre
|
||||||
|
let tmpundofile = tempname()
|
||||||
|
exe 'wundo! ' . tmpundofile
|
||||||
|
else
|
||||||
|
" Save cursor position and many other things.
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Save cursor position and many other things.
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
|
||||||
|
let bin_name = zig#config#FmtCommand()
|
||||||
|
|
||||||
|
" Get current position in file
|
||||||
|
let current_col = col('.')
|
||||||
|
let orig_line_count = line('$')
|
||||||
|
|
||||||
|
" Save current buffer first, else fmt will run on the original file and we
|
||||||
|
" will lose our changes.
|
||||||
|
silent! execute 'write' expand('%')
|
||||||
|
|
||||||
|
let [l:out, l:err] = zig#fmt#run(bin_name, expand('%'))
|
||||||
|
|
||||||
|
if l:err == 0
|
||||||
|
call zig#fmt#update_file(expand('%'))
|
||||||
|
elseif !zig#config#FmtFailSilently()
|
||||||
|
let errors = s:parse_errors(expand('%'), out)
|
||||||
|
call s:show_errors(errors)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let diff_offset = line('$') - orig_line_count
|
||||||
|
|
||||||
|
if zig#config#FmtExperimental()
|
||||||
|
" restore our undo history
|
||||||
|
silent! exe 'rundo ' . tmpundofile
|
||||||
|
call delete(tmpundofile)
|
||||||
|
|
||||||
|
" Restore our cursor/windows positions, folds, etc.
|
||||||
|
if empty(l:curw)
|
||||||
|
silent! loadview
|
||||||
|
else
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" Restore our cursor/windows positions.
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" be smart and jump to the line the new statement was added/removed
|
||||||
|
call cursor(line('.') + diff_offset, current_col)
|
||||||
|
|
||||||
|
" Syntax highlighting breaks less often.
|
||||||
|
syntax sync fromstart
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" update_file updates the target file with the given formatted source
|
||||||
|
function! zig#fmt#update_file(target)
|
||||||
|
" remove undo point caused via BufWritePre
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
|
||||||
|
" reload buffer to reflect latest changes
|
||||||
|
silent edit!
|
||||||
|
|
||||||
|
let l:listtype = zig#list#Type("ZigFmt")
|
||||||
|
|
||||||
|
" the title information was introduced with 7.4-2200
|
||||||
|
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||||
|
if has('patch-7.4.2200')
|
||||||
|
" clean up previous list
|
||||||
|
if l:listtype == "quickfix"
|
||||||
|
let l:list_title = getqflist({'title': 1})
|
||||||
|
else
|
||||||
|
let l:list_title = getloclist(0, {'title': 1})
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" can't check the title, so assume that the list was for go fmt.
|
||||||
|
let l:list_title = {'title': 'Format'}
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
|
||||||
|
call zig#list#Clean(l:listtype)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" run runs the gofmt/goimport command for the given source file and returns
|
||||||
|
" the output of the executed command. Target is the real file to be formatted.
|
||||||
|
function! zig#fmt#run(bin_name, target)
|
||||||
|
let l:cmd = []
|
||||||
|
call extend(cmd, a:bin_name)
|
||||||
|
call extend(cmd, [a:target])
|
||||||
|
return zig#util#Exec(l:cmd)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" parse_errors parses the given errors and returns a list of parsed errors
|
||||||
|
function! s:parse_errors(filename, content) abort
|
||||||
|
let splitted = split(a:content, '\n')
|
||||||
|
|
||||||
|
" list of errors to be put into location list
|
||||||
|
let errors = []
|
||||||
|
for line in splitted
|
||||||
|
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
|
||||||
|
if !empty(tokens)
|
||||||
|
call add(errors,{
|
||||||
|
\"filename": a:filename,
|
||||||
|
\"lnum": tokens[2],
|
||||||
|
\"col": tokens[3],
|
||||||
|
\"text": tokens[4],
|
||||||
|
\ })
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return errors
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" show_errors opens a location list and shows the given errors. If the given
|
||||||
|
" errors is empty, it closes the the location list
|
||||||
|
function! s:show_errors(errors) abort
|
||||||
|
let l:listtype = zig#list#Type("ZigFmt")
|
||||||
|
if !empty(a:errors)
|
||||||
|
call zig#list#Populate(l:listtype, a:errors, 'Format')
|
||||||
|
echohl Error | echomsg "zig fmt returned error" | echohl None
|
||||||
|
endif
|
||||||
|
|
||||||
|
" this closes the window if there are no errors or it opens
|
||||||
|
" it if there is any
|
||||||
|
call zig#list#Window(l:listtype, len(a:errors))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#fmt#ToggleFmtAutoSave() abort
|
||||||
|
if zig#config#FmtAutosave()
|
||||||
|
call zig#config#SetFmtAutosave(0)
|
||||||
|
call zig#util#EchoProgress("auto fmt disabled")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
call zig#config#SetFmtAutosave(1)
|
||||||
|
call zig#util#EchoProgress("auto fmt enabled")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
162
autoload/zig/list.vim
Normal file
162
autoload/zig/list.vim
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Adapted from fatih/vim-go: autoload/go/list.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
|
||||||
|
" Window opens the list with the given height up to 10 lines maximum.
|
||||||
|
" Otherwise g:zig_loclist_height is used.
|
||||||
|
"
|
||||||
|
" If no or zero height is given it closes the window by default.
|
||||||
|
" To prevent this, set g:zig_list_autoclose = 0
|
||||||
|
function! zig#list#Window(listtype, ...) abort
|
||||||
|
" we don't use lwindow to close the location list as we need also the
|
||||||
|
" ability to resize the window. So, we are going to use lopen and lclose
|
||||||
|
" for a better user experience. If the number of errors in a current
|
||||||
|
" location list increases/decreases, cwindow will not resize when a new
|
||||||
|
" updated height is passed. lopen in the other hand resizes the screen.
|
||||||
|
if !a:0 || a:1 == 0
|
||||||
|
call zig#list#Close(a:listtype)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let height = zig#config#ListHeight()
|
||||||
|
if height == 0
|
||||||
|
" prevent creating a large location height for a large set of numbers
|
||||||
|
if a:1 > 10
|
||||||
|
let height = 10
|
||||||
|
else
|
||||||
|
let height = a:1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
exe 'lopen ' . height
|
||||||
|
else
|
||||||
|
exe 'copen ' . height
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Get returns the current items from the list
|
||||||
|
function! zig#list#Get(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
return getloclist(0)
|
||||||
|
else
|
||||||
|
return getqflist()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Populate populate the list with the given items
|
||||||
|
function! zig#list#Populate(listtype, items, title) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
call setloclist(0, a:items, 'r')
|
||||||
|
|
||||||
|
" The last argument ({what}) is introduced with 7.4.2200:
|
||||||
|
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||||
|
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||||
|
else
|
||||||
|
call setqflist(a:items, 'r')
|
||||||
|
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Parse parses the given items based on the specified errorformat and
|
||||||
|
" populates the list.
|
||||||
|
function! zig#list#ParseFormat(listtype, errformat, items, title) abort
|
||||||
|
" backup users errorformat, will be restored once we are finished
|
||||||
|
let old_errorformat = &errorformat
|
||||||
|
|
||||||
|
" parse and populate the location list
|
||||||
|
let &errorformat = a:errformat
|
||||||
|
try
|
||||||
|
call zig#list#Parse(a:listtype, a:items, a:title)
|
||||||
|
finally
|
||||||
|
"restore back
|
||||||
|
let &errorformat = old_errorformat
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Parse parses the given items based on the global errorformat and
|
||||||
|
" populates the list.
|
||||||
|
function! zig#list#Parse(listtype, items, title) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lgetexpr a:items
|
||||||
|
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||||
|
else
|
||||||
|
cgetexpr a:items
|
||||||
|
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" JumpToFirst jumps to the first item in the location list
|
||||||
|
function! zig#list#JumpToFirst(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
ll 1
|
||||||
|
else
|
||||||
|
cc 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Clean cleans and closes the location list
|
||||||
|
function! zig#list#Clean(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lex []
|
||||||
|
else
|
||||||
|
cex []
|
||||||
|
endif
|
||||||
|
|
||||||
|
call zig#list#Close(a:listtype)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Close closes the location list
|
||||||
|
function! zig#list#Close(listtype) abort
|
||||||
|
let autoclose_window = zig#config#ListAutoclose()
|
||||||
|
if !autoclose_window
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lclose
|
||||||
|
else
|
||||||
|
cclose
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:listtype(listtype) abort
|
||||||
|
let listtype = zig#config#ListType()
|
||||||
|
if empty(listtype)
|
||||||
|
return a:listtype
|
||||||
|
endif
|
||||||
|
|
||||||
|
return listtype
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" s:default_list_type_commands is the defaults that will be used for each of
|
||||||
|
" the supported commands (see documentation for g:zig_list_type_commands). When
|
||||||
|
" defining a default, quickfix should be used if the command operates on
|
||||||
|
" multiple files, while locationlist should be used if the command operates on a
|
||||||
|
" single file or buffer. Keys that begin with an underscore are not supported
|
||||||
|
" in g:zig_list_type_commands.
|
||||||
|
let s:default_list_type_commands = {
|
||||||
|
\ "ZigFmt": "locationlist",
|
||||||
|
\ }
|
||||||
|
|
||||||
|
function! zig#list#Type(for) abort
|
||||||
|
let l:listtype = s:listtype(get(s:default_list_type_commands, a:for))
|
||||||
|
if l:listtype == "0"
|
||||||
|
call zig#util#EchoError(printf(
|
||||||
|
\ "unknown list type command value found ('%s'). Please open a bug report in the zig.vim repo.",
|
||||||
|
\ a:for))
|
||||||
|
let l:listtype = "quickfix"
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(zig#config#ListTypeCommands(), a:for, l:listtype)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
394
autoload/zig/util.vim
Normal file
394
autoload/zig/util.vim
Normal file
@@ -0,0 +1,394 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Adapted from vim-go: autoload/go/util.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
|
||||||
|
" PathSep returns the appropriate OS specific path separator.
|
||||||
|
function! zig#util#PathSep() abort
|
||||||
|
if zig#util#IsWin()
|
||||||
|
return '\'
|
||||||
|
endif
|
||||||
|
return '/'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" PathListSep returns the appropriate OS specific path list separator.
|
||||||
|
function! zig#util#PathListSep() abort
|
||||||
|
if zig#util#IsWin()
|
||||||
|
return ";"
|
||||||
|
endif
|
||||||
|
return ":"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" LineEnding returns the correct line ending, based on the current fileformat
|
||||||
|
function! zig#util#LineEnding() abort
|
||||||
|
if &fileformat == 'dos'
|
||||||
|
return "\r\n"
|
||||||
|
elseif &fileformat == 'mac'
|
||||||
|
return "\r"
|
||||||
|
endif
|
||||||
|
|
||||||
|
return "\n"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Join joins any number of path elements into a single path, adding a
|
||||||
|
" Separator if necessary and returns the result
|
||||||
|
function! zig#util#Join(...) abort
|
||||||
|
return join(a:000, zig#util#PathSep())
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
||||||
|
function! zig#util#IsWin() abort
|
||||||
|
let win = ['win16', 'win32', 'win64', 'win95']
|
||||||
|
for w in win
|
||||||
|
if (has(w))
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" IsMac returns 1 if current OS is macOS or 0 otherwise.
|
||||||
|
function! zig#util#IsMac() abort
|
||||||
|
return has('mac') ||
|
||||||
|
\ has('macunix') ||
|
||||||
|
\ has('gui_macvim') ||
|
||||||
|
\ zig#util#Exec(['uname'])[0] =~? '^darwin'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Checks if using:
|
||||||
|
" 1) Windows system,
|
||||||
|
" 2) And has cygpath executable,
|
||||||
|
" 3) And uses *sh* as 'shell'
|
||||||
|
function! zig#util#IsUsingCygwinShell()
|
||||||
|
return zig#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if Vim jobs API is supported.
|
||||||
|
"
|
||||||
|
" The (optional) first paramter can be added to indicate the 'cwd' or 'env'
|
||||||
|
" parameters will be used, which wasn't added until a later version.
|
||||||
|
function! zig#util#has_job(...) abort
|
||||||
|
" cwd and env parameters to job_start was added in this version.
|
||||||
|
if a:0 > 0 && a:1 is 1
|
||||||
|
return has('job') && has("patch-8.0.0902")
|
||||||
|
endif
|
||||||
|
|
||||||
|
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
|
||||||
|
" of the latest is 8.0.0087 which is required for a stable async API.
|
||||||
|
return has('job') && has("patch-8.0.0087")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let s:env_cache = {}
|
||||||
|
|
||||||
|
" env returns the go environment variable for the given key. Where key can be
|
||||||
|
" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached
|
||||||
|
" version.
|
||||||
|
function! zig#util#env(key) abort
|
||||||
|
let l:key = tolower(a:key)
|
||||||
|
if has_key(s:env_cache, l:key)
|
||||||
|
return s:env_cache[l:key]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if executable('go')
|
||||||
|
let l:var = call('zig#util#'.l:key, [])
|
||||||
|
if zig#util#ShellError() != 0
|
||||||
|
call zig#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let l:var = eval("$".toupper(a:key))
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:env_cache[l:key] = l:var
|
||||||
|
return l:var
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Run a shell command.
|
||||||
|
"
|
||||||
|
" It will temporary set the shell to /bin/sh for Unix-like systems if possible,
|
||||||
|
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
|
||||||
|
" csh, fish, etc.) See #988 and #1276.
|
||||||
|
function! s:system(cmd, ...) abort
|
||||||
|
" Preserve original shell and shellredir values
|
||||||
|
let l:shell = &shell
|
||||||
|
let l:shellredir = &shellredir
|
||||||
|
|
||||||
|
if !zig#util#IsWin() && executable('/bin/sh')
|
||||||
|
set shell=/bin/sh shellredir=>%s\ 2>&1
|
||||||
|
endif
|
||||||
|
|
||||||
|
try
|
||||||
|
return call('system', [a:cmd] + a:000)
|
||||||
|
finally
|
||||||
|
" Restore original values
|
||||||
|
let &shell = l:shell
|
||||||
|
let &shellredir = l:shellredir
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" System runs a shell command "str". Every arguments after "str" is passed to
|
||||||
|
" stdin.
|
||||||
|
function! zig#util#System(str, ...) abort
|
||||||
|
return call('s:system', [a:str] + a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Exec runs a shell command "cmd", which must be a list, one argument per item.
|
||||||
|
" Every list entry will be automatically shell-escaped
|
||||||
|
" Every other argument is passed to stdin.
|
||||||
|
function! zig#util#Exec(cmd, ...) abort
|
||||||
|
if len(a:cmd) == 0
|
||||||
|
call zig#util#EchoError("zig#util#Exec() called with empty a:cmd")
|
||||||
|
return ['', 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:bin = a:cmd[0]
|
||||||
|
|
||||||
|
if !executable(l:bin)
|
||||||
|
call zig#util#EchoError(printf("could not find binary '%s'", a:cmd[0]))
|
||||||
|
return ['', 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return call('s:exec', [a:cmd] + a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:exec(cmd, ...) abort
|
||||||
|
let l:bin = a:cmd[0]
|
||||||
|
let l:cmd = zig#util#Shelljoin([l:bin] + a:cmd[1:])
|
||||||
|
if zig#util#HasDebug('shell-commands')
|
||||||
|
call zig#util#EchoInfo('shell command: ' . l:cmd)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:out = call('s:system', [l:cmd] + a:000)
|
||||||
|
return [l:out, zig#util#ShellError()]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#util#ShellError() abort
|
||||||
|
return v:shell_error
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" StripPath strips the path's last character if it's a path separator.
|
||||||
|
" example: '/foo/bar/' -> '/foo/bar'
|
||||||
|
function! zig#util#StripPathSep(path) abort
|
||||||
|
let last_char = strlen(a:path) - 1
|
||||||
|
if a:path[last_char] == zig#util#PathSep()
|
||||||
|
return strpart(a:path, 0, last_char)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return a:path
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" StripTrailingSlash strips the trailing slash from the given path list.
|
||||||
|
" example: ['/foo/bar/'] -> ['/foo/bar']
|
||||||
|
function! zig#util#StripTrailingSlash(paths) abort
|
||||||
|
return map(copy(a:paths), 'zig#util#StripPathSep(v:val)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Shelljoin returns a shell-safe string representation of arglist. The
|
||||||
|
" {special} argument of shellescape() may optionally be passed.
|
||||||
|
function! zig#util#Shelljoin(arglist, ...) abort
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
if a:0
|
||||||
|
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
fu! zig#util#Shellescape(arg)
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
return shellescape(a:arg)
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endf
|
||||||
|
|
||||||
|
" Shelllist returns a shell-safe representation of the items in the given
|
||||||
|
" arglist. The {special} argument of shellescape() may optionally be passed.
|
||||||
|
function! zig#util#Shelllist(arglist, ...) abort
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
if a:0
|
||||||
|
return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')')
|
||||||
|
endif
|
||||||
|
return map(copy(a:arglist), 'shellescape(v:val)')
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Returns the byte offset for line and column
|
||||||
|
function! zig#util#Offset(line, col) abort
|
||||||
|
if &encoding != 'utf-8'
|
||||||
|
let sep = zig#util#LineEnding()
|
||||||
|
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
|
||||||
|
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
|
||||||
|
return len(iconv(buf, &encoding, 'utf-8'))
|
||||||
|
endif
|
||||||
|
return line2byte(a:line) + (a:col-2)
|
||||||
|
endfunction
|
||||||
|
"
|
||||||
|
" Returns the byte offset for the cursor
|
||||||
|
function! zig#util#OffsetCursor() abort
|
||||||
|
return zig#util#Offset(line('.'), col('.'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Windo is like the built-in :windo, only it returns to the window the command
|
||||||
|
" was issued from
|
||||||
|
function! zig#util#Windo(command) abort
|
||||||
|
let s:currentWindow = winnr()
|
||||||
|
try
|
||||||
|
execute "windo " . a:command
|
||||||
|
finally
|
||||||
|
execute s:currentWindow. "wincmd w"
|
||||||
|
unlet s:currentWindow
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" snippetcase converts the given word to given preferred snippet setting type
|
||||||
|
" case.
|
||||||
|
function! zig#util#snippetcase(word) abort
|
||||||
|
let l:snippet_case = zig#config#AddtagsTransform()
|
||||||
|
if l:snippet_case == "snakecase"
|
||||||
|
return zig#util#snakecase(a:word)
|
||||||
|
elseif l:snippet_case == "camelcase"
|
||||||
|
return zig#util#camelcase(a:word)
|
||||||
|
else
|
||||||
|
return a:word " do nothing
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" snakecase converts a string to snake case. i.e: FooBar -> foo_bar
|
||||||
|
" Copied from tpope/vim-abolish
|
||||||
|
function! zig#util#snakecase(word) abort
|
||||||
|
let word = substitute(a:word, '::', '/', '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
|
||||||
|
|
||||||
|
" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become
|
||||||
|
" fooBar.
|
||||||
|
" Copied from tpope/vim-abolish.
|
||||||
|
function! zig#util#camelcase(word) abort
|
||||||
|
let word = substitute(a:word, '-', '_', 'g')
|
||||||
|
if word !~# '_' && word =~# '\l'
|
||||||
|
return substitute(word, '^.', '\l&', '')
|
||||||
|
else
|
||||||
|
return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will
|
||||||
|
" become FooBar.
|
||||||
|
function! zig#util#pascalcase(word) abort
|
||||||
|
let word = zig#util#camelcase(a:word)
|
||||||
|
return toupper(word[0]) . word[1:]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Echo a message to the screen and highlight it with the group in a:hi.
|
||||||
|
"
|
||||||
|
" The message can be a list or string; every line with be :echomsg'd separately.
|
||||||
|
function! s:echo(msg, hi)
|
||||||
|
let l:msg = []
|
||||||
|
if type(a:msg) != type([])
|
||||||
|
let l:msg = split(a:msg, "\n")
|
||||||
|
else
|
||||||
|
let l:msg = a:msg
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Tabs display as ^I or <09>, so manually expand them.
|
||||||
|
let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")')
|
||||||
|
|
||||||
|
exe 'echohl ' . a:hi
|
||||||
|
for line in l:msg
|
||||||
|
echom "zig.vim: " . line
|
||||||
|
endfor
|
||||||
|
echohl None
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#util#EchoSuccess(msg)
|
||||||
|
call s:echo(a:msg, 'Function')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoError(msg)
|
||||||
|
call s:echo(a:msg, 'ErrorMsg')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoWarning(msg)
|
||||||
|
call s:echo(a:msg, 'WarningMsg')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoProgress(msg)
|
||||||
|
redraw
|
||||||
|
call s:echo(a:msg, 'Identifier')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoInfo(msg)
|
||||||
|
call s:echo(a:msg, 'Debug')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get all lines in the buffer as a a list.
|
||||||
|
function! zig#util#GetLines()
|
||||||
|
let buf = getline(1, '$')
|
||||||
|
if &encoding != 'utf-8'
|
||||||
|
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
|
||||||
|
endif
|
||||||
|
if &l:fileformat == 'dos'
|
||||||
|
" XXX: line2byte() depend on 'fileformat' option.
|
||||||
|
" so if fileformat is 'dos', 'buf' must include '\r'.
|
||||||
|
let buf = map(buf, 'v:val."\r"')
|
||||||
|
endif
|
||||||
|
return buf
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Make a named temporary directory which starts with "prefix".
|
||||||
|
"
|
||||||
|
" Unfortunately Vim's tempname() is not portable enough across various systems;
|
||||||
|
" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911
|
||||||
|
function! zig#util#tempdir(prefix) abort
|
||||||
|
" See :help tempfile
|
||||||
|
if zig#util#IsWin()
|
||||||
|
let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp']
|
||||||
|
else
|
||||||
|
let l:dirs = [$TMPDIR, '/tmp', './', $HOME]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:dir = ''
|
||||||
|
for l:d in dirs
|
||||||
|
if !empty(l:d) && filewritable(l:d) == 2
|
||||||
|
let l:dir = l:d
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
if l:dir == ''
|
||||||
|
call zig#util#EchoError('Unable to find directory to store temporary directory in')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Not great randomness, but "good enough" for our purpose here.
|
||||||
|
let l:rnd = sha256(printf('%s%s', localtime(), fnamemodify(bufname(''), ":p")))
|
||||||
|
let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd)
|
||||||
|
call mkdir(l:tmp, 'p', 0700)
|
||||||
|
return l:tmp
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Report if the user enabled a debug flag in g:zig_debug.
|
||||||
|
function! zig#util#HasDebug(flag)
|
||||||
|
return index(zig#config#Debug(), a:flag) >= 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
26
build
26
build
@@ -25,8 +25,10 @@ download() {
|
|||||||
for pack in $1; do
|
for pack in $1; do
|
||||||
path="$(cut -d ':' -f 2 <<<"$pack")"
|
path="$(cut -d ':' -f 2 <<<"$pack")"
|
||||||
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
||||||
|
repo="$(awk -F\# '{print $1}' <<<"$path")"
|
||||||
|
branch="$(awk -F\# '{print $2}' <<<"$path")"
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
(mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$path/tar.gz/master" | tar -zx -C "$dir" --strip 1 && printf '.') &
|
(mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$repo/tar.gz/${branch:-master}" | tar -zx -C "$dir" --strip 1 && printf '.') &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
@@ -176,6 +178,7 @@ PACKS="
|
|||||||
cucumber:tpope/vim-cucumber
|
cucumber:tpope/vim-cucumber
|
||||||
cue:mgrabovsky/vim-cuesheet
|
cue:mgrabovsky/vim-cuesheet
|
||||||
dart:dart-lang/dart-vim-plugin
|
dart:dart-lang/dart-vim-plugin
|
||||||
|
dlang:JesseKPhillips/d.vim
|
||||||
dockerfile:ekalinin/Dockerfile.vim
|
dockerfile:ekalinin/Dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
elm:ElmCast/elm-vim
|
elm:ElmCast/elm-vim
|
||||||
@@ -192,7 +195,6 @@ PACKS="
|
|||||||
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
||||||
go:fatih/vim-go:_BASIC
|
go:fatih/vim-go:_BASIC
|
||||||
gradle:tfnico/vim-gradle
|
gradle:tfnico/vim-gradle
|
||||||
graphql:jparise/vim-graphql
|
|
||||||
groovy:vim-scripts/groovy.vim
|
groovy:vim-scripts/groovy.vim
|
||||||
groovy-indent:vim-scripts/groovyindent-unix
|
groovy-indent:vim-scripts/groovyindent-unix
|
||||||
haml:sheerun/vim-haml
|
haml:sheerun/vim-haml
|
||||||
@@ -200,9 +202,12 @@ PACKS="
|
|||||||
haproxy:CH-DanReif/haproxy.vim
|
haproxy:CH-DanReif/haproxy.vim
|
||||||
haskell:neovimhaskell/haskell-vim
|
haskell:neovimhaskell/haskell-vim
|
||||||
haxe:yaymukund/vim-haxe
|
haxe:yaymukund/vim-haxe
|
||||||
|
hcl:b4b4r07/vim-hcl
|
||||||
|
hive:zebradil/hive.vim
|
||||||
html5:othree/html5.vim
|
html5:othree/html5.vim
|
||||||
i3:mboughaba/i3config.vim
|
i3:mboughaba/i3config.vim
|
||||||
idris:idris-hackers/idris-vim
|
idris:idris-hackers/idris-vim
|
||||||
|
ion:vmchale/ion-vim
|
||||||
jasmine:glanotte/vim-jasmine
|
jasmine:glanotte/vim-jasmine
|
||||||
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
||||||
jenkins:martinda/Jenkinsfile-vim-syntax
|
jenkins:martinda/Jenkinsfile-vim-syntax
|
||||||
@@ -210,19 +215,19 @@ PACKS="
|
|||||||
json5:GutenYe/json5.vim
|
json5:GutenYe/json5.vim
|
||||||
json:elzr/vim-json
|
json:elzr/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
jsx:amadeus/vim-jsx
|
jsx:MaxMEllon/vim-jsx-pretty
|
||||||
julia:JuliaEditorSupport/julia-vim
|
julia:JuliaEditorSupport/julia-vim
|
||||||
kotlin:udalov/kotlin-vim
|
kotlin:udalov/kotlin-vim
|
||||||
latex:LaTeX-Box-Team/LaTeX-Box
|
latex:LaTeX-Box-Team/LaTeX-Box
|
||||||
less:groenewege/vim-less:_NOAFTER
|
less:groenewege/vim-less:_NOAFTER
|
||||||
liquid:tpope/vim-liquid
|
|
||||||
lilypond:anowlcalledjosh/vim-lilypond
|
lilypond:anowlcalledjosh/vim-lilypond
|
||||||
livescript:gkz/vim-ls
|
livescript:gkz/vim-ls
|
||||||
llvm:rhysd/vim-llvm
|
llvm:rhysd/vim-llvm
|
||||||
|
log:MTDL9/vim-log-highlighting
|
||||||
lua:tbastos/vim-lua
|
lua:tbastos/vim-lua
|
||||||
mako:sophacles/vim-bundle-mako
|
mako:sophacles/vim-bundle-mako
|
||||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||||
mathematica:rsmenon/vim-mathematica
|
mathematica:voldikss/vim-mma
|
||||||
mdx:jxnblk/vim-mdx-js
|
mdx:jxnblk/vim-mdx-js
|
||||||
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
||||||
moonscript:leafo/moonscript-vim
|
moonscript:leafo/moonscript-vim
|
||||||
@@ -234,7 +239,7 @@ PACKS="
|
|||||||
octave:vim-scripts/octave.vim--
|
octave:vim-scripts/octave.vim--
|
||||||
opencl:petRUShka/vim-opencl
|
opencl:petRUShka/vim-opencl
|
||||||
perl:vim-perl/vim-perl
|
perl:vim-perl/vim-perl
|
||||||
pgsql:exu/pgsql.vim
|
pgsql:lifepillar/pgsql.vim
|
||||||
php:StanAngeloff/php.vim
|
php:StanAngeloff/php.vim
|
||||||
plantuml:aklt/plantuml-syntax
|
plantuml:aklt/plantuml-syntax
|
||||||
pony:jakwings/vim-pony
|
pony:jakwings/vim-pony
|
||||||
@@ -253,6 +258,7 @@ PACKS="
|
|||||||
ragel:jneen/ragel.vim
|
ragel:jneen/ragel.vim
|
||||||
raml:IN3D/vim-raml
|
raml:IN3D/vim-raml
|
||||||
reason:reasonml-editor/vim-reason-plus
|
reason:reasonml-editor/vim-reason-plus
|
||||||
|
rego:tsandall/vim-rego
|
||||||
rspec:sheerun/rspec.vim
|
rspec:sheerun/rspec.vim
|
||||||
rst:marshallward/vim-restructuredtext
|
rst:marshallward/vim-restructuredtext
|
||||||
ruby:vim-ruby/vim-ruby
|
ruby:vim-ruby/vim-ruby
|
||||||
@@ -264,16 +270,20 @@ PACKS="
|
|||||||
slime:slime-lang/vim-slime-syntax
|
slime:slime-lang/vim-slime-syntax
|
||||||
smt2:bohlender/vim-smt2
|
smt2:bohlender/vim-smt2
|
||||||
solidity:tomlion/vim-solidity
|
solidity:tomlion/vim-solidity
|
||||||
|
styled-components:styled-components/vim-styled-components#main
|
||||||
stylus:wavded/vim-stylus
|
stylus:wavded/vim-stylus
|
||||||
|
svg-indent:jasonshell/vim-svg-indent
|
||||||
|
svg:vim-scripts/svg.vim
|
||||||
swift:keith/swift.vim
|
swift:keith/swift.vim
|
||||||
sxhkd:baskerville/vim-sxhkdrc
|
sxhkd:baskerville/vim-sxhkdrc
|
||||||
systemd:wgwoods/vim-systemd-syntax
|
systemd:wgwoods/vim-systemd-syntax
|
||||||
terraform:hashivim/vim-terraform
|
terraform:hashivim/vim-terraform
|
||||||
textile:timcharper/textile.vim
|
textile:timcharper/textile.vim
|
||||||
thrift:solarnz/thrift.vim
|
thrift:solarnz/thrift.vim
|
||||||
tmux:keith/tmux.vim
|
tmux:ericpruitt/tmux.vim
|
||||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
|
tptp:c-cube/vim-tptp
|
||||||
twig:lumiliet/vim-twig
|
twig:lumiliet/vim-twig
|
||||||
typescript:leafgarland/typescript-vim
|
typescript:leafgarland/typescript-vim
|
||||||
vala:arrufat/vala.vim
|
vala:arrufat/vala.vim
|
||||||
@@ -282,10 +292,12 @@ PACKS="
|
|||||||
vifm:vifm/vifm.vim
|
vifm:vifm/vifm.vim
|
||||||
vm:lepture/vim-velocity
|
vm:lepture/vim-velocity
|
||||||
vue:posva/vim-vue
|
vue:posva/vim-vue
|
||||||
|
xdc:amal-khailtash/vim-xdc-syntax
|
||||||
xml:amadeus/vim-xml
|
xml:amadeus/vim-xml
|
||||||
xls:vim-scripts/XSLT-syntax
|
xls:vim-scripts/XSLT-syntax
|
||||||
yaml:stephpy/vim-yaml
|
yaml:stephpy/vim-yaml
|
||||||
yard:sheerun/vim-yardoc
|
yard:sheerun/vim-yardoc
|
||||||
|
zig:ziglang/zig.vim
|
||||||
"
|
"
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
|
|||||||
13
config.vim
13
config.vim
@@ -1,3 +1,9 @@
|
|||||||
|
function! s:setf(filetype) abort
|
||||||
|
if &filetype !=# a:filetype
|
||||||
|
let &filetype = a:filetype
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Enable jsx syntax by default
|
" Enable jsx syntax by default
|
||||||
if !exists('g:jsx_ext_required')
|
if !exists('g:jsx_ext_required')
|
||||||
let g:jsx_ext_required = 0
|
let g:jsx_ext_required = 0
|
||||||
@@ -79,12 +85,13 @@ augroup filetypedetect
|
|||||||
|
|
||||||
"jinja
|
"jinja
|
||||||
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.nunjucks,*.nunjs,*.njk set ft=jinja
|
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.nunjucks,*.nunjs,*.njk set ft=jinja
|
||||||
|
|
||||||
"tsx
|
|
||||||
autocmd BufNewFile,BufRead *.tsx setfiletype typescript.jsx
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Fix for https://github.com/sheerun/vim-polyglot/issues/236#issuecomment-387984954
|
" Fix for https://github.com/sheerun/vim-polyglot/issues/236#issuecomment-387984954
|
||||||
if (!exists('g:graphql_javascript_tags'))
|
if (!exists('g:graphql_javascript_tags'))
|
||||||
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
augroup filetypedetect
|
||||||
|
autocmd BufNewFile,BufReadPost *.tsx setlocal filetype=typescript.tsx
|
||||||
|
augroup END
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|cla
|
|||||||
" tags containing type and param
|
" tags containing type and param
|
||||||
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\|typedef\)\>" skipwhite nextgroup=jsDocType
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\|typedef\)\>" skipwhite nextgroup=jsDocType
|
||||||
" tags containing type but no param
|
" tags containing type but no param
|
||||||
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|return\|returns\|yields\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
" tags containing references
|
" tags containing references
|
||||||
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
" other tags (no extra syntax)
|
" other tags (no extra syntax)
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
function! s:setf(filetype) abort
|
||||||
|
if &filetype !=# a:filetype
|
||||||
|
let &filetype = a:filetype
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Enable jsx syntax by default
|
" Enable jsx syntax by default
|
||||||
if !exists('g:jsx_ext_required')
|
if !exists('g:jsx_ext_required')
|
||||||
let g:jsx_ext_required = 0
|
let g:jsx_ext_required = 0
|
||||||
@@ -79,15 +85,16 @@ augroup filetypedetect
|
|||||||
|
|
||||||
"jinja
|
"jinja
|
||||||
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.nunjucks,*.nunjs,*.njk set ft=jinja
|
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.nunjucks,*.nunjs,*.njk set ft=jinja
|
||||||
|
|
||||||
"tsx
|
|
||||||
autocmd BufNewFile,BufRead *.tsx setfiletype typescript.jsx
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Fix for https://github.com/sheerun/vim-polyglot/issues/236#issuecomment-387984954
|
" Fix for https://github.com/sheerun/vim-polyglot/issues/236#issuecomment-387984954
|
||||||
if (!exists('g:graphql_javascript_tags'))
|
if (!exists('g:graphql_javascript_tags'))
|
||||||
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
augroup filetypedetect
|
||||||
|
autocmd BufNewFile,BufReadPost *.tsx setlocal filetype=typescript.tsx
|
||||||
|
augroup END
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'acpiasl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'acpiasl') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" acpiasl, from asl.vim in martinlroth/vim-acpi-asl
|
" acpiasl, from asl.vim in martinlroth/vim-acpi-asl
|
||||||
@@ -287,12 +294,48 @@ autocmd BufRead,BufNewFile *.dart set filetype=dart
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dlang') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" dlang, from d.vim in JesseKPhillips/d.vim
|
||||||
|
autocmd BufNewFile,BufRead *.d setf d
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dlang') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" dlang, from dcov.vim in JesseKPhillips/d.vim
|
||||||
|
autocmd BufNewFile,BufRead *.lst set filetype=dcov
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dlang') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" dlang, from dd.vim in JesseKPhillips/d.vim
|
||||||
|
au BufRead,BufNewFile *.dd set filetype=dd
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dlang') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" dlang, from ddoc.vim in JesseKPhillips/d.vim
|
||||||
|
au BufRead,BufNewFile *.ddoc set filetype=ddoc
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dlang') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" dlang, from dsdl.vim in JesseKPhillips/d.vim
|
||||||
|
autocmd BufNewFile,BufRead *.sdl set filetype=dsdl
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" dockerfile, from Dockerfile.vim in ekalinin/Dockerfile.vim
|
" dockerfile, from Dockerfile.vim in ekalinin/Dockerfile.vim
|
||||||
" Dockerfile
|
" Dockerfile
|
||||||
autocmd BufRead,BufNewFile Dockerfile set ft=Dockerfile
|
autocmd BufRead,BufNewFile [Dd]ockerfile set ft=Dockerfile
|
||||||
autocmd BufRead,BufNewFile Dockerfile* set ft=Dockerfile
|
autocmd BufRead,BufNewFile Dockerfile* set ft=Dockerfile
|
||||||
|
autocmd BufRead,BufNewFile [Dd]ockerfile.vim set ft=vim
|
||||||
autocmd BufRead,BufNewFile *.dock set ft=Dockerfile
|
autocmd BufRead,BufNewFile *.dock set ft=Dockerfile
|
||||||
autocmd BufRead,BufNewFile *.[Dd]ockerfile set ft=Dockerfile
|
autocmd BufRead,BufNewFile *.[Dd]ockerfile set ft=Dockerfile
|
||||||
augroup end
|
augroup end
|
||||||
@@ -462,14 +505,6 @@ au BufNewFile,BufRead *.gradle set filetype=groovy
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
|
||||||
augroup filetypedetect
|
|
||||||
" graphql, from graphql.vim in jparise/vim-graphql
|
|
||||||
" vint: -ProhibitAutocmdWithNoGroup
|
|
||||||
au BufRead,BufNewFile *.graphql,*.graphqls,*.gql setfiletype graphql
|
|
||||||
augroup end
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" haml, from haml.vim in sheerun/vim-haml
|
" haml, from haml.vim in sheerun/vim-haml
|
||||||
@@ -511,6 +546,25 @@ autocmd BufNewFile,BufRead *.hx setf haxe
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'hcl') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" hcl, from hcl.vim in b4b4r07/vim-hcl
|
||||||
|
autocmd BufNewFile,BufRead *.hcl set filetype=hcl
|
||||||
|
autocmd BufNewFile,BufRead *.nomad set filetype=hcl
|
||||||
|
autocmd BufNewFile,BufRead *.tf set filetype=hcl
|
||||||
|
autocmd BufNewFile,BufRead Appfile set filetype=hcl
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'hive') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" hive, from hive.vim in zebradil/hive.vim
|
||||||
|
autocmd BufNewFile,BufRead *.hql set filetype=hive
|
||||||
|
autocmd BufNewFile,BufRead *.ql set filetype=hive
|
||||||
|
autocmd BufNewFile,BufRead *.q set filetype=hive
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" i3, from i3config.vim in mboughaba/i3config.vim
|
" i3, from i3config.vim in mboughaba/i3config.vim
|
||||||
@@ -536,6 +590,19 @@ au BufNewFile,BufRead *.lidr setf lidris
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ion') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" ion, from ion.vim in vmchale/ion-vim
|
||||||
|
autocmd BufNewFile,BufRead ~/.config/ion/initrc set filetype=ion
|
||||||
|
autocmd BufNewFile,BufRead *.ion set filetype=ion
|
||||||
|
|
||||||
|
autocmd BufNewFile,BufRead,StdinReadPost *
|
||||||
|
\ if getline(1) =~ '^#!.*\Wion\s*$' |
|
||||||
|
\ set ft=ion |
|
||||||
|
\ endif
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" jasmine, from jasmine.vim in glanotte/vim-jasmine
|
" jasmine, from jasmine.vim in glanotte/vim-jasmine
|
||||||
@@ -601,59 +668,6 @@ au BufNewFile,BufRead *.ect set filetype=jst
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
|
||||||
augroup filetypedetect
|
|
||||||
" jsx, from javascript.vim in amadeus/vim-jsx
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim ftdetect file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
|
||||||
|
|
||||||
" if g:jsx_check_react_import == 1
|
|
||||||
" parse the first line of js file (skipping comments). When it has a 'react'
|
|
||||||
" importation, we guess the user writes jsx
|
|
||||||
" endif
|
|
||||||
let s:jsx_prevalent_pattern =
|
|
||||||
\ '\v\C%^\_s*%(%(//.*\_$|/\*\_.{-}\*/)@>\_s*)*%(import\s+\k+\s+from\s+|%(\l+\s+)=\k+\s*\=\s*require\s*\(\s*)[`"'']react>'
|
|
||||||
|
|
||||||
" Whether to set the JSX filetype on *.js files.
|
|
||||||
fu! <SID>EnableJSX()
|
|
||||||
" Whether the .jsx extension is required.
|
|
||||||
if !exists('g:jsx_ext_required')
|
|
||||||
let g:jsx_ext_required = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Whether the @jsx pragma is required.
|
|
||||||
if !exists('g:jsx_pragma_required')
|
|
||||||
let g:jsx_pragma_required = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:jsx_pragma_required && !exists('b:jsx_ext_found')
|
|
||||||
" Look for the @jsx pragma. It must be included in a docblock comment
|
|
||||||
" before anything else in the file (except whitespace).
|
|
||||||
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
|
|
||||||
if g:jsx_ext_required && !exists('b:jsx_ext_found') &&
|
|
||||||
\ !(get(g:,'jsx_check_react_import') && search(s:jsx_prevalent_pattern, 'nw'))
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
return 1
|
|
||||||
endfu
|
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
|
||||||
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
|
||||||
autocmd BufNewFile,BufRead *.js
|
|
||||||
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
|
||||||
augroup end
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" kotlin, from kotlin.vim in udalov/kotlin-vim
|
" kotlin, from kotlin.vim in udalov/kotlin-vim
|
||||||
@@ -669,28 +683,6 @@ autocmd BufNewFile,BufRead *.less setf less
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
|
|
||||||
augroup filetypedetect
|
|
||||||
" liquid, from liquid.vim in tpope/vim-liquid
|
|
||||||
" Liquid
|
|
||||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
|
||||||
|
|
||||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
|
||||||
au BufNewFile,BufRead *.html,*.xml,*.textile
|
|
||||||
\ if getline(1) == '---' | set ft=liquid | endif
|
|
||||||
au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
|
|
||||||
\ if getline(1) == '---' |
|
|
||||||
\ let b:liquid_subtype = 'markdown' |
|
|
||||||
\ set ft=liquid |
|
|
||||||
\ endif
|
|
||||||
|
|
||||||
" Set subtype for Shopify alternate templates
|
|
||||||
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
|
|
||||||
\ let b:liquid_subtype = 'html' |
|
|
||||||
\ set ft=liquid |
|
|
||||||
augroup end
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'lilypond') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'lilypond') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" lilypond, from lilypond.vim in anowlcalledjosh/vim-lilypond
|
" lilypond, from lilypond.vim in anowlcalledjosh/vim-lilypond
|
||||||
@@ -735,6 +727,15 @@ au BufRead,BufNewFile *.td set filetype=tablegen
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'log') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" log, from log.vim in MTDL9/vim-log-highlighting
|
||||||
|
|
||||||
|
au BufNewFile,BufRead *.log set filetype=log
|
||||||
|
au BufNewFile,BufRead *_log set filetype=log
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" mako, from mako.vim in sophacles/vim-bundle-mako
|
" mako, from mako.vim in sophacles/vim-bundle-mako
|
||||||
@@ -766,6 +767,14 @@ au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,i
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" mathematica, from mma.vim in voldikss/vim-mma
|
||||||
|
autocmd BufNewFile,BufRead *.wl set filetype=mma
|
||||||
|
autocmd BufNewFile,BufRead *.wls set filetype=mma
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mdx') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mdx') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" mdx, from mdx.vim in jxnblk/vim-mdx-js
|
" mdx, from mdx.vim in jxnblk/vim-mdx-js
|
||||||
@@ -841,8 +850,8 @@ endif
|
|||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ocaml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ocaml') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" ocaml, from jbuild.vim in rgrinberg/vim-ocaml
|
" ocaml, from dune.vim in rgrinberg/vim-ocaml
|
||||||
au BufRead,BufNewFile jbuild,dune,dune-project set ft=jbuild
|
au BufRead,BufNewFile jbuild,dune,dune-project set ft=dune
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -948,9 +957,8 @@ endif
|
|||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" pgsql, from pgsql.vim in exu/pgsql.vim
|
" pgsql, from pgsql.vim in lifepillar/pgsql.vim
|
||||||
" postgreSQL
|
au BufNewFile,BufRead *.pgsql let b:sql_type_override='pgsql' | setfiletype sql
|
||||||
au BufNewFile,BufRead *.pgsql setf pgsql
|
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1077,7 +1085,7 @@ endif
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" racket, from racket.vim in wlangstroth/vim-racket
|
" racket, from racket.vim in wlangstroth/vim-racket
|
||||||
au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket
|
au BufRead,BufNewFile *.rkt,*.rktl setf racket
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1099,6 +1107,17 @@ au BufNewFile,BufRead .merlin set ft=merlin
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rego') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" rego, from rego.vim in tsandall/vim-rego
|
||||||
|
autocmd BufRead,BufNewFile *.rego set filetype=rego
|
||||||
|
|
||||||
|
" Use # as a comment prefix
|
||||||
|
setlocal comments=b:#,fb:-
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" ruby, from ruby.vim in vim-ruby/vim-ruby
|
" ruby, from ruby.vim in vim-ruby/vim-ruby
|
||||||
@@ -1224,8 +1243,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|||||||
" rust, from rust.vim in rust-lang/rust.vim
|
" rust, from rust.vim in rust-lang/rust.vim
|
||||||
" vint: -ProhibitAutocmdWithNoGroup
|
" vint: -ProhibitAutocmdWithNoGroup
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.rs setf rust
|
autocmd BufRead,BufNewFile *.rs call s:set_rust_filetype()
|
||||||
autocmd BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=cfg | endif
|
autocmd BufRead,BufNewFile Cargo.toml setf FALLBACK cfg
|
||||||
|
|
||||||
|
function! s:set_rust_filetype() abort
|
||||||
|
if &filetype !=# 'rust'
|
||||||
|
set filetype=rust
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
augroup end
|
augroup end
|
||||||
@@ -1316,10 +1341,10 @@ endif
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" terraform, from terraform.vim in hashivim/vim-terraform
|
" terraform, from terraform.vim in hashivim/vim-terraform
|
||||||
au BufRead,BufNewFile *.tf setlocal filetype=terraform
|
autocmd BufRead,BufNewFile *.tf set filetype=terraform
|
||||||
au BufRead,BufNewFile *.tfvars setlocal filetype=terraform
|
autocmd BufRead,BufNewFile *.tfvars set filetype=terraform
|
||||||
au BufRead,BufNewFile *.tfstate setlocal filetype=json
|
autocmd BufRead,BufNewFile *.tfstate set filetype=json
|
||||||
au BufRead,BufNewFile *.tfstate.backup setlocal filetype=json
|
autocmd BufRead,BufNewFile *.tfstate.backup set filetype=json
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1344,13 +1369,6 @@ au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
|
||||||
augroup filetypedetect
|
|
||||||
" tmux, from tmux.vim in keith/tmux.vim
|
|
||||||
autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
|
|
||||||
augroup end
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" toml, from toml.vim in cespare/vim-toml
|
" toml, from toml.vim in cespare/vim-toml
|
||||||
@@ -1359,6 +1377,19 @@ autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,*/.cargo
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tptp') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" tptp, from tptp.vim in c-cube/vim-tptp
|
||||||
|
|
||||||
|
au BufRead,BufNewFile *.p set filetype=tptp
|
||||||
|
au BufRead,BufNewFile *.p set syntax=tptp
|
||||||
|
au BufRead,BufNewFile *.tptp set filetype=tptp
|
||||||
|
au BufRead,BufNewFile *.tptp set syntax=tptp
|
||||||
|
au BufRead,BufNewFile *.ax set filetype=tptp
|
||||||
|
au BufRead,BufNewFile *.ax set syntax=tptp
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" twig, from twig.vim in lumiliet/vim-twig
|
" twig, from twig.vim in lumiliet/vim-twig
|
||||||
@@ -1425,3 +1456,18 @@ au BufNewFile,BufRead *.vue,*.wpy setf vue
|
|||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'xdc') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" xdc, from xdc.vim in amal-khailtash/vim-xdc-syntax
|
||||||
|
" xdc
|
||||||
|
autocmd BufNewFile,BufRead *.xdc setfiletype xdc
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
augroup filetypedetect
|
||||||
|
" zig, from zig.vim in ziglang/zig.vim
|
||||||
|
au BufRead,BufNewFile *.zig set filetype=zig
|
||||||
|
augroup end
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ if !exists("b:eelixir_subtype")
|
|||||||
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
||||||
endif
|
endif
|
||||||
if b:eelixir_subtype == ''
|
if b:eelixir_subtype == ''
|
||||||
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
let b:eelixir_subtype = matchstr(&filetype,'^leex\.\zs\w\+')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.leex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
||||||
endif
|
endif
|
||||||
if b:eelixir_subtype == 'ex'
|
if b:eelixir_subtype == 'ex'
|
||||||
let b:eelixir_subtype = 'elixir'
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ let &l:path =
|
|||||||
\ &g:path
|
\ &g:path
|
||||||
\ ], ',')
|
\ ], ',')
|
||||||
setlocal includeexpr=elixir#util#get_filename(v:fname)
|
setlocal includeexpr=elixir#util#get_filename(v:fname)
|
||||||
setlocal suffixesadd=.ex,.exs,.eex,.erl,.xrl,.yrl,.hrl
|
setlocal suffixesadd=.ex,.exs,.eex,.leex,.erl,.xrl,.yrl,.hrl
|
||||||
|
|
||||||
let &l:define = 'def\(macro\|guard\|delegate\)\=p\='
|
let &l:define = 'def\(macro\|guard\|delegate\)\=p\='
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ let b:did_ftplugin = 1
|
|||||||
|
|
||||||
setlocal comments=:# commentstring=#\ %s
|
setlocal comments=:# commentstring=#\ %s
|
||||||
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||||
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q
|
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
||||||
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms<'
|
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
|
||||||
|
|
||||||
|
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw< com< cms< formatlistpat<'
|
||||||
|
|
||||||
if exists("g:no_gitcommit_commands") || v:version < 700
|
if exists("g:no_gitcommit_commands") || v:version < 700
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 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+=$,@-@
|
|
||||||
setlocal softtabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal expandtab
|
|
||||||
|
|
||||||
let b:undo_ftplugin = 'setlocal com< cms< fo< isk< sts< sw< et<'
|
|
||||||
41
ftplugin/hcl.vim
Normal file
41
ftplugin/hcl.vim
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'hcl') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" File: ftplugin/hcl.vim
|
||||||
|
" Author: BABAROT <b4b4r07@gmail.com>
|
||||||
|
" Description: FileType Plugin for HCL
|
||||||
|
" Last Change: Nob 05, 2015
|
||||||
|
|
||||||
|
if exists('b:did_ftplugin')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
|
" Add NERDCommenter delimiters
|
||||||
|
|
||||||
|
let s:delims = { 'left': '#' }
|
||||||
|
if exists('g:NERDDelimiterMap')
|
||||||
|
if !has_key(g:NERDDelimiterMap, 'hcl')
|
||||||
|
let g:NERDDelimiterMap.hcl = s:delims
|
||||||
|
endif
|
||||||
|
elseif exists('g:NERDCustomDelimiters')
|
||||||
|
if !has_key(g:NERDCustomDelimiters, 'hcl')
|
||||||
|
let g:NERDCustomDelimiters.hcl = s:delims
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let g:NERDCustomDelimiters = { 'hcl': s:delims }
|
||||||
|
endif
|
||||||
|
unlet s:delims
|
||||||
|
|
||||||
|
let b:undo_ftplugin = ""
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim: set et sw=4 ts=4:
|
||||||
6
ftplugin/hive.vim
Normal file
6
ftplugin/hive.vim
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'hive') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal comments=:--
|
||||||
|
setlocal commentstring=--\ %s
|
||||||
9
ftplugin/ion.vim
Normal file
9
ftplugin/ion.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'ion') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal commentstring=#%s
|
||||||
@@ -2,7 +2,7 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'kotlin') != -1
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists("b:did_ftplugin") | finish | endif
|
if exists('b:did_ftplugin') | finish | endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal comments=://
|
setlocal comments=://
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'liquid') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim filetype plugin
|
|
||||||
" Language: Liquid
|
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
|
||||||
" Last Change: 2010 May 21
|
|
||||||
|
|
||||||
if exists('b:did_ftplugin')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:liquid_default_subtype')
|
|
||||||
let g:liquid_default_subtype = 'html'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('b:liquid_subtype')
|
|
||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
|
||||||
let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+')
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+')
|
|
||||||
endif
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$')
|
|
||||||
endif
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = g:liquid_default_subtype
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('b:liquid_subtype') && b:liquid_subtype != ''
|
|
||||||
exe 'runtime! ftplugin/'.b:liquid_subtype.'.vim ftplugin/'.b:liquid_subtype.'_*.vim ftplugin/'.b:liquid_subtype.'/*.vim'
|
|
||||||
else
|
|
||||||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
|
||||||
endif
|
|
||||||
let b:did_ftplugin = 1
|
|
||||||
|
|
||||||
if exists('b:undo_ftplugin')
|
|
||||||
let b:undo_ftplugin .= '|'
|
|
||||||
else
|
|
||||||
let b:undo_ftplugin = ''
|
|
||||||
endif
|
|
||||||
if exists('b:browsefilter')
|
|
||||||
let b:browsefilter = "\n".b:browsefilter
|
|
||||||
else
|
|
||||||
let b:browsefilter = ''
|
|
||||||
endif
|
|
||||||
if exists('b:match_words')
|
|
||||||
let b:match_words .= ','
|
|
||||||
elseif exists('loaded_matchit')
|
|
||||||
let b:match_words = ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has('gui_win32')
|
|
||||||
let b:browsefilter="Liquid Files (*.liquid)\t*.liquid" . b:browsefilter
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('loaded_matchit')
|
|
||||||
let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,<\(capture\|comment\|highlight\)\>:\<end\1\>'
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %}
|
|
||||||
|
|
||||||
let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words'
|
|
||||||
@@ -12,11 +12,14 @@ if (exists("b:did_ftplugin"))
|
|||||||
endif
|
endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
\ comments=:#
|
\ comments=:#
|
||||||
\ commentstring=#\ %s
|
\ commentstring=#\ %s
|
||||||
|
\ iskeyword+=-
|
||||||
|
|
||||||
|
if get(g:, 'nix_recommended_style', 1)
|
||||||
|
setlocal
|
||||||
\ shiftwidth=2
|
\ shiftwidth=2
|
||||||
\ softtabstop=2
|
\ softtabstop=2
|
||||||
\ expandtab
|
\ expandtab
|
||||||
\ iskeyword+=-
|
endif
|
||||||
|
|||||||
@@ -2,12 +2,18 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'plantuml') != -1
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
scriptencoding utf-8
|
||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: PlantUML
|
||||||
|
" Maintainer: Anders Thøgersen <first name at bladre dot dk>
|
||||||
|
" License: VIM LICENSE
|
||||||
|
|
||||||
if exists('b:loaded_plantuml_plugin')
|
if exists('b:loaded_plantuml_plugin')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:loaded_plantuml_plugin = 1
|
let b:loaded_plantuml_plugin = 1
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpoptions
|
||||||
set cpo&vim
|
set cpoptions&vim
|
||||||
|
|
||||||
if !exists('g:plantuml_executable_script')
|
if !exists('g:plantuml_executable_script')
|
||||||
let g:plantuml_executable_script='plantuml'
|
let g:plantuml_executable_script='plantuml'
|
||||||
@@ -21,10 +27,13 @@ if exists('loaded_matchit')
|
|||||||
\ ',\<rnote\>:\<endrnote\>' .
|
\ ',\<rnote\>:\<endrnote\>' .
|
||||||
\ ',\<hnote\>:\<endhnote\>' .
|
\ ',\<hnote\>:\<endhnote\>' .
|
||||||
\ ',\<title\>:\<endtitle\>' .
|
\ ',\<title\>:\<endtitle\>' .
|
||||||
\ ',\<\while\>:\<endwhile\>'
|
\ ',\<\while\>:\<endwhile\>' .
|
||||||
|
\ ',@startuml:@enduml'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &l:makeprg=g:plantuml_executable_script . ' ' . fnameescape(expand('%'))
|
if get(g:, 'plantuml_set_makeprg', 1)
|
||||||
|
let &l:makeprg=g:plantuml_executable_script . ' %'
|
||||||
|
endif
|
||||||
|
|
||||||
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
|
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
|
||||||
|
|
||||||
@@ -33,5 +42,5 @@ let b:endwise_words = 'loop,group,alt,note,legend'
|
|||||||
let b:endwise_pattern = '^\s*\zs\<\(loop\|group\|alt\|note\ze[^:]*$\|legend\)\>.*$'
|
let b:endwise_pattern = '^\s*\zs\<\(loop\|group\|alt\|note\ze[^:]*$\|legend\)\>.*$'
|
||||||
let b:endwise_syngroups = 'plantumlKeyword'
|
let b:endwise_syngroups = 'plantumlKeyword'
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpoptions = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
|||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
|
|
||||||
let b:match_words =
|
let b:match_words =
|
||||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|=\@<!begin\)\>=\@!' .
|
\ '{\|\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|=\@<!begin\)\>=\@!' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\%(^\|[^.\:@$=]\)\@<=\<end\:\@!\>' .
|
\ '}\|\%(^\|[^.\:@$=]\)\@<=\<end\:\@!\>' .
|
||||||
\ ',^=begin\>:^=end\>,' .
|
\ ',^=begin\>:^=end\>,' .
|
||||||
\ ',{:},\[:\],(:)'
|
\ ',\[:\],(:)'
|
||||||
|
|
||||||
let b:match_skip =
|
let b:match_skip =
|
||||||
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
||||||
|
|||||||
@@ -5,71 +5,154 @@ endif
|
|||||||
" terraform.vim - basic vim/terraform integration
|
" terraform.vim - basic vim/terraform integration
|
||||||
" Maintainer: HashiVim <https://github.com/hashivim>
|
" Maintainer: HashiVim <https://github.com/hashivim>
|
||||||
|
|
||||||
set formatoptions-=t
|
if exists('b:did_ftplugin') || v:version < 700 || &compatible
|
||||||
|
|
||||||
if exists("g:loaded_terraform") || v:version < 700 || &cp || !executable('terraform')
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_terraform = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
if !exists("g:terraform_fmt_on_save")
|
let s:cpo_save = &cpoptions
|
||||||
|
|
||||||
|
setlocal formatoptions-=t
|
||||||
|
let b:undo_ftplugin = 'setlocal formatoptions<'
|
||||||
|
|
||||||
|
" Include hyphens as keyword characters so that a keyword appearing as part of
|
||||||
|
" a longer name doesn't get partially highlighted.
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
let b:undo_ftplugin .= ' iskeyword<'
|
||||||
|
|
||||||
|
set cpoptions&vim
|
||||||
|
|
||||||
|
if !exists('g:terraform_align')
|
||||||
|
let g:terraform_align = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:terraform_remap_spacebar')
|
||||||
|
let g:terraform_remap_spacebar = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:terraform_fold_sections')
|
||||||
|
let g:terraform_fold_sections = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:terraform_align && exists(':Tabularize')
|
||||||
|
inoremap <buffer> <silent> = =<Esc>:call <SID>terraformalign()<CR>a
|
||||||
|
function! s:terraformalign()
|
||||||
|
let p = '^.*=[^>]*$'
|
||||||
|
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
||||||
|
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
|
||||||
|
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
|
||||||
|
Tabularize/=/l1
|
||||||
|
normal! 0
|
||||||
|
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:terraform_fold_sections
|
||||||
|
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'
|
||||||
|
elseif match(thisline, '^data') >= 0
|
||||||
|
return '>1'
|
||||||
|
elseif match(thisline, '^terraform') >= 0
|
||||||
|
return '>1'
|
||||||
|
elseif match(thisline, '^locals') >= 0
|
||||||
|
return '>1'
|
||||||
|
else
|
||||||
|
return '='
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
setlocal foldmethod=expr
|
||||||
|
setlocal foldexpr=TerraformFolds()
|
||||||
|
setlocal foldlevel=1
|
||||||
|
let b:undo_ftplugin .= ' foldmethod< foldexpr< foldlevel<'
|
||||||
|
|
||||||
|
function! TerraformFoldText()
|
||||||
|
let foldsize = (v:foldend-v:foldstart)
|
||||||
|
return getline(v:foldstart).' ('.foldsize.' lines)'
|
||||||
|
endfunction
|
||||||
|
setlocal foldtext=TerraformFoldText()
|
||||||
|
let b:undo_ftplugin .= ' foldtext<'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Re-map the space bar to fold and unfold
|
||||||
|
if get(g:, 'terraform_remap_spacebar', 1)
|
||||||
|
"inoremap <space> <C-O>za
|
||||||
|
nnoremap <space> za
|
||||||
|
onoremap <space> <C-C>za
|
||||||
|
vnoremap <space> zf
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Set the commentstring
|
||||||
|
if exists('g:terraform_commentstring')
|
||||||
|
let &l:commentstring=g:terraform_commentstring
|
||||||
|
else
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
endif
|
||||||
|
let b:undo_ftplugin .= ' commentstring<'
|
||||||
|
|
||||||
|
if !exists('g:terraform_fmt_on_save')
|
||||||
let g:terraform_fmt_on_save = 0
|
let g:terraform_fmt_on_save = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:commands(A, L, P)
|
function! s:commands(A, L, P)
|
||||||
return join([
|
return [
|
||||||
\ "apply",
|
\ 'apply',
|
||||||
\ "console",
|
\ 'console',
|
||||||
\ "destroy",
|
\ 'destroy',
|
||||||
\ "env",
|
\ 'env',
|
||||||
\ "fmt",
|
\ 'fmt',
|
||||||
\ "get",
|
\ 'get',
|
||||||
\ "graph",
|
\ 'graph',
|
||||||
\ "import",
|
\ 'import',
|
||||||
\ "init",
|
\ 'init',
|
||||||
\ "output",
|
\ 'output',
|
||||||
\ "plan",
|
\ 'plan',
|
||||||
\ "providers",
|
\ 'providers',
|
||||||
\ "push",
|
\ 'push',
|
||||||
\ "refresh",
|
\ 'refresh',
|
||||||
\ "show",
|
\ 'show',
|
||||||
\ "taint",
|
\ 'taint',
|
||||||
\ "untaint",
|
\ 'untaint',
|
||||||
\ "validate",
|
\ 'validate',
|
||||||
\ "version",
|
\ 'version',
|
||||||
\ "workspace",
|
\ 'workspace',
|
||||||
\ "debug",
|
\ '0.12checklist',
|
||||||
\ "force-unlock",
|
\ 'debug',
|
||||||
\ "state"
|
\ 'force-unlock',
|
||||||
\ ], "\n")
|
\ 'state'
|
||||||
|
\ ]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Adapted from vim-hclfmt:
|
let &cpoptions = s:cpo_save
|
||||||
" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim
|
unlet s:cpo_save
|
||||||
function! terraform#fmt()
|
|
||||||
let l:curw = winsaveview()
|
|
||||||
let l:tmpfile = tempname() . ".tf"
|
|
||||||
call writefile(getline(1, "$"), l:tmpfile)
|
|
||||||
let output = system("terraform fmt -write " . l:tmpfile)
|
|
||||||
if v:shell_error == 0
|
|
||||||
try | silent undojoin | catch | endtry
|
|
||||||
call rename(l:tmpfile, resolve(expand("%")))
|
|
||||||
silent edit!
|
|
||||||
let &syntax = &syntax
|
|
||||||
else
|
|
||||||
echo output
|
|
||||||
call delete(l:tmpfile)
|
|
||||||
endif
|
|
||||||
call winrestview(l:curw)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
augroup terraform
|
if !executable('terraform')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions
|
||||||
|
|
||||||
|
command! -nargs=+ -complete=customlist,s:commands -buffer Terraform execute '!terraform '.<q-args>. ' -no-color'
|
||||||
|
command! -nargs=0 -buffer TerraformFmt call terraform#fmt()
|
||||||
|
let b:undo_ftplugin .= '|delcommand Terraform|delcommand TerraformFmt'
|
||||||
|
|
||||||
|
if get(g:, 'terraform_fmt_on_save', 1)
|
||||||
|
augroup terraform
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufEnter *
|
|
||||||
\ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.<q-args>. ' -no-color'
|
|
||||||
autocmd BufEnter * command! -nargs=0 TerraformFmt call terraform#fmt()
|
|
||||||
if get(g:, "terraform_fmt_on_save", 1)
|
|
||||||
autocmd BufWritePre *.tf call terraform#fmt()
|
autocmd BufWritePre *.tf call terraform#fmt()
|
||||||
autocmd BufWritePre *.tfvars call terraform#fmt()
|
autocmd BufWritePre *.tfvars call terraform#fmt()
|
||||||
endif
|
augroup END
|
||||||
augroup END
|
endif
|
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|||||||
18
ftplugin/zig.vim
Normal file
18
ftplugin/zig.vim
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if (exists("b:did_ftplugin"))
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
set expandtab
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
|
||||||
|
setlocal suffixesadd=.zig
|
||||||
|
setlocal commentstring=//\ %s
|
||||||
|
setlocal makeprg=zig\ build
|
||||||
@@ -52,12 +52,12 @@ if !exists('g:python_pep8_indent_searchpair_timeout')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:block_rules = {
|
let s:block_rules = {
|
||||||
\ '^\s*elif\>': ['if', 'elif'],
|
\ '^\s*elif\>': [['if', 'elif'], ['else']],
|
||||||
\ '^\s*except\>': ['try', 'except'],
|
\ '^\s*except\>': [['try', 'except'], []],
|
||||||
\ '^\s*finally\>': ['try', 'except', 'else']
|
\ '^\s*finally\>': [['try', 'except', 'else'], []]
|
||||||
\ }
|
\ }
|
||||||
let s:block_rules_multiple = {
|
let s:block_rules_multiple = {
|
||||||
\ '^\s*else\>': ['if', 'elif', 'for', 'try', 'except'],
|
\ '^\s*else\>': [['if', 'elif', 'for', 'try', 'except'], []]
|
||||||
\ }
|
\ }
|
||||||
" Pairs to look for when searching for opening parenthesis.
|
" Pairs to look for when searching for opening parenthesis.
|
||||||
" The value is the maximum offset in lines.
|
" The value is the maximum offset in lines.
|
||||||
@@ -73,13 +73,15 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>'
|
|||||||
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||||
\ '=~? "\\vcomment|jedi\\S"'
|
\ '=~? "\\vcomment|jedi\\S"'
|
||||||
|
|
||||||
|
let s:special_chars_syn_pattern = "\\vstring|comment|^pythonbytes%(contents)=$|pythonTodo|jedi\\S"
|
||||||
|
|
||||||
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
||||||
" Skip strings and comments. Return 1 for chars to skip.
|
" Skip strings and comments. Return 1 for chars to skip.
|
||||||
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
|
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
|
||||||
" are inserted temporarily into the buffer.
|
" are inserted temporarily into the buffer.
|
||||||
function! s:_skip_special_chars(line, col)
|
function! s:_skip_special_chars(line, col)
|
||||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
\ =~? s:special_chars_syn_pattern
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
" Also ignore anything concealed.
|
" Also ignore anything concealed.
|
||||||
@@ -94,7 +96,7 @@ else
|
|||||||
|
|
||||||
function! s:_skip_special_chars(line, col)
|
function! s:_skip_special_chars(line, col)
|
||||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
\ =~? s:special_chars_syn_pattern
|
||||||
\ || s:is_concealed(a:line, a:col)
|
\ || s:is_concealed(a:line, a:col)
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
@@ -152,15 +154,23 @@ function! s:find_start_of_multiline_statement(lnum)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find possible indent(s) of the block starter that matches the current line.
|
" Find possible indent(s) of the block starter that matches the current line.
|
||||||
function! s:find_start_of_block(lnum, types, multiple)
|
function! s:find_start_of_block(lnum, types, skip, multiple) abort
|
||||||
let r = []
|
let r = []
|
||||||
let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>'
|
let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>'
|
||||||
|
if !empty(a:skip)
|
||||||
|
let re_skip = '\V\^\s\*\('.join(a:skip, '\|').'\)\>'
|
||||||
|
else
|
||||||
|
let re_skip = ''
|
||||||
|
endif
|
||||||
let lnum = a:lnum
|
let lnum = a:lnum
|
||||||
let last_indent = indent(lnum) + 1
|
let last_indent = indent(lnum) + 1
|
||||||
while lnum > 0 && last_indent > 0
|
while lnum > 0 && last_indent > 0
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
if indent < last_indent
|
if indent < last_indent
|
||||||
if getline(lnum) =~# re
|
let line = getline(lnum)
|
||||||
|
if !empty(re_skip) && line =~# re_skip
|
||||||
|
let last_indent = indent
|
||||||
|
elseif line =~# re
|
||||||
if !a:multiple
|
if !a:multiple
|
||||||
return [indent]
|
return [indent]
|
||||||
endif
|
endif
|
||||||
@@ -217,6 +227,11 @@ function! s:indent_like_opening_paren(lnum)
|
|||||||
let res = base
|
let res = base
|
||||||
else
|
else
|
||||||
let res = base + s:sw()
|
let res = base + s:sw()
|
||||||
|
|
||||||
|
" Special case for parenthesis.
|
||||||
|
if text[paren_col-1] ==# '(' && getline(a:lnum) !~# '\v\)\s*:?\s*$'
|
||||||
|
return res
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
" Indent to match position of opening paren.
|
" Indent to match position of opening paren.
|
||||||
@@ -241,14 +256,16 @@ function! s:indent_like_block(lnum)
|
|||||||
let text = getline(a:lnum)
|
let text = getline(a:lnum)
|
||||||
for [multiple, block_rules] in [
|
for [multiple, block_rules] in [
|
||||||
\ [0, s:block_rules],
|
\ [0, s:block_rules],
|
||||||
\ [1, s:block_rules_multiple]]
|
\ [1, s:block_rules_multiple],
|
||||||
for [line_re, blocks] in items(block_rules)
|
\ ]
|
||||||
|
for [line_re, blocks_ignore] in items(block_rules)
|
||||||
if text !~# line_re
|
if text !~# line_re
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let indents = s:find_start_of_block(a:lnum - 1, blocks, multiple)
|
let [blocks, skip] = blocks_ignore
|
||||||
if !len(indents)
|
let indents = s:find_start_of_block(a:lnum - 1, blocks, skip, multiple)
|
||||||
|
if empty(indents)
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
if len(indents) == 1
|
if len(indents) == 1
|
||||||
|
|||||||
81
indent/d.vim
Normal file
81
indent/d.vim
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim indent file for the D programming language (version 1.076 and 2.063).
|
||||||
|
"
|
||||||
|
" Language: D
|
||||||
|
" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
|
||||||
|
" Last Change: 2014 January 19
|
||||||
|
" Version: 0.26
|
||||||
|
"
|
||||||
|
" Please submit bugs/comments/suggestions to the github repo:
|
||||||
|
" https://github.com/JesseKPhillips/d.vim
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal cindent
|
||||||
|
setlocal indentkeys& indentkeys+=0=in indentkeys+=0=out indentkeys+=0=body
|
||||||
|
setlocal indentexpr=GetDIndent()
|
||||||
|
|
||||||
|
if exists("*GetDIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! SkipBlanksAndComments(startline)
|
||||||
|
let lnum = a:startline
|
||||||
|
while lnum > 1
|
||||||
|
let lnum = prevnonblank(lnum)
|
||||||
|
if getline(lnum) =~ '[*+]/\s*$'
|
||||||
|
while getline(lnum) !~ '/[*+]' && lnum > 1
|
||||||
|
let lnum = lnum - 1
|
||||||
|
endwhile
|
||||||
|
if getline(lnum) =~ '^\s*/[*+]'
|
||||||
|
let lnum = lnum - 1
|
||||||
|
else
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
elseif getline(lnum) =~ '\s*//'
|
||||||
|
let lnum = lnum - 1
|
||||||
|
else
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
return lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function GetDIndent()
|
||||||
|
let lnum = v:lnum
|
||||||
|
let line = getline(lnum)
|
||||||
|
let cind = cindent(lnum)
|
||||||
|
|
||||||
|
" Align contract blocks with function signature.
|
||||||
|
if line =~ '^\s*\(body\|in\|out\)\>'
|
||||||
|
" Skip in/out parameters.
|
||||||
|
if getline(lnum - 1) =~ '[(,]\s*$'
|
||||||
|
return cind
|
||||||
|
endif
|
||||||
|
" Find the end of the last block or the function signature.
|
||||||
|
if line !~ '^\s*}' && getline(lnum - 1) !~ '('
|
||||||
|
while lnum > 1 && getline(lnum - 1) !~ '[(}]'
|
||||||
|
let lnum = lnum - 1
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
let lnum = SkipBlanksAndComments(lnum)
|
||||||
|
return cindent(lnum - 1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Align multiline array literals. e.g.:
|
||||||
|
" auto a = [
|
||||||
|
" [ 1, 2, 3 ],
|
||||||
|
" [ 4, 5, 6 ],
|
||||||
|
if line =~ '^\s*\[' && getline(lnum - 1) =~ '^\s*\['
|
||||||
|
return indent(lnum - 1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return cind
|
||||||
|
endfunction
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim indent file
|
|
||||||
" Language: GraphQL
|
|
||||||
" Maintainer: Jon Parise <jon@indelible.org>
|
|
||||||
|
|
||||||
if exists('b:did_indent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
setlocal autoindent
|
|
||||||
setlocal nocindent
|
|
||||||
setlocal nolisp
|
|
||||||
setlocal nosmartindent
|
|
||||||
|
|
||||||
setlocal indentexpr=GetGraphQLIndent()
|
|
||||||
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
|
|
||||||
|
|
||||||
" If our indentation function already exists, we have nothing more to do.
|
|
||||||
if exists('*GetGraphQLIndent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:cpo_save = &cpoptions
|
|
||||||
set cpoptions&vim
|
|
||||||
|
|
||||||
" Check if the character at lnum:col is inside a string.
|
|
||||||
function s:InString(lnum, col)
|
|
||||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') is# 'graphqlString'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function GetGraphQLIndent()
|
|
||||||
" If this is the first non-blank line, we have nothing more to do because
|
|
||||||
" all of our indentation rules are based on matching against earlier lines.
|
|
||||||
let l:prevlnum = prevnonblank(v:lnum - 1)
|
|
||||||
if l:prevlnum == 0
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:line = getline(v:lnum)
|
|
||||||
|
|
||||||
" If this line contains just a closing bracket, find its matching opening
|
|
||||||
" bracket and indent the closing backet to match.
|
|
||||||
let l:col = matchend(l:line, '^\s*[]})]')
|
|
||||||
if l:col > 0 && !s:InString(v:lnum, l:col)
|
|
||||||
let l:bracket = l:line[l:col - 1]
|
|
||||||
call cursor(v:lnum, l:col)
|
|
||||||
|
|
||||||
if l:bracket is# '}'
|
|
||||||
let l:matched = searchpair('{', '', '}', 'bW')
|
|
||||||
elseif l:bracket is# ']'
|
|
||||||
let l:matched = searchpair('\[', '', '\]', 'bW')
|
|
||||||
elseif l:bracket is# ')'
|
|
||||||
let l:matched = searchpair('(', '', ')', 'bW')
|
|
||||||
else
|
|
||||||
let l:matched = -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
return l:matched > 0 ? indent(l:matched) : virtcol('.') - 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If we're inside of a multiline string, continue with the same indentation.
|
|
||||||
if s:InString(v:lnum, matchend(l:line, '^\s*') + 1)
|
|
||||||
return indent(v:lnum)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line contained an opening bracket, and we are still in it,
|
|
||||||
" add indent depending on the bracket type.
|
|
||||||
if getline(l:prevlnum) =~# '[[{(]\s*$'
|
|
||||||
return indent(l:prevlnum) + shiftwidth()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Default to the existing indentation level.
|
|
||||||
return indent(l:prevlnum)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpoptions = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
15
indent/hcl.vim
Normal file
15
indent/hcl.vim
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'hcl') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('b:did_indent')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" cindent seems to work adequately with HCL's brace-y syntax
|
||||||
|
setlocal cindent
|
||||||
|
|
||||||
|
" don't de-indent comments (cindent treats them like preprocessor directives)
|
||||||
|
setlocal cinkeys-=0#
|
||||||
@@ -5,9 +5,9 @@ endif
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Kotlin
|
" Language: Kotlin
|
||||||
" Maintainer: Alexander Udalov
|
" Maintainer: Alexander Udalov
|
||||||
" Latest Revision: 15 July 2017
|
" Latest Revision: 26 May 2019
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
@@ -45,24 +45,14 @@ function! GetKotlinIndent()
|
|||||||
|
|
||||||
let prev_open_paren = prev =~ '^.*(\s*$'
|
let prev_open_paren = prev =~ '^.*(\s*$'
|
||||||
let cur_close_paren = cur =~ '^\s*).*$'
|
let cur_close_paren = cur =~ '^\s*).*$'
|
||||||
|
|
||||||
if prev_open_paren && !cur_close_paren
|
|
||||||
return prev_indent + 2 * &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if cur_close_paren && !prev_open_paren
|
|
||||||
return prev_indent - 2 * &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
let prev_open_brace = prev =~ '^.*\({\|->\)\s*$'
|
let prev_open_brace = prev =~ '^.*\({\|->\)\s*$'
|
||||||
let cur_close_brace = cur =~ '^\s*}.*$'
|
let cur_close_brace = cur =~ '^\s*}.*$'
|
||||||
|
|
||||||
if prev_open_brace && !cur_close_brace
|
if prev_open_paren && !cur_close_paren || prev_open_brace && !cur_close_brace
|
||||||
return prev_indent + &shiftwidth
|
return prev_indent + &shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cur_close_brace && !prev_open_brace
|
if cur_close_paren && !prev_open_paren || cur_close_brace && !prev_open_brace
|
||||||
return prev_indent - &shiftwidth
|
return prev_indent - &shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'liquid') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim indent file
|
|
||||||
" Language: Liquid
|
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
|
||||||
" Last Change: 2010 May 21
|
|
||||||
|
|
||||||
if exists('b:did_indent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
set indentexpr=
|
|
||||||
if exists('b:liquid_subtype')
|
|
||||||
exe 'runtime! indent/'.b:liquid_subtype.'.vim'
|
|
||||||
else
|
|
||||||
runtime! indent/html.vim
|
|
||||||
endif
|
|
||||||
unlet! b:did_indent
|
|
||||||
|
|
||||||
if &l:indentexpr == ''
|
|
||||||
if &l:cindent
|
|
||||||
let &l:indentexpr = 'cindent(v:lnum)'
|
|
||||||
else
|
|
||||||
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
let b:liquid_subtype_indentexpr = &l:indentexpr
|
|
||||||
|
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
setlocal indentexpr=GetLiquidIndent()
|
|
||||||
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=endif,=endunless,=endifchanged,=endcase,=endfor,=endtablerow,=endcapture,=else,=elsif,=when,=empty
|
|
||||||
|
|
||||||
" Only define the function once.
|
|
||||||
if exists('*GetLiquidIndent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! s:count(string,pattern)
|
|
||||||
let string = substitute(a:string,'\C'.a:pattern,"\n",'g')
|
|
||||||
return strlen(substitute(string,"[^\n]",'','g'))
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! GetLiquidIndent(...)
|
|
||||||
if a:0 && a:1 == '.'
|
|
||||||
let v:lnum = line('.')
|
|
||||||
elseif a:0 && a:1 =~ '^\d'
|
|
||||||
let v:lnum = a:1
|
|
||||||
endif
|
|
||||||
let vcol = col('.')
|
|
||||||
call cursor(v:lnum,1)
|
|
||||||
exe "let ind = ".b:liquid_subtype_indentexpr
|
|
||||||
let lnum = prevnonblank(v:lnum-1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
let cline = getline(v:lnum)
|
|
||||||
let line = substitute(line,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
|
||||||
let line .= matchstr(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+')
|
|
||||||
let cline = substitute(cline,'\C^\%(\s*{%\s*end\w*\s*%}\)\+','','')
|
|
||||||
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
|
||||||
let ind += sw * s:count(line,'{%\s*\%(if\|elsif\|else\|unless\|ifchanged\|case\|when\|for\|empty\|tablerow\|capture\)\>')
|
|
||||||
let ind -= sw * s:count(line,'{%\s*end\%(if\|unless\|ifchanged\|case\|for\|tablerow\|capture\)\>')
|
|
||||||
let ind -= sw * s:count(cline,'{%\s*\%(elsif\|else\|when\|empty\)\>')
|
|
||||||
let ind -= sw * s:count(cline,'{%\s*end\w*$')
|
|
||||||
return ind
|
|
||||||
endfunction
|
|
||||||
@@ -174,66 +174,101 @@ endfun
|
|||||||
" [-- <ELEMENT ? - - ...> --]
|
" [-- <ELEMENT ? - - ...> --]
|
||||||
call <SID>HtmlIndentPush('a')
|
call <SID>HtmlIndentPush('a')
|
||||||
call <SID>HtmlIndentPush('abbr')
|
call <SID>HtmlIndentPush('abbr')
|
||||||
call <SID>HtmlIndentPush('acronym')
|
|
||||||
call <SID>HtmlIndentPush('address')
|
call <SID>HtmlIndentPush('address')
|
||||||
|
call <SID>HtmlIndentPush('applet')
|
||||||
|
call <SID>HtmlIndentPush('article')
|
||||||
|
call <SID>HtmlIndentPush('aside')
|
||||||
|
call <SID>HtmlIndentPush('audio')
|
||||||
call <SID>HtmlIndentPush('b')
|
call <SID>HtmlIndentPush('b')
|
||||||
|
call <SID>HtmlIndentPush('bdi')
|
||||||
call <SID>HtmlIndentPush('bdo')
|
call <SID>HtmlIndentPush('bdo')
|
||||||
call <SID>HtmlIndentPush('big')
|
|
||||||
call <SID>HtmlIndentPush('blockquote')
|
call <SID>HtmlIndentPush('blockquote')
|
||||||
call <SID>HtmlIndentPush('button')
|
call <SID>HtmlIndentPush('button')
|
||||||
|
call <SID>HtmlIndentPush('canvas')
|
||||||
call <SID>HtmlIndentPush('caption')
|
call <SID>HtmlIndentPush('caption')
|
||||||
call <SID>HtmlIndentPush('center')
|
|
||||||
call <SID>HtmlIndentPush('cite')
|
call <SID>HtmlIndentPush('cite')
|
||||||
call <SID>HtmlIndentPush('code')
|
call <SID>HtmlIndentPush('code')
|
||||||
call <SID>HtmlIndentPush('colgroup')
|
call <SID>HtmlIndentPush('colgroup')
|
||||||
|
call <SID>HtmlIndentPush('content')
|
||||||
|
call <SID>HtmlIndentPush('data')
|
||||||
|
call <SID>HtmlIndentPush('datalist')
|
||||||
call <SID>HtmlIndentPush('del')
|
call <SID>HtmlIndentPush('del')
|
||||||
|
call <SID>HtmlIndentPush('details')
|
||||||
call <SID>HtmlIndentPush('dfn')
|
call <SID>HtmlIndentPush('dfn')
|
||||||
|
call <SID>HtmlIndentPush('dialog')
|
||||||
call <SID>HtmlIndentPush('dir')
|
call <SID>HtmlIndentPush('dir')
|
||||||
call <SID>HtmlIndentPush('div')
|
call <SID>HtmlIndentPush('div')
|
||||||
call <SID>HtmlIndentPush('dl')
|
call <SID>HtmlIndentPush('dl')
|
||||||
|
call <SID>HtmlIndentPush('element')
|
||||||
call <SID>HtmlIndentPush('em')
|
call <SID>HtmlIndentPush('em')
|
||||||
call <SID>HtmlIndentPush('fieldset')
|
call <SID>HtmlIndentPush('fieldset')
|
||||||
call <SID>HtmlIndentPush('font')
|
call <SID>HtmlIndentPush('figcaption')
|
||||||
|
call <SID>HtmlIndentPush('figure')
|
||||||
|
call <SID>HtmlIndentPush('footer')
|
||||||
call <SID>HtmlIndentPush('form')
|
call <SID>HtmlIndentPush('form')
|
||||||
call <SID>HtmlIndentPush('frameset')
|
|
||||||
call <SID>HtmlIndentPush('h1')
|
call <SID>HtmlIndentPush('h1')
|
||||||
call <SID>HtmlIndentPush('h2')
|
call <SID>HtmlIndentPush('h2')
|
||||||
call <SID>HtmlIndentPush('h3')
|
call <SID>HtmlIndentPush('h3')
|
||||||
call <SID>HtmlIndentPush('h4')
|
call <SID>HtmlIndentPush('h4')
|
||||||
call <SID>HtmlIndentPush('h5')
|
call <SID>HtmlIndentPush('h5')
|
||||||
call <SID>HtmlIndentPush('h6')
|
call <SID>HtmlIndentPush('h6')
|
||||||
|
call <SID>HtmlIndentPush('header')
|
||||||
|
call <SID>HtmlIndentPush('hgroup')
|
||||||
call <SID>HtmlIndentPush('i')
|
call <SID>HtmlIndentPush('i')
|
||||||
call <SID>HtmlIndentPush('iframe')
|
call <SID>HtmlIndentPush('iframe')
|
||||||
call <SID>HtmlIndentPush('ins')
|
call <SID>HtmlIndentPush('ins')
|
||||||
call <SID>HtmlIndentPush('kbd')
|
call <SID>HtmlIndentPush('kbd')
|
||||||
call <SID>HtmlIndentPush('label')
|
call <SID>HtmlIndentPush('label')
|
||||||
call <SID>HtmlIndentPush('legend')
|
call <SID>HtmlIndentPush('legend')
|
||||||
|
call <SID>HtmlIndentPush('li')
|
||||||
|
call <SID>HtmlIndentPush('main')
|
||||||
call <SID>HtmlIndentPush('map')
|
call <SID>HtmlIndentPush('map')
|
||||||
|
call <SID>HtmlIndentPush('mark')
|
||||||
|
call <SID>HtmlIndentPush('MediaStream')
|
||||||
call <SID>HtmlIndentPush('menu')
|
call <SID>HtmlIndentPush('menu')
|
||||||
call <SID>HtmlIndentPush('noframes')
|
call <SID>HtmlIndentPush('menuitem')
|
||||||
|
call <SID>HtmlIndentPush('meter')
|
||||||
|
call <SID>HtmlIndentPush('nav')
|
||||||
|
call <SID>HtmlIndentPush('noembed')
|
||||||
call <SID>HtmlIndentPush('noscript')
|
call <SID>HtmlIndentPush('noscript')
|
||||||
call <SID>HtmlIndentPush('object')
|
call <SID>HtmlIndentPush('object')
|
||||||
call <SID>HtmlIndentPush('ol')
|
call <SID>HtmlIndentPush('ol')
|
||||||
call <SID>HtmlIndentPush('optgroup')
|
call <SID>HtmlIndentPush('optgroup')
|
||||||
|
call <SID>HtmlIndentPush('option')
|
||||||
|
call <SID>HtmlIndentPush('output')
|
||||||
|
call <SID>HtmlIndentPush('picture')
|
||||||
call <SID>HtmlIndentPush('pre')
|
call <SID>HtmlIndentPush('pre')
|
||||||
|
call <SID>HtmlIndentPush('progress')
|
||||||
call <SID>HtmlIndentPush('q')
|
call <SID>HtmlIndentPush('q')
|
||||||
|
call <SID>HtmlIndentPush('rb')
|
||||||
|
call <SID>HtmlIndentPush('rp')
|
||||||
|
call <SID>HtmlIndentPush('rt')
|
||||||
|
call <SID>HtmlIndentPush('rtc')
|
||||||
|
call <SID>HtmlIndentPush('ruby')
|
||||||
call <SID>HtmlIndentPush('s')
|
call <SID>HtmlIndentPush('s')
|
||||||
call <SID>HtmlIndentPush('samp')
|
call <SID>HtmlIndentPush('samp')
|
||||||
call <SID>HtmlIndentPush('script')
|
call <SID>HtmlIndentPush('script')
|
||||||
|
call <SID>HtmlIndentPush('section')
|
||||||
call <SID>HtmlIndentPush('select')
|
call <SID>HtmlIndentPush('select')
|
||||||
|
call <SID>HtmlIndentPush('shadow')
|
||||||
|
call <SID>HtmlIndentPush('slot')
|
||||||
call <SID>HtmlIndentPush('small')
|
call <SID>HtmlIndentPush('small')
|
||||||
call <SID>HtmlIndentPush('span')
|
call <SID>HtmlIndentPush('span')
|
||||||
call <SID>HtmlIndentPush('strong')
|
call <SID>HtmlIndentPush('strong')
|
||||||
call <SID>HtmlIndentPush('style')
|
call <SID>HtmlIndentPush('style')
|
||||||
call <SID>HtmlIndentPush('sub')
|
call <SID>HtmlIndentPush('sub')
|
||||||
|
call <SID>HtmlIndentPush('summary')
|
||||||
call <SID>HtmlIndentPush('sup')
|
call <SID>HtmlIndentPush('sup')
|
||||||
call <SID>HtmlIndentPush('table')
|
call <SID>HtmlIndentPush('table')
|
||||||
|
call <SID>HtmlIndentPush('template')
|
||||||
call <SID>HtmlIndentPush('textarea')
|
call <SID>HtmlIndentPush('textarea')
|
||||||
|
call <SID>HtmlIndentPush('time')
|
||||||
call <SID>HtmlIndentPush('title')
|
call <SID>HtmlIndentPush('title')
|
||||||
call <SID>HtmlIndentPush('tt')
|
call <SID>HtmlIndentPush('tt')
|
||||||
call <SID>HtmlIndentPush('u')
|
call <SID>HtmlIndentPush('u')
|
||||||
call <SID>HtmlIndentPush('ul')
|
call <SID>HtmlIndentPush('ul')
|
||||||
call <SID>HtmlIndentPush('var')
|
call <SID>HtmlIndentPush('var')
|
||||||
|
call <SID>HtmlIndentPush('video')
|
||||||
|
|
||||||
" For some reason the default HTML indentation script doesn't consider these
|
" For some reason the default HTML indentation script doesn't consider these
|
||||||
" elements to be worthy of indentation.
|
" elements to be worthy of indentation.
|
||||||
@@ -260,6 +295,44 @@ if !exists('g:html_indent_strict_table')
|
|||||||
call <SID>HtmlIndentPush('thead')
|
call <SID>HtmlIndentPush('thead')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" [-- <OBSOLETE ELEMENTS ? - - ...> --]
|
||||||
|
call <SID>HtmlIndentPush('abbr')
|
||||||
|
call <SID>HtmlIndentPush('acronym')
|
||||||
|
call <SID>HtmlIndentPush('applet')
|
||||||
|
call <SID>HtmlIndentPush('audio')
|
||||||
|
call <SID>HtmlIndentPush('basefont')
|
||||||
|
call <SID>HtmlIndentPush('bgsound')
|
||||||
|
call <SID>HtmlIndentPush('big')
|
||||||
|
call <SID>HtmlIndentPush('blink')
|
||||||
|
call <SID>HtmlIndentPush('center')
|
||||||
|
call <SID>HtmlIndentPush('command')
|
||||||
|
call <SID>HtmlIndentPush('content')
|
||||||
|
call <SID>HtmlIndentPush('dir')
|
||||||
|
call <SID>HtmlIndentPush('element')
|
||||||
|
call <SID>HtmlIndentPush('embed')
|
||||||
|
call <SID>HtmlIndentPush('font')
|
||||||
|
call <SID>HtmlIndentPush('frame')
|
||||||
|
call <SID>HtmlIndentPush('frameset')
|
||||||
|
call <SID>HtmlIndentPush('image')
|
||||||
|
call <SID>HtmlIndentPush('img')
|
||||||
|
call <SID>HtmlIndentPush('isindex')
|
||||||
|
call <SID>HtmlIndentPush('keygen')
|
||||||
|
call <SID>HtmlIndentPush('listing')
|
||||||
|
call <SID>HtmlIndentPush('marquee')
|
||||||
|
call <SID>HtmlIndentPush('menuitem')
|
||||||
|
call <SID>HtmlIndentPush('multicol')
|
||||||
|
call <SID>HtmlIndentPush('nextid')
|
||||||
|
call <SID>HtmlIndentPush('nobr')
|
||||||
|
call <SID>HtmlIndentPush('noembed')
|
||||||
|
call <SID>HtmlIndentPush('noframes')
|
||||||
|
call <SID>HtmlIndentPush('object')
|
||||||
|
call <SID>HtmlIndentPush('plaintext')
|
||||||
|
call <SID>HtmlIndentPush('shadow')
|
||||||
|
call <SID>HtmlIndentPush('spacer')
|
||||||
|
call <SID>HtmlIndentPush('strike')
|
||||||
|
call <SID>HtmlIndentPush('tt')
|
||||||
|
call <SID>HtmlIndentPush('xmp')
|
||||||
|
|
||||||
" [-- <Mako Elements> --]
|
" [-- <Mako Elements> --]
|
||||||
call <SID>MakoIndentPush('%def')
|
call <SID>MakoIndentPush('%def')
|
||||||
call <SID>MakoIndentPush('%block')
|
call <SID>MakoIndentPush('%block')
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ function! GetNimIndent(lnum)
|
|||||||
return plindent + &sw
|
return plindent + &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if pline =~ '\(type\|import\|const\|var\)\s*$'
|
if pline =~ '\(type\|import\|const\|var\|let\)\s*$'
|
||||||
\ || pline =~ '=\s*\(object\|enum\|tuple\|concept\)'
|
\ || pline =~ '=\s*\(object\|enum\|tuple\|concept\)'
|
||||||
return plindent + &sw
|
return plindent + &sw
|
||||||
endif
|
endif
|
||||||
|
|||||||
397
indent/pgsql.vim
Normal file
397
indent/pgsql.vim
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'pgsql') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language: SQL
|
||||||
|
" Author: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||||
|
" Maintainer: Lifepillar <lifepillar at lifepillar dot me>
|
||||||
|
|
||||||
|
" Notes:
|
||||||
|
" Adapted from Vim's default indentation for SQL.
|
||||||
|
"
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
let b:current_indent = "pgsql"
|
||||||
|
|
||||||
|
setlocal indentkeys-=0{
|
||||||
|
setlocal indentkeys-=0}
|
||||||
|
setlocal indentkeys-=:
|
||||||
|
setlocal indentkeys-=0#
|
||||||
|
setlocal indentkeys-=e
|
||||||
|
|
||||||
|
if has('patch-7.3.694') || (v:version == 703 && has('patch694'))
|
||||||
|
fun! s:shiftwidth()
|
||||||
|
return shiftwidth()
|
||||||
|
endf
|
||||||
|
|
||||||
|
else
|
||||||
|
fun! s:shiftwidth()
|
||||||
|
return &sw
|
||||||
|
endf
|
||||||
|
endif
|
||||||
|
|
||||||
|
" This indicates formatting should take place when one of these
|
||||||
|
" expressions is used. These expressions would normally be something
|
||||||
|
" you would type at the BEGINNING of a line
|
||||||
|
" SQL is generally case insensitive, so this files assumes that
|
||||||
|
" These keywords are something that would trigger an indent LEFT, not
|
||||||
|
" an indent right, since the SQLBlockStart is used for those keywords
|
||||||
|
setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=)
|
||||||
|
|
||||||
|
" GetSQLIndent is executed whenever one of the expressions
|
||||||
|
" in the indentkeys is typed
|
||||||
|
setlocal indentexpr=GetSQLIndent()
|
||||||
|
|
||||||
|
" Only define the functions once.
|
||||||
|
if exists("*GetSQLIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let s:keepcpo= &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" List of all the statements that start a new block.
|
||||||
|
" These are typically words that start a line.
|
||||||
|
" IS is excluded, since it is difficult to determine when the
|
||||||
|
" ending block is (especially for procedures/functions).
|
||||||
|
let s:SQLBlockStart = '^\s*\%('.
|
||||||
|
\ 'if\>.*\<then\|'.
|
||||||
|
\ 'then\|'.
|
||||||
|
\ 'else\|'.
|
||||||
|
\ 'elseif\>.*\<then\|'.
|
||||||
|
\ 'elsif\>.*\<then\|'.
|
||||||
|
\ 'while\>.*\<loop\|'.
|
||||||
|
\ 'for\>.*\<loop\|'.
|
||||||
|
\ 'foreach\>.*\<loop\|'.
|
||||||
|
\ 'loop\|'.
|
||||||
|
\ 'do\|'.
|
||||||
|
\ 'declare\|'.
|
||||||
|
\ 'begin\|'.
|
||||||
|
\ 'case\|'.
|
||||||
|
\ 'when\|'.
|
||||||
|
\ 'merge\|'.
|
||||||
|
\ 'exception'.
|
||||||
|
\ '\)\>'
|
||||||
|
let s:SQLBlockEnd = '^\s*\(end\)\>'
|
||||||
|
|
||||||
|
" The indent level is also based on unmatched parentheses
|
||||||
|
" If a line has an extra "(" increase the indent
|
||||||
|
" If a line has an extra ")" decrease the indent
|
||||||
|
function! s:CountUnbalancedParen( line, paren_to_check )
|
||||||
|
let l = a:line
|
||||||
|
let lp = substitute(l, '[^(]', '', 'g')
|
||||||
|
let l = a:line
|
||||||
|
let rp = substitute(l, '[^)]', '', 'g')
|
||||||
|
|
||||||
|
if a:paren_to_check =~ ')'
|
||||||
|
" echom 'CountUnbalancedParen ) returning: ' .
|
||||||
|
" \ (strlen(rp) - strlen(lp))
|
||||||
|
return (strlen(rp) - strlen(lp))
|
||||||
|
elseif a:paren_to_check =~ '('
|
||||||
|
" echom 'CountUnbalancedParen ( returning: ' .
|
||||||
|
" \ (strlen(lp) - strlen(rp))
|
||||||
|
return (strlen(lp) - strlen(rp))
|
||||||
|
else
|
||||||
|
" echom 'CountUnbalancedParen unknown paren to check: ' .
|
||||||
|
" \ a:paren_to_check
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Unindent commands based on previous indent level
|
||||||
|
function! s:CheckToIgnoreRightParen( prev_lnum, num_levels )
|
||||||
|
let lnum = a:prev_lnum
|
||||||
|
let line = getline(lnum)
|
||||||
|
let ends = 0
|
||||||
|
let num_right_paren = a:num_levels
|
||||||
|
let ignore_paren = 0
|
||||||
|
let vircol = 1
|
||||||
|
|
||||||
|
while num_right_paren > 0
|
||||||
|
silent! exec 'norm! '.lnum."G\<bar>".vircol."\<bar>"
|
||||||
|
let right_paren = search( ')', 'W' )
|
||||||
|
if right_paren != lnum
|
||||||
|
" This should not happen since there should be at least
|
||||||
|
" num_right_paren matches for this line
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let vircol = virtcol(".")
|
||||||
|
|
||||||
|
" if getline(".") =~ '^)'
|
||||||
|
let matching_paren = searchpair('(', '', ')', 'bW',
|
||||||
|
\ 's:IsColComment(line("."), col("."))')
|
||||||
|
|
||||||
|
if matching_paren < 1
|
||||||
|
" No match found
|
||||||
|
" echom 'CTIRP - no match found, ignoring'
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
if matching_paren == lnum
|
||||||
|
" This was not an unmatched parenthesis, start the search again
|
||||||
|
" again after this column
|
||||||
|
" echom 'CTIRP - same line match, ignoring'
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
" echom 'CTIRP - match: ' . line(".") . ' ' . getline(".")
|
||||||
|
|
||||||
|
if getline(matching_paren) =~? '\(if\|while\)\>'
|
||||||
|
" echom 'CTIRP - if/while ignored: ' . line(".") . ' ' . getline(".")
|
||||||
|
let ignore_paren = ignore_paren + 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" One match found, decrease and check for further matches
|
||||||
|
let num_right_paren = num_right_paren - 1
|
||||||
|
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" Fallback - just move back one
|
||||||
|
" return a:prev_indent - s:shiftwidth()
|
||||||
|
return ignore_paren
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Based on the keyword provided, loop through previous non empty
|
||||||
|
" non comment lines to find the statement that initiated the keyword.
|
||||||
|
" Return its indent level
|
||||||
|
" CASE ..
|
||||||
|
" WHEN ...
|
||||||
|
" Should return indent level of CASE
|
||||||
|
" EXCEPTION ..
|
||||||
|
" WHEN ...
|
||||||
|
" something;
|
||||||
|
" WHEN ...
|
||||||
|
" Should return indent level of exception.
|
||||||
|
function! s:GetStmtStarterIndent( keyword, curr_lnum )
|
||||||
|
let lnum = a:curr_lnum
|
||||||
|
|
||||||
|
" Default - reduce indent by 1
|
||||||
|
let ind = indent(a:curr_lnum) - s:shiftwidth()
|
||||||
|
|
||||||
|
if a:keyword =~? 'end'
|
||||||
|
exec 'normal! ^'
|
||||||
|
let stmts = '^\s*\%('.
|
||||||
|
\ '\<begin\>\|' .
|
||||||
|
\ '\%(\%(\<end\s\+\)\@<!\<loop\>\)\|' .
|
||||||
|
\ '\%(\%(\<end\s\+\)\@<!\<case\>\)\|' .
|
||||||
|
\ '\%(\%(\<end\s\+\)\@<!\<for\>\)\|' .
|
||||||
|
\ '\%(\%(\<end\s\+\)\@<!\<if\>\)'.
|
||||||
|
\ '\)'
|
||||||
|
let matching_lnum = searchpair(stmts, '', '\<end\>\zs', 'bW',
|
||||||
|
\ 's:IsColComment(line("."), col(".")) == 1')
|
||||||
|
exec 'normal! $'
|
||||||
|
if matching_lnum > 0 && matching_lnum < a:curr_lnum
|
||||||
|
let ind = indent(matching_lnum)
|
||||||
|
endif
|
||||||
|
elseif a:keyword =~? 'when'
|
||||||
|
exec 'normal! ^'
|
||||||
|
let matching_lnum = searchpair(
|
||||||
|
\ '\%(\<end\s\+\)\@<!\<case\>\|\<exception\>\|\<merge\>',
|
||||||
|
\ '',
|
||||||
|
\ '\%(\%(\<when\s\+others\>\)\|\%(\<end\s\+case\>\)\)',
|
||||||
|
\ 'bW',
|
||||||
|
\ 's:IsColComment(line("."), col(".")) == 1')
|
||||||
|
exec 'normal! $'
|
||||||
|
if matching_lnum > 0 && matching_lnum < a:curr_lnum
|
||||||
|
let ind = indent(matching_lnum)
|
||||||
|
else
|
||||||
|
let ind = indent(a:curr_lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Check if the line is a comment
|
||||||
|
function! s:IsLineComment(lnum)
|
||||||
|
let rc = synIDattr(
|
||||||
|
\ synID(a:lnum,
|
||||||
|
\ match(getline(a:lnum), '\S')+1, 0)
|
||||||
|
\ , "name")
|
||||||
|
\ =~? "comment"
|
||||||
|
|
||||||
|
return rc
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Check if the column is a comment
|
||||||
|
function! s:IsColComment(lnum, cnum)
|
||||||
|
let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name")
|
||||||
|
\ =~? "comment"
|
||||||
|
|
||||||
|
return rc
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Instead of returning a column position, return
|
||||||
|
" an appropriate value as a factor of shiftwidth.
|
||||||
|
function! s:ModuloIndent(ind)
|
||||||
|
let ind = a:ind
|
||||||
|
|
||||||
|
if ind > 0
|
||||||
|
let modulo = ind % s:shiftwidth()
|
||||||
|
|
||||||
|
if modulo > 0
|
||||||
|
let ind = ind - modulo
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Find correct indent of a new line based upon the previous line
|
||||||
|
function! GetSQLIndent()
|
||||||
|
let lnum = v:lnum
|
||||||
|
let ind = indent(lnum)
|
||||||
|
|
||||||
|
" If the current line is a comment, leave the indent as is
|
||||||
|
" Comment out this additional check since it affects the
|
||||||
|
" indenting of =, and will not reindent comments as it should
|
||||||
|
" if s:IsLineComment(lnum) == 1
|
||||||
|
" return ind
|
||||||
|
" endif
|
||||||
|
|
||||||
|
" Get previous non-blank line
|
||||||
|
let prevlnum = prevnonblank(lnum - 1)
|
||||||
|
if prevlnum <= 0
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:IsLineComment(prevlnum) == 1
|
||||||
|
if getline(v:lnum) =~ '^\s*\*'
|
||||||
|
let ind = s:ModuloIndent(indent(prevlnum))
|
||||||
|
return ind + 1
|
||||||
|
endif
|
||||||
|
" If the previous line is a comment, then return -1
|
||||||
|
" to tell Vim to use the formatoptions setting to determine
|
||||||
|
" the indent to use
|
||||||
|
" But only if the next line is blank. This would be true if
|
||||||
|
" the user is typing, but it would not be true if the user
|
||||||
|
" is reindenting the file
|
||||||
|
if getline(v:lnum) =~ '^\s*$'
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum)
|
||||||
|
|
||||||
|
" This is the line you just hit return on, it is not the current line
|
||||||
|
" which is new and empty
|
||||||
|
" Based on this line, we can determine how much to indent the new
|
||||||
|
" line
|
||||||
|
|
||||||
|
" Get default indent (from prev. line)
|
||||||
|
let ind = indent(prevlnum)
|
||||||
|
let prevline = getline(prevlnum)
|
||||||
|
|
||||||
|
" Now check what's on the previous line to determine if the indent
|
||||||
|
" should be changed, for example IF, BEGIN, should increase the indent
|
||||||
|
" where END IF, END, should decrease the indent.
|
||||||
|
if prevline =~? s:SQLBlockStart
|
||||||
|
" Move indent in
|
||||||
|
let ind = ind + s:shiftwidth()
|
||||||
|
" echom 'prevl - SQLBlockStart - indent ' . ind . ' line: ' . prevline
|
||||||
|
elseif prevline =~ '[()]'
|
||||||
|
if prevline =~ '('
|
||||||
|
let num_unmatched_left = s:CountUnbalancedParen( prevline, '(' )
|
||||||
|
else
|
||||||
|
let num_unmatched_left = 0
|
||||||
|
endif
|
||||||
|
if prevline =~ ')'
|
||||||
|
let num_unmatched_right = s:CountUnbalancedParen( prevline, ')' )
|
||||||
|
else
|
||||||
|
let num_unmatched_right = 0
|
||||||
|
" let num_unmatched_right = s:CountUnbalancedParen( prevline, ')' )
|
||||||
|
endif
|
||||||
|
if num_unmatched_left > 0
|
||||||
|
" There is a open left parenthesis
|
||||||
|
" increase indent
|
||||||
|
let ind = ind + ( s:shiftwidth() * num_unmatched_left )
|
||||||
|
elseif num_unmatched_right > 0
|
||||||
|
" if it is an unbalanced parenthesis only unindent if
|
||||||
|
" it was part of a command (ie create table(..) )
|
||||||
|
" instead of part of an if (ie if (....) then) which should
|
||||||
|
" maintain the indent level
|
||||||
|
let ignore = s:CheckToIgnoreRightParen( prevlnum, num_unmatched_right )
|
||||||
|
" echom 'prevl - ) unbalanced - CTIRP - ignore: ' . ignore
|
||||||
|
|
||||||
|
if prevline =~ '^\s*)'
|
||||||
|
let ignore = ignore + 1
|
||||||
|
" echom 'prevl - begins ) unbalanced ignore: ' . ignore
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (num_unmatched_right - ignore) > 0
|
||||||
|
let ind = ind - ( s:shiftwidth() * (num_unmatched_right - ignore) )
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" echom 'CURRENT INDENT: ' . ind . ' LINE: ' . getline(v:lnum)
|
||||||
|
|
||||||
|
" This is a new blank line since we just typed a carriage return
|
||||||
|
" Check current line; search for simplistic matching start-of-block
|
||||||
|
let line = getline(v:lnum)
|
||||||
|
|
||||||
|
if line =~? '^\s*els'
|
||||||
|
" Any line when you type else will automatically back up one
|
||||||
|
" ident level (ie else, elseif, elsif)
|
||||||
|
let ind = ind - s:shiftwidth()
|
||||||
|
" echom 'curr - else - indent ' . ind
|
||||||
|
elseif line =~? '^\s*end\>'
|
||||||
|
let ind = s:GetStmtStarterIndent('end', v:lnum)
|
||||||
|
" General case for end
|
||||||
|
" let ind = ind - s:shiftwidth()
|
||||||
|
" echom 'curr - end - indent ' . ind
|
||||||
|
elseif line =~? '^\s*when\>'
|
||||||
|
let ind = s:GetStmtStarterIndent('when', v:lnum)
|
||||||
|
" If the WHEN clause is used with a MERGE or EXCEPTION
|
||||||
|
" clause, do not change the indent level, since these
|
||||||
|
" statements do not have a corresponding END statement.
|
||||||
|
" if stmt_starter =~? 'case'
|
||||||
|
" let ind = ind - s:shiftwidth()
|
||||||
|
" endif
|
||||||
|
" elseif line =~ '^\s*)\s*;\?\s*$'
|
||||||
|
" elseif line =~ '^\s*)'
|
||||||
|
elseif line =~ '^\s*)'
|
||||||
|
let num_unmatched_right = s:CountUnbalancedParen( line, ')' )
|
||||||
|
let ignore = s:CheckToIgnoreRightParen( v:lnum, num_unmatched_right )
|
||||||
|
" If the line ends in a ), then reduce the indent
|
||||||
|
" This catches items like:
|
||||||
|
" CREATE TABLE T1(
|
||||||
|
" c1 int,
|
||||||
|
" c2 int
|
||||||
|
" );
|
||||||
|
" But we do not want to unindent a line like:
|
||||||
|
" IF ( c1 = 1
|
||||||
|
" AND c2 = 3 ) THEN
|
||||||
|
" let num_unmatched_right = s:CountUnbalancedParen( line, ')' )
|
||||||
|
" if num_unmatched_right > 0
|
||||||
|
" elseif strpart( line, strlen(line)-1, 1 ) =~ ')'
|
||||||
|
" let ind = ind - s:shiftwidth()
|
||||||
|
if line =~ '^\s*)'
|
||||||
|
" let ignore = ignore + 1
|
||||||
|
" echom 'curr - begins ) unbalanced ignore: ' . ignore
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (num_unmatched_right - ignore) > 0
|
||||||
|
let ind = ind - ( s:shiftwidth() * (num_unmatched_right - ignore) )
|
||||||
|
endif
|
||||||
|
" endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" echom 'final - indent ' . ind
|
||||||
|
return s:ModuloIndent(ind)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Restore:
|
||||||
|
let &cpo= s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
" vim: ts=4 fdm=marker sw=4
|
||||||
@@ -2,6 +2,12 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'plantuml') != -1
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
scriptencoding utf-8
|
||||||
|
" Vim indent file
|
||||||
|
" Language: PlantUML
|
||||||
|
" Maintainer: Anders Thøgersen <first name at bladre dot dk>
|
||||||
|
" License: VIM LICENSE
|
||||||
|
|
||||||
if exists('b:did_indent')
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@@ -15,14 +21,6 @@ if exists('*GetPlantUMLIndent')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:incIndent =
|
|
||||||
\ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\)\>\|' .
|
|
||||||
\ '^\s*ref\>[^:]*$\|' .
|
|
||||||
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
|
|
||||||
\ '^\s*title\s*$\|' .
|
|
||||||
\ '^\s*skinparam\>.*{\s*$\|' .
|
|
||||||
\ '^\s*\%(state\|class\|partition\|rectangle\|enum\|interface\|namespace\|object\)\>.*{'
|
|
||||||
|
|
||||||
let s:decIndent = '^\s*\%(end\|else\|}\)'
|
let s:decIndent = '^\s*\%(end\|else\|}\)'
|
||||||
|
|
||||||
function! GetPlantUMLIndent(...) abort
|
function! GetPlantUMLIndent(...) abort
|
||||||
@@ -38,6 +36,8 @@ function! GetPlantUMLIndent(...) abort
|
|||||||
let pline = getline(pnum)
|
let pline = getline(pnum)
|
||||||
let cline = getline(clnum)
|
let cline = getline(clnum)
|
||||||
|
|
||||||
|
let s:incIndent = s:getIncIndent()
|
||||||
|
|
||||||
if cline =~ s:decIndent
|
if cline =~ s:decIndent
|
||||||
if pline =~ s:incIndent
|
if pline =~ s:incIndent
|
||||||
return pindent
|
return pindent
|
||||||
@@ -57,3 +57,33 @@ function! s:insidePlantUMLTags(lnum) abort
|
|||||||
call cursor(a:lnum, 1)
|
call cursor(a:lnum, 1)
|
||||||
return search('@startuml', 'Wbn') && search('@enduml', 'Wn')
|
return search('@startuml', 'Wbn') && search('@enduml', 'Wn')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:listSyntax(syntaxKeyword) abort
|
||||||
|
" Get a list of words assigned to a syntax keyword
|
||||||
|
" The 'syntax list <syntax keyword>' command returns
|
||||||
|
" a string with the keyword itself, followed by xxx,
|
||||||
|
" on which we can split to extract the keywords string.
|
||||||
|
" This string must then be split on whitespace
|
||||||
|
let syntaxWords = split(
|
||||||
|
\ execute('syntax list ' . a:syntaxKeyword),
|
||||||
|
\ a:syntaxKeyword . ' xxx ')[-1]
|
||||||
|
return split(syntaxWords)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:typeKeywordIncPattern() abort
|
||||||
|
" Extract keywords for plantumlTypeKeyword, returning the inc pattern
|
||||||
|
let syntaxWords = join(s:listSyntax('plantumlTypeKeyword'), '\\\|')
|
||||||
|
return '^\s*\%(' . syntaxWords . '\)\>.*{'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:getIncIndent() abort
|
||||||
|
" Function to determine the s:incIndent pattern
|
||||||
|
return
|
||||||
|
\ '^\s*\%(class\|object\|interface\|partition\|rectangle\|enum\|namespace\)\>.*{\s*$\|' .
|
||||||
|
\ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\|fork\|split\)\>\|' .
|
||||||
|
\ '^\s*ref\>[^:]*$\|' .
|
||||||
|
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
|
||||||
|
\ '^\s*title\s*$\|' .
|
||||||
|
\ '^\s*skinparam\>.*{\s*$\|' .
|
||||||
|
\ s:typeKeywordIncPattern()
|
||||||
|
endfunction
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ if !exists('g:python_pep8_indent_searchpair_timeout')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:block_rules = {
|
let s:block_rules = {
|
||||||
\ '^\s*elif\>': ['if', 'elif'],
|
\ '^\s*elif\>': [['if', 'elif'], ['else']],
|
||||||
\ '^\s*except\>': ['try', 'except'],
|
\ '^\s*except\>': [['try', 'except'], []],
|
||||||
\ '^\s*finally\>': ['try', 'except', 'else']
|
\ '^\s*finally\>': [['try', 'except', 'else'], []]
|
||||||
\ }
|
\ }
|
||||||
let s:block_rules_multiple = {
|
let s:block_rules_multiple = {
|
||||||
\ '^\s*else\>': ['if', 'elif', 'for', 'try', 'except'],
|
\ '^\s*else\>': [['if', 'elif', 'for', 'try', 'except'], []]
|
||||||
\ }
|
\ }
|
||||||
" Pairs to look for when searching for opening parenthesis.
|
" Pairs to look for when searching for opening parenthesis.
|
||||||
" The value is the maximum offset in lines.
|
" The value is the maximum offset in lines.
|
||||||
@@ -73,13 +73,15 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>'
|
|||||||
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||||
\ '=~? "\\vcomment|jedi\\S"'
|
\ '=~? "\\vcomment|jedi\\S"'
|
||||||
|
|
||||||
|
let s:special_chars_syn_pattern = "\\vstring|comment|^pythonbytes%(contents)=$|pythonTodo|jedi\\S"
|
||||||
|
|
||||||
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
||||||
" Skip strings and comments. Return 1 for chars to skip.
|
" Skip strings and comments. Return 1 for chars to skip.
|
||||||
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
|
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
|
||||||
" are inserted temporarily into the buffer.
|
" are inserted temporarily into the buffer.
|
||||||
function! s:_skip_special_chars(line, col)
|
function! s:_skip_special_chars(line, col)
|
||||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
\ =~? s:special_chars_syn_pattern
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
" Also ignore anything concealed.
|
" Also ignore anything concealed.
|
||||||
@@ -94,7 +96,7 @@ else
|
|||||||
|
|
||||||
function! s:_skip_special_chars(line, col)
|
function! s:_skip_special_chars(line, col)
|
||||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
\ =~? s:special_chars_syn_pattern
|
||||||
\ || s:is_concealed(a:line, a:col)
|
\ || s:is_concealed(a:line, a:col)
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
@@ -152,15 +154,23 @@ function! s:find_start_of_multiline_statement(lnum)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find possible indent(s) of the block starter that matches the current line.
|
" Find possible indent(s) of the block starter that matches the current line.
|
||||||
function! s:find_start_of_block(lnum, types, multiple)
|
function! s:find_start_of_block(lnum, types, skip, multiple) abort
|
||||||
let r = []
|
let r = []
|
||||||
let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>'
|
let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>'
|
||||||
|
if !empty(a:skip)
|
||||||
|
let re_skip = '\V\^\s\*\('.join(a:skip, '\|').'\)\>'
|
||||||
|
else
|
||||||
|
let re_skip = ''
|
||||||
|
endif
|
||||||
let lnum = a:lnum
|
let lnum = a:lnum
|
||||||
let last_indent = indent(lnum) + 1
|
let last_indent = indent(lnum) + 1
|
||||||
while lnum > 0 && last_indent > 0
|
while lnum > 0 && last_indent > 0
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
if indent < last_indent
|
if indent < last_indent
|
||||||
if getline(lnum) =~# re
|
let line = getline(lnum)
|
||||||
|
if !empty(re_skip) && line =~# re_skip
|
||||||
|
let last_indent = indent
|
||||||
|
elseif line =~# re
|
||||||
if !a:multiple
|
if !a:multiple
|
||||||
return [indent]
|
return [indent]
|
||||||
endif
|
endif
|
||||||
@@ -217,6 +227,11 @@ function! s:indent_like_opening_paren(lnum)
|
|||||||
let res = base
|
let res = base
|
||||||
else
|
else
|
||||||
let res = base + s:sw()
|
let res = base + s:sw()
|
||||||
|
|
||||||
|
" Special case for parenthesis.
|
||||||
|
if text[paren_col-1] ==# '(' && getline(a:lnum) !~# '\v\)\s*:?\s*$'
|
||||||
|
return res
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
" Indent to match position of opening paren.
|
" Indent to match position of opening paren.
|
||||||
@@ -241,14 +256,16 @@ function! s:indent_like_block(lnum)
|
|||||||
let text = getline(a:lnum)
|
let text = getline(a:lnum)
|
||||||
for [multiple, block_rules] in [
|
for [multiple, block_rules] in [
|
||||||
\ [0, s:block_rules],
|
\ [0, s:block_rules],
|
||||||
\ [1, s:block_rules_multiple]]
|
\ [1, s:block_rules_multiple],
|
||||||
for [line_re, blocks] in items(block_rules)
|
\ ]
|
||||||
|
for [line_re, blocks_ignore] in items(block_rules)
|
||||||
if text !~# line_re
|
if text !~# line_re
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let indents = s:find_start_of_block(a:lnum - 1, blocks, multiple)
|
let [blocks, skip] = blocks_ignore
|
||||||
if !len(indents)
|
let indents = s:find_start_of_block(a:lnum - 1, blocks, skip, multiple)
|
||||||
|
if empty(indents)
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
if len(indents) == 1
|
if len(indents) == 1
|
||||||
|
|||||||
93
indent/scss.vim
Normal file
93
indent/scss.vim
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language : SCSS (Sassy CSS)
|
||||||
|
" Maintainer : Daniel Hofstetter (daniel.hofstetter@42dh.com)
|
||||||
|
" URL : https://github.com/cakebaker/scss-syntax.vim
|
||||||
|
" Last Change : 2019-08-04
|
||||||
|
" Based on : css.vim by Nikolai Weibull, Oleg Zubchenko
|
||||||
|
" Modified by : ObserverOfTime
|
||||||
|
|
||||||
|
if exists('b:did_indent') | finish | endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal indentexpr=GetSCSSIndent()
|
||||||
|
setlocal indentkeys=0{,0},0(,0),!^F,o,O
|
||||||
|
setlocal nosmartindent
|
||||||
|
|
||||||
|
let b:undo_indent = 'setl smartindent< indentkeys< indentexpr<'
|
||||||
|
|
||||||
|
if exists('*GetSCSSIndent') | finish | endif
|
||||||
|
let s:keepcpo= &cpoptions
|
||||||
|
set cpoptions&vim
|
||||||
|
|
||||||
|
function s:prevnonblanknoncomment(lnum)
|
||||||
|
let l:lnum = a:lnum
|
||||||
|
while l:lnum > 1
|
||||||
|
let l:lnum = prevnonblank(l:lnum)
|
||||||
|
let l:line = getline(l:lnum)
|
||||||
|
if l:line =~? '\*/'
|
||||||
|
while l:lnum > 1 && l:line !~? '/\*'
|
||||||
|
let l:lnum -= 1
|
||||||
|
endwhile
|
||||||
|
if l:line =~? '^\s*/\*'
|
||||||
|
let l:lnum -= 1
|
||||||
|
else
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
return l:lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function s:count_chars(lnum, count_open, chars)
|
||||||
|
let l:n_open = 0
|
||||||
|
let l:n_close = 0
|
||||||
|
let l:line = getline(a:lnum)
|
||||||
|
let l:pattern = '['. a:chars .']'
|
||||||
|
let l:i = match(l:line, l:pattern)
|
||||||
|
let l:noi = 'scss\%(Comment\|StringQ\{1,2}\)'
|
||||||
|
while l:i != -1
|
||||||
|
if synIDattr(synID(a:lnum, l:i + 1, 0), 'name') !~? l:noi
|
||||||
|
if l:line[l:i] ==# a:chars[0]
|
||||||
|
let l:n_open += 1
|
||||||
|
elseif l:line[l:i] ==# a:chars[1]
|
||||||
|
if l:n_open > 0
|
||||||
|
let l:n_open -= 1
|
||||||
|
else
|
||||||
|
let l:n_close += 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let l:i = match(l:line, l:pattern, l:i + 1)
|
||||||
|
endwhile
|
||||||
|
return a:count_open ? l:n_open : l:n_close
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function GetSCSSIndent()
|
||||||
|
let l:line = getline(v:lnum)
|
||||||
|
if l:line =~? '^\s*\*'
|
||||||
|
return cindent(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:pnum = s:prevnonblanknoncomment(v:lnum - 1)
|
||||||
|
if l:pnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
return indent(l:pnum)
|
||||||
|
\ + s:count_chars(l:pnum, 1, '{}') * shiftwidth()
|
||||||
|
\ - s:count_chars(v:lnum, 0, '{}') * shiftwidth()
|
||||||
|
\ + s:count_chars(l:pnum, 1, '()') * shiftwidth()
|
||||||
|
\ - s:count_chars(v:lnum, 0, '()') * shiftwidth()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpoptions = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
" vim:set et ts=2 sw=2:
|
||||||
|
|
||||||
109
indent/svg.vim
Normal file
109
indent/svg.vim
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'svg-indent') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
"
|
||||||
|
" Language: svg
|
||||||
|
" Maintainer: Jason Shell <jason.shell.mail@gmail.com>
|
||||||
|
" Last Change: 2015 Sep 23
|
||||||
|
" Notes: 1) will be confused by unbalanced tags in comments
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists('b:did_indent')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
let s:keepcpo= &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" [-- local settings (must come before aborting the script) --]
|
||||||
|
setlocal indentexpr=SvgIndentGet(v:lnum,1)
|
||||||
|
setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,}
|
||||||
|
|
||||||
|
if !exists('b:svg_indent_open')
|
||||||
|
let b:svg_indent_open = '.\{-}<\a'
|
||||||
|
" pre tag, e.g. <address>
|
||||||
|
" let b:svg_indent_open = '.\{-}<[/]\@!\(address\)\@!'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('b:svg_indent_close')
|
||||||
|
let b:svg_indent_close = '.\{-}</'
|
||||||
|
" end pre tag, e.g. </address>
|
||||||
|
" let b:svg_indent_close = '.\{-}</\(address\)\@!'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
" [-- finish, if the function already exists --]
|
||||||
|
if exists('*SvgIndentGet')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:keepcpo= &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
fun! <SID>SvgIndentWithPattern(line, pat)
|
||||||
|
let s = substitute('x'.a:line, a:pat, "\1", 'g')
|
||||||
|
return strlen(substitute(s, "[^\1].*$", '', ''))
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- check if it's svg --]
|
||||||
|
fun! <SID>SvgIndentSynCheck(lnum)
|
||||||
|
if '' != &syntax
|
||||||
|
let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name')
|
||||||
|
let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
|
||||||
|
if '' != syn1 && syn1 !~ 'svg' && '' != syn2 && syn2 !~ 'svg'
|
||||||
|
" don't indent pure non-xml code
|
||||||
|
return 0
|
||||||
|
|
||||||
|
" elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
|
||||||
|
elseif syn1 =~ '^svgComment' && syn2 =~ '^svgComment'
|
||||||
|
" indent comments specially
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- return the sum of indents of a:lnum --]
|
||||||
|
fun! <SID>SvgIndentSum(lnum, style, add)
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
if a:style == match(line, '^\s*</')
|
||||||
|
return (&sw *
|
||||||
|
\ (<SID>SvgIndentWithPattern(line, b:svg_indent_open)
|
||||||
|
\ - <SID>SvgIndentWithPattern(line, b:svg_indent_close)
|
||||||
|
\ - <SID>SvgIndentWithPattern(line, '.\{-}/>'))) + a:add
|
||||||
|
else
|
||||||
|
return a:add
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
|
fun! SvgIndentGet(lnum, use_syntax_check)
|
||||||
|
" Find a non-empty line above the current line.
|
||||||
|
let lnum = prevnonblank(a:lnum - 1)
|
||||||
|
|
||||||
|
" Hit the start of the file, use zero indent.
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:use_syntax_check
|
||||||
|
let check_lnum = <SID>SvgIndentSynCheck(lnum)
|
||||||
|
let check_alnum = <SID>SvgIndentSynCheck(a:lnum)
|
||||||
|
if 0 == check_lnum || 0 == check_alnum
|
||||||
|
return indent(a:lnum)
|
||||||
|
elseif -1 == check_lnum || -1 == check_alnum
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let ind = <SID>SvgIndentSum(lnum, -1, indent(lnum))
|
||||||
|
let ind = <SID>SvgIndentSum(a:lnum, 0, ind)
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfun
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
@@ -3,20 +3,31 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Only load this file if no other indent file was loaded
|
" Only load this file if no other indent file was loaded
|
||||||
if exists("b:did_indent")
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions
|
||||||
|
set cpoptions&vim
|
||||||
|
|
||||||
setlocal nolisp
|
setlocal nolisp
|
||||||
setlocal autoindent sw=2 ts=2
|
setlocal autoindent shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
setlocal indentexpr=TerraformIndent(v:lnum)
|
setlocal indentexpr=TerraformIndent(v:lnum)
|
||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
let b:undo_indent = 'setlocal lisp< autoindent< shiftwidth< tabstop< softtabstop<'
|
||||||
|
\ . ' indentexpr< indentkeys<'
|
||||||
|
|
||||||
if exists("*TerraformIndent")
|
let &cpoptions = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
if exists('*TerraformIndent')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions
|
||||||
|
set cpoptions&vim
|
||||||
|
|
||||||
function! TerraformIndent(lnum)
|
function! TerraformIndent(lnum)
|
||||||
" Beginning of the file should have no indent
|
" Beginning of the file should have no indent
|
||||||
if a:lnum == 0
|
if a:lnum == 0
|
||||||
@@ -32,8 +43,8 @@ function! TerraformIndent(lnum)
|
|||||||
let thisindent = previndent
|
let thisindent = previndent
|
||||||
|
|
||||||
" Config block starting with [ { ( should increase the indent level
|
" Config block starting with [ { ( should increase the indent level
|
||||||
if prevline =~ '[\[{\(]\s*$'
|
if prevline =~# '[\[{\(]\s*$'
|
||||||
let thisindent += &sw
|
let thisindent += &shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Current line without comments should continue the indent level
|
" Current line without comments should continue the indent level
|
||||||
@@ -41,9 +52,12 @@ function! TerraformIndent(lnum)
|
|||||||
|
|
||||||
" Config block ending with ) } ] should get the indentation
|
" Config block ending with ) } ] should get the indentation
|
||||||
" level from the initial config block
|
" level from the initial config block
|
||||||
if thisline =~ '^\s*[\)}\]]'
|
if thisline =~# '^\s*[\)}\]]'
|
||||||
let thisindent -= &sw
|
let thisindent -= &shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return thisindent
|
return thisindent
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe "My Vim plugin" do
|
|||||||
|
|
||||||
extensions = extensions.split(/[\n,]/)
|
extensions = extensions.split(/[\n,]/)
|
||||||
|
|
||||||
extensions.each do |ext|
|
extensions.sort!.uniq!.each do |ext|
|
||||||
if ext.match?(/^[a-z\.]+$/i)
|
if ext.match?(/^[a-z\.]+$/i)
|
||||||
it "should parse #{ext} file" do
|
it "should parse #{ext} file" do
|
||||||
Timeout::timeout(20) do
|
Timeout::timeout(20) do
|
||||||
@@ -21,4 +21,8 @@ describe "My Vim plugin" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
after(:all) do
|
||||||
|
vim.kill
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ require 'vimrunner/rspec'
|
|||||||
$plugin_path = File.expand_path('../..', __FILE__)
|
$plugin_path = File.expand_path('../..', __FILE__)
|
||||||
|
|
||||||
Vimrunner::RSpec.configure do |config|
|
Vimrunner::RSpec.configure do |config|
|
||||||
config.reuse_server = true
|
config.reuse_server = false
|
||||||
|
|
||||||
# Decide how to start a Vim instance. In this block, an instance should be
|
# Decide how to start a Vim instance. In this block, an instance should be
|
||||||
# spawned and set up with anything project-specific.
|
# spawned and set up with anything project-specific.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ endif
|
|||||||
syn keyword dockerfileKeywords FROM AS MAINTAINER RUN CMD COPY
|
syn keyword dockerfileKeywords FROM AS MAINTAINER RUN CMD COPY
|
||||||
syn keyword dockerfileKeywords EXPOSE ADD ENTRYPOINT
|
syn keyword dockerfileKeywords EXPOSE ADD ENTRYPOINT
|
||||||
syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD
|
syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD
|
||||||
syn keyword dockerfileKeywords LABEL ARG HEALTHCHECK SHELL
|
syn keyword dockerfileKeywords LABEL ARG HEALTHCHECK SHELL STOPSIGNAL
|
||||||
|
|
||||||
" Bash statements
|
" Bash statements
|
||||||
setlocal iskeyword+=-
|
setlocal iskeyword+=-
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" c
|
|||||||
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include
|
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
|
\ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue
|
||||||
\ @unset @lang @choice @component @slot @prepend @json @isset @auth @guest @switch @case @includeFirst @empty
|
\ @unset @lang @choice @component @slot @prepend @json @isset @auth @guest @switch @case @includeFirst @empty
|
||||||
|
\ @includeWhen
|
||||||
\ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
\ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
||||||
|
|
||||||
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @endforelse @endwhile @endcan
|
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @endforelse @endwhile @endcan
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
syn keyword carpSyntax def defn let do if while ref address set! the
|
syn keyword carpSyntax def defn let do if while ref address set! the
|
||||||
syn keyword carpSyntax defmacro defdynamic quote cons list array fn
|
syn keyword carpSyntax defmacro defdynamic defndynamic quote cons list array fn
|
||||||
syn keyword carpSyntax expand deftype register system-include register-type
|
syn keyword carpSyntax expand deftype register system-include register-type
|
||||||
syn keyword carpSyntax defmodule copy use module defalias definterface eval
|
syn keyword carpSyntax defmodule copy use module defalias definterface eval
|
||||||
syn keyword carpSyntax expand instantiate type info help quit env build run
|
syn keyword carpSyntax expand instantiate type info help quit env build run
|
||||||
@@ -30,9 +30,13 @@ syn keyword carpSyntax add-cflag add-lib project load reload let-do ignore
|
|||||||
syn keyword carpSyntax fmt mac-only linux-only windows-only use-all when
|
syn keyword carpSyntax fmt mac-only linux-only windows-only use-all when
|
||||||
syn keyword carpSyntax unless defn-do comment forever-do case and* or*
|
syn keyword carpSyntax unless defn-do comment forever-do case and* or*
|
||||||
syn keyword carpSyntax str* println* break doc sig hidden private
|
syn keyword carpSyntax str* println* break doc sig hidden private
|
||||||
|
syn keyword carpSyntax while-do const-assert save-docs defproject
|
||||||
|
syn keyword carpSyntax relative-include not-on-windows load-and-use
|
||||||
|
syn keyword carpSyntax deftest
|
||||||
syn match carpSyntax "\vc(a|d){1,4}r"
|
syn match carpSyntax "\vc(a|d){1,4}r"
|
||||||
|
|
||||||
syn keyword carpFunc Int Float Double Bool String Char Array Fn Ref Long λ
|
syn keyword carpFunc Int Float Double Bool String Char Array Fn Ref Long λ
|
||||||
|
syn keyword carpFunc Maybe Map Result Set Pair
|
||||||
syn keyword carpFunc Pattern
|
syn keyword carpFunc Pattern
|
||||||
syn keyword carpFunc not or and + - * / = /= >= <= > < inc dec
|
syn keyword carpFunc not or and + - * / = /= >= <= > < inc dec
|
||||||
syn keyword carpFunc println print get-line from-string mod random
|
syn keyword carpFunc println print get-line from-string mod random
|
||||||
@@ -45,6 +49,7 @@ syn keyword carpFunc bit-shift-right bit-and bit-or bit-xor bit-not safe-add
|
|||||||
syn keyword carpFunc safe-sub safe-mul even? odd? cmp allocate repeat-indexed
|
syn keyword carpFunc safe-sub safe-mul even? odd? cmp allocate repeat-indexed
|
||||||
syn keyword carpFunc sanitize-addresses memory-balance reset-memory-balance!
|
syn keyword carpFunc sanitize-addresses memory-balance reset-memory-balance!
|
||||||
syn keyword carpFunc log-memory-balance! memory-logged assert-balanced trace
|
syn keyword carpFunc log-memory-balance! memory-logged assert-balanced trace
|
||||||
|
syn keyword carpFunc assert
|
||||||
syn keyword carpFunc pi e swap! update! char-at tail head split-by words lines
|
syn keyword carpFunc pi e swap! update! char-at tail head split-by words lines
|
||||||
syn keyword carpFunc pad-left pad-right count-char empty? random-sized substring
|
syn keyword carpFunc pad-left pad-right count-char empty? random-sized substring
|
||||||
syn keyword carpFunc prefix-string suffix-string starts-with? ends-with?
|
syn keyword carpFunc prefix-string suffix-string starts-with? ends-with?
|
||||||
@@ -54,7 +59,24 @@ syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp
|
|||||||
syn keyword carpFunc log log10 modf pow ceil clamp approx refstr foreach
|
syn keyword carpFunc log log10 modf pow ceil clamp approx refstr foreach
|
||||||
syn keyword carpFunc => ==> repeat nth replicate range raw aset aset!
|
syn keyword carpFunc => ==> repeat nth replicate range raw aset aset!
|
||||||
syn keyword carpFunc push-back pop-back sort index-of element-count
|
syn keyword carpFunc push-back pop-back sort index-of element-count
|
||||||
|
syn keyword carpFunc apply unsafe-from from just? nothing? ptr from-ptr
|
||||||
|
syn keyword carpFunc map and-then unwrap-or-zero or-else unwrap-or-else
|
||||||
|
syn keyword carpFunc unsafe-from-success from-success unsafe-from-error
|
||||||
|
syn keyword carpFunc from-error to-maybe success? error? to-result
|
||||||
|
syn keyword carpFunc create create-with-len put put! get-with-default get
|
||||||
|
syn keyword carpFunc get-maybe update update-with-default contains? remove
|
||||||
|
syn keyword carpFunc all? for-each endo-map kv-reduce vals keys from-array
|
||||||
|
syn keyword carpFunc to-array subset? union difference intersection
|
||||||
|
syn keyword carpFunc init-from-refs
|
||||||
|
syn keyword carpFunc car cdr caar cadr cdar cddr caaar caadr cadar cdaar caddr
|
||||||
|
syn keyword carpFunc cdadr cddar cdddr caaaar caaadr caaddr cadaar cadadr caddar
|
||||||
|
syn keyword carpFunc cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar
|
||||||
|
syn keyword carpFunc cddddr
|
||||||
|
syn keyword carpFunc private? hidden?
|
||||||
|
syn keyword carpFunc print-sig print-doc
|
||||||
|
syn keyword carpFunc assert-op assert-equal assert-not-equal assert-true
|
||||||
|
syn keyword carpFunc assert-false assert-exit print-test-results with-test
|
||||||
|
syn keyword carpFunc dir-from-path file-from-path
|
||||||
|
|
||||||
syn match carpSymbol ,\k+, contained
|
syn match carpSymbol ,\k+, contained
|
||||||
syn match carpTodo /\v<(FIXME|NOTE|TODO|OPTIMIZE)/ containedin=carpComment,carpString
|
syn match carpTodo /\v<(FIXME|NOTE|TODO|OPTIMIZE)/ containedin=carpComment,carpString
|
||||||
|
|||||||
183
syntax/cmake.vim
183
syntax/cmake.vim
@@ -4,14 +4,14 @@ endif
|
|||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Program: CMake - Cross-Platform Makefile Generator
|
" Program: CMake - Cross-Platform Makefile Generator
|
||||||
" Version: cmake version 3.13.20181220-g0495c
|
" Version: cmake version 3.14.20190529-g067a4f
|
||||||
" Language: CMake
|
" Language: CMake
|
||||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>,
|
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>,
|
||||||
" Nicholas Hutchinson <nshutchinson@gmail.com>,
|
" Nicholas Hutchinson <nshutchinson@gmail.com>,
|
||||||
" Patrick Boettcher <patrick.boettcher@posteo.de>
|
" Patrick Boettcher <patrick.boettcher@posteo.de>
|
||||||
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
||||||
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||||
" Last Change: 2018 Dec 20
|
" Last Change: 2019 May 29
|
||||||
"
|
"
|
||||||
" Licence: The CMake license applies to this file. See
|
" Licence: The CMake license applies to this file. See
|
||||||
" https://cmake.org/licensing
|
" https://cmake.org/licensing
|
||||||
@@ -35,16 +35,17 @@ syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contain
|
|||||||
|
|
||||||
syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped
|
syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped
|
||||||
|
|
||||||
syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo
|
syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue
|
||||||
|
|
||||||
syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo
|
syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo
|
||||||
|
|
||||||
syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo
|
syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword cmakeProperty contained
|
syn keyword cmakeProperty contained
|
||||||
\ ABSTRACT
|
\ ABSTRACT
|
||||||
|
\ ADDITIONAL_CLEAN_FILES
|
||||||
\ ADDITIONAL_MAKE_CLEAN_FILES
|
\ ADDITIONAL_MAKE_CLEAN_FILES
|
||||||
\ ADVANCED
|
\ ADVANCED
|
||||||
\ ALIASED_TARGET
|
\ ALIASED_TARGET
|
||||||
@@ -79,14 +80,17 @@ syn keyword cmakeProperty contained
|
|||||||
\ AUTOMOC
|
\ AUTOMOC
|
||||||
\ AUTOMOC_COMPILER_PREDEFINES
|
\ AUTOMOC_COMPILER_PREDEFINES
|
||||||
\ AUTOMOC_DEPEND_FILTERS
|
\ AUTOMOC_DEPEND_FILTERS
|
||||||
|
\ AUTOMOC_EXECUTABLE
|
||||||
\ AUTOMOC_MACRO_NAMES
|
\ AUTOMOC_MACRO_NAMES
|
||||||
\ AUTOMOC_MOC_OPTIONS
|
\ AUTOMOC_MOC_OPTIONS
|
||||||
\ AUTOMOC_SOURCE_GROUP
|
\ AUTOMOC_SOURCE_GROUP
|
||||||
\ AUTOMOC_TARGETS_FOLDER
|
\ AUTOMOC_TARGETS_FOLDER
|
||||||
\ AUTORCC
|
\ AUTORCC
|
||||||
|
\ AUTORCC_EXECUTABLE
|
||||||
\ AUTORCC_OPTIONS
|
\ AUTORCC_OPTIONS
|
||||||
\ AUTORCC_SOURCE_GROUP
|
\ AUTORCC_SOURCE_GROUP
|
||||||
\ AUTOUIC
|
\ AUTOUIC
|
||||||
|
\ AUTOUIC_EXECUTABLE
|
||||||
\ AUTOUIC_OPTIONS
|
\ AUTOUIC_OPTIONS
|
||||||
\ AUTOUIC_SEARCH_PATHS
|
\ AUTOUIC_SEARCH_PATHS
|
||||||
\ BINARY_DIR
|
\ BINARY_DIR
|
||||||
@@ -102,6 +106,7 @@ syn keyword cmakeProperty contained
|
|||||||
\ CMAKE_CONFIGURE_DEPENDS
|
\ CMAKE_CONFIGURE_DEPENDS
|
||||||
\ CMAKE_CXX_KNOWN_FEATURES
|
\ CMAKE_CXX_KNOWN_FEATURES
|
||||||
\ CMAKE_C_KNOWN_FEATURES
|
\ CMAKE_C_KNOWN_FEATURES
|
||||||
|
\ CMAKE_ROLE
|
||||||
\ COMMON_LANGUAGE_RUNTIME
|
\ COMMON_LANGUAGE_RUNTIME
|
||||||
\ COMPATIBLE_INTERFACE_BOOL
|
\ COMPATIBLE_INTERFACE_BOOL
|
||||||
\ COMPATIBLE_INTERFACE_NUMBER_MAX
|
\ COMPATIBLE_INTERFACE_NUMBER_MAX
|
||||||
@@ -171,6 +176,8 @@ syn keyword cmakeProperty contained
|
|||||||
\ GENERATED
|
\ GENERATED
|
||||||
\ GENERATOR_FILE_NAME
|
\ GENERATOR_FILE_NAME
|
||||||
\ GENERATOR_IS_MULTI_CONFIG
|
\ GENERATOR_IS_MULTI_CONFIG
|
||||||
|
\ GHS_INTEGRITY_APP
|
||||||
|
\ GHS_NO_SOURCE_GROUP_FILE
|
||||||
\ GLOBAL_DEPENDS_DEBUG_MODE
|
\ GLOBAL_DEPENDS_DEBUG_MODE
|
||||||
\ GLOBAL_DEPENDS_NO_CYCLES
|
\ GLOBAL_DEPENDS_NO_CYCLES
|
||||||
\ GNUtoMS
|
\ GNUtoMS
|
||||||
@@ -245,6 +252,7 @@ syn keyword cmakeProperty contained
|
|||||||
\ MANUALLY_ADDED_DEPENDENCIES
|
\ MANUALLY_ADDED_DEPENDENCIES
|
||||||
\ MEASUREMENT
|
\ MEASUREMENT
|
||||||
\ MODIFIED
|
\ MODIFIED
|
||||||
|
\ MSVC_RUNTIME_LIBRARY
|
||||||
\ NAME
|
\ NAME
|
||||||
\ NO_SONAME
|
\ NO_SONAME
|
||||||
\ NO_SYSTEM_FROM_IMPORTED
|
\ NO_SYSTEM_FROM_IMPORTED
|
||||||
@@ -294,6 +302,10 @@ syn keyword cmakeProperty contained
|
|||||||
\ SUBDIRECTORIES
|
\ SUBDIRECTORIES
|
||||||
\ SUFFIX
|
\ SUFFIX
|
||||||
\ SYMBOLIC
|
\ SYMBOLIC
|
||||||
|
\ Swift_DEPENDENCIES_FILE
|
||||||
|
\ Swift_DIAGNOSTICS_FILE
|
||||||
|
\ Swift_MODULE_DIRECTORY
|
||||||
|
\ Swift_MODULE_NAME
|
||||||
\ TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
|
\ TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
|
||||||
\ TARGET_MESSAGES
|
\ TARGET_MESSAGES
|
||||||
\ TARGET_SUPPORTS_SHARED_LIBS
|
\ TARGET_SUPPORTS_SHARED_LIBS
|
||||||
@@ -326,8 +338,11 @@ syn keyword cmakeProperty contained
|
|||||||
\ VS_INCLUDE_IN_VSIX
|
\ VS_INCLUDE_IN_VSIX
|
||||||
\ VS_IOT_EXTENSIONS_VERSION
|
\ VS_IOT_EXTENSIONS_VERSION
|
||||||
\ VS_IOT_STARTUP_TASK
|
\ VS_IOT_STARTUP_TASK
|
||||||
|
\ VS_JUST_MY_CODE_DEBUGGING
|
||||||
\ VS_KEYWORD
|
\ VS_KEYWORD
|
||||||
\ VS_MOBILE_EXTENSIONS_VERSION
|
\ VS_MOBILE_EXTENSIONS_VERSION
|
||||||
|
\ VS_NO_SOLUTION_DEPLOY
|
||||||
|
\ VS_PROJECT_IMPORT
|
||||||
\ VS_RESOURCE_GENERATOR
|
\ VS_RESOURCE_GENERATOR
|
||||||
\ VS_SCC_AUXPATH
|
\ VS_SCC_AUXPATH
|
||||||
\ VS_SCC_LOCALPATH
|
\ VS_SCC_LOCALPATH
|
||||||
@@ -359,11 +374,13 @@ syn keyword cmakeProperty contained
|
|||||||
\ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
|
\ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
|
||||||
\ XCODE_EXPLICIT_FILE_TYPE
|
\ XCODE_EXPLICIT_FILE_TYPE
|
||||||
\ XCODE_FILE_ATTRIBUTES
|
\ XCODE_FILE_ATTRIBUTES
|
||||||
|
\ XCODE_GENERATE_SCHEME
|
||||||
\ XCODE_LAST_KNOWN_FILE_TYPE
|
\ XCODE_LAST_KNOWN_FILE_TYPE
|
||||||
\ XCODE_PRODUCT_TYPE
|
\ XCODE_PRODUCT_TYPE
|
||||||
\ XCODE_SCHEME_ADDRESS_SANITIZER
|
\ XCODE_SCHEME_ADDRESS_SANITIZER
|
||||||
\ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
|
\ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
|
||||||
\ XCODE_SCHEME_ARGUMENTS
|
\ XCODE_SCHEME_ARGUMENTS
|
||||||
|
\ XCODE_SCHEME_DEBUG_AS_ROOT
|
||||||
\ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
|
\ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
|
||||||
\ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
|
\ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
|
||||||
\ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
|
\ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
|
||||||
@@ -455,10 +472,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_ASM_FLAGS_RELEASE_INIT
|
\ CMAKE_ASM_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_ASM_FLAGS_RELWITHDEBINFO
|
\ CMAKE_ASM_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_ASM_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_ASM_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_ASM_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_ASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_ASM_IGNORE_EXTENSIONS
|
\ CMAKE_ASM_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_ASM_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_ASM_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_ASM_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_ASM_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -509,10 +522,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_ASM_MASM_FLAGS_RELEASE_INIT
|
\ CMAKE_ASM_MASM_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO
|
\ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_ASM_MASM_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_ASM_MASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_ASM_MASM_IGNORE_EXTENSIONS
|
\ CMAKE_ASM_MASM_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_ASM_MASM_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_ASM_MASM_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_ASM_MASM_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_ASM_MASM_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -572,10 +581,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_ASM_NASM_FLAGS_RELEASE_INIT
|
\ CMAKE_ASM_NASM_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO
|
\ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_ASM_NASM_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_ASM_NASM_IGNORE_EXTENSIONS
|
\ CMAKE_ASM_NASM_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_ASM_NASM_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_ASM_NASM_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_ASM_NASM_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_ASM_NASM_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -687,10 +692,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_CSharp_FLAGS_RELEASE_INIT
|
\ CMAKE_CSharp_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_CSharp_FLAGS_RELWITHDEBINFO
|
\ CMAKE_CSharp_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_CSharp_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_CSharp_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_CSharp_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_CSharp_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_CSharp_IGNORE_EXTENSIONS
|
\ CMAKE_CSharp_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_CSharp_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_CSharp_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_CSharp_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_CSharp_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -752,10 +753,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_CUDA_FLAGS_RELEASE_INIT
|
\ CMAKE_CUDA_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_CUDA_FLAGS_RELWITHDEBINFO
|
\ CMAKE_CUDA_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_CUDA_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_CUDA_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_CUDA_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_CUDA_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_CUDA_HOST_COMPILER
|
\ CMAKE_CUDA_HOST_COMPILER
|
||||||
\ CMAKE_CUDA_IGNORE_EXTENSIONS
|
\ CMAKE_CUDA_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
@@ -827,10 +824,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_CXX_FLAGS_RELEASE_INIT
|
\ CMAKE_CXX_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
\ CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_CXX_IGNORE_EXTENSIONS
|
\ CMAKE_CXX_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -893,10 +886,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_C_FLAGS_RELEASE_INIT
|
\ CMAKE_C_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_C_FLAGS_RELWITHDEBINFO
|
\ CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_C_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_C_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_C_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_C_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_C_IGNORE_EXTENSIONS
|
\ CMAKE_C_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_C_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_C_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -936,10 +925,12 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_ERROR_DEPRECATED
|
\ CMAKE_ERROR_DEPRECATED
|
||||||
\ CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
|
\ CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
|
||||||
\ CMAKE_EXECUTABLE_SUFFIX
|
\ CMAKE_EXECUTABLE_SUFFIX
|
||||||
|
\ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO
|
||||||
\ CMAKE_EXE_LINKER_FLAGS
|
\ CMAKE_EXE_LINKER_FLAGS
|
||||||
\ CMAKE_EXE_LINKER_FLAGS_INIT
|
\ CMAKE_EXE_LINKER_FLAGS_INIT
|
||||||
\ CMAKE_EXPORT_COMPILE_COMMANDS
|
\ CMAKE_EXPORT_COMPILE_COMMANDS
|
||||||
\ CMAKE_EXPORT_NO_PACKAGE_REGISTRY
|
\ CMAKE_EXPORT_NO_PACKAGE_REGISTRY
|
||||||
|
\ CMAKE_EXPORT_PACKAGE_REGISTRY
|
||||||
\ CMAKE_EXTRA_GENERATOR
|
\ CMAKE_EXTRA_GENERATOR
|
||||||
\ CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
|
\ CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
|
||||||
\ CMAKE_FIND_APPBUNDLE
|
\ CMAKE_FIND_APPBUNDLE
|
||||||
@@ -951,6 +942,8 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_FIND_PACKAGE_NAME
|
\ CMAKE_FIND_PACKAGE_NAME
|
||||||
\ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
|
\ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
|
||||||
\ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
|
\ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
|
||||||
|
\ CMAKE_FIND_PACKAGE_PREFER_CONFIG
|
||||||
|
\ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
|
||||||
\ CMAKE_FIND_PACKAGE_SORT_DIRECTION
|
\ CMAKE_FIND_PACKAGE_SORT_DIRECTION
|
||||||
\ CMAKE_FIND_PACKAGE_SORT_ORDER
|
\ CMAKE_FIND_PACKAGE_SORT_ORDER
|
||||||
\ CMAKE_FIND_PACKAGE_WARN_NO_MODULE
|
\ CMAKE_FIND_PACKAGE_WARN_NO_MODULE
|
||||||
@@ -960,6 +953,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
|
\ CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
|
||||||
\ CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
|
\ CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
|
||||||
\ CMAKE_FOLDER
|
\ CMAKE_FOLDER
|
||||||
|
\ CMAKE_FRAMEWORK
|
||||||
\ CMAKE_FRAMEWORK_PATH
|
\ CMAKE_FRAMEWORK_PATH
|
||||||
\ CMAKE_Fortran
|
\ CMAKE_Fortran
|
||||||
\ CMAKE_Fortran_ANDROID_TOOLCHAIN_MACHINE
|
\ CMAKE_Fortran_ANDROID_TOOLCHAIN_MACHINE
|
||||||
@@ -999,10 +993,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_Fortran_FLAGS_RELWITHDEBINFO
|
\ CMAKE_Fortran_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_Fortran_FORMAT
|
\ CMAKE_Fortran_FORMAT
|
||||||
\ CMAKE_Fortran_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_Fortran_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_Fortran_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_Fortran_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_Fortran_IGNORE_EXTENSIONS
|
\ CMAKE_Fortran_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -1033,6 +1023,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_GENERATOR_INSTANCE
|
\ CMAKE_GENERATOR_INSTANCE
|
||||||
\ CMAKE_GENERATOR_PLATFORM
|
\ CMAKE_GENERATOR_PLATFORM
|
||||||
\ CMAKE_GENERATOR_TOOLSET
|
\ CMAKE_GENERATOR_TOOLSET
|
||||||
|
\ CMAKE_GHS_NO_SOURCE_GROUP_FILE
|
||||||
\ CMAKE_GLOBAL_AUTOGEN_TARGET
|
\ CMAKE_GLOBAL_AUTOGEN_TARGET
|
||||||
\ CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
|
\ CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
|
||||||
\ CMAKE_GLOBAL_AUTORCC_TARGET
|
\ CMAKE_GLOBAL_AUTORCC_TARGET
|
||||||
@@ -1106,10 +1097,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_Java_FLAGS_RELEASE_INIT
|
\ CMAKE_Java_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_Java_FLAGS_RELWITHDEBINFO
|
\ CMAKE_Java_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_Java_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_Java_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_Java_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_Java_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_Java_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_Java_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_Java_IGNORE_EXTENSIONS
|
\ CMAKE_Java_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_Java_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_Java_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_Java_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_Java_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -1152,6 +1139,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_MAJOR_VERSION
|
\ CMAKE_MAJOR_VERSION
|
||||||
\ CMAKE_MAKE_PROGRAM
|
\ CMAKE_MAKE_PROGRAM
|
||||||
\ CMAKE_MATCH_COUNT
|
\ CMAKE_MATCH_COUNT
|
||||||
|
\ CMAKE_MAXIMUM_RECURSION_DEPTH
|
||||||
\ CMAKE_MFC_FLAG
|
\ CMAKE_MFC_FLAG
|
||||||
\ CMAKE_MINIMUM_REQUIRED_VERSION
|
\ CMAKE_MINIMUM_REQUIRED_VERSION
|
||||||
\ CMAKE_MINOR_VERSION
|
\ CMAKE_MINOR_VERSION
|
||||||
@@ -1159,6 +1147,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_MODULE_LINKER_FLAGS_INIT
|
\ CMAKE_MODULE_LINKER_FLAGS_INIT
|
||||||
\ CMAKE_MODULE_PATH
|
\ CMAKE_MODULE_PATH
|
||||||
\ CMAKE_MSVCIDE_RUN_PATH
|
\ CMAKE_MSVCIDE_RUN_PATH
|
||||||
|
\ CMAKE_MSVC_RUNTIME_LIBRARY
|
||||||
\ CMAKE_NETRC
|
\ CMAKE_NETRC
|
||||||
\ CMAKE_NETRC_FILE
|
\ CMAKE_NETRC_FILE
|
||||||
\ CMAKE_NINJA_OUTPUT_PATH_PREFIX
|
\ CMAKE_NINJA_OUTPUT_PATH_PREFIX
|
||||||
@@ -1177,6 +1166,8 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_PROGRAM_PATH
|
\ CMAKE_PROGRAM_PATH
|
||||||
\ CMAKE_PROJECT_DESCRIPTION
|
\ CMAKE_PROJECT_DESCRIPTION
|
||||||
\ CMAKE_PROJECT_HOMEPAGE_URL
|
\ CMAKE_PROJECT_HOMEPAGE_URL
|
||||||
|
\ CMAKE_PROJECT_INCLUDE
|
||||||
|
\ CMAKE_PROJECT_INCLUDE_BEFORE
|
||||||
\ CMAKE_PROJECT_NAME
|
\ CMAKE_PROJECT_NAME
|
||||||
\ CMAKE_PROJECT_VERSION
|
\ CMAKE_PROJECT_VERSION
|
||||||
\ CMAKE_PROJECT_VERSION_MAJOR
|
\ CMAKE_PROJECT_VERSION_MAJOR
|
||||||
@@ -1221,10 +1212,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_RC_FLAGS_RELEASE_INIT
|
\ CMAKE_RC_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_RC_FLAGS_RELWITHDEBINFO
|
\ CMAKE_RC_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_RC_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_RC_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_RC_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_RC_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_RC_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_RC_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_RC_IGNORE_EXTENSIONS
|
\ CMAKE_RC_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_RC_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_RC_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_RC_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_RC_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -1323,10 +1310,6 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_Swift_FLAGS_RELEASE_INIT
|
\ CMAKE_Swift_FLAGS_RELEASE_INIT
|
||||||
\ CMAKE_Swift_FLAGS_RELWITHDEBINFO
|
\ CMAKE_Swift_FLAGS_RELWITHDEBINFO
|
||||||
\ CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT
|
\ CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT
|
||||||
\ CMAKE_Swift_GHS_KERNEL_FLAGS_DEBUG
|
|
||||||
\ CMAKE_Swift_GHS_KERNEL_FLAGS_MINSIZEREL
|
|
||||||
\ CMAKE_Swift_GHS_KERNEL_FLAGS_RELEASE
|
|
||||||
\ CMAKE_Swift_GHS_KERNEL_FLAGS_RELWITHDEBINFO
|
|
||||||
\ CMAKE_Swift_IGNORE_EXTENSIONS
|
\ CMAKE_Swift_IGNORE_EXTENSIONS
|
||||||
\ CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES
|
\ CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES
|
||||||
\ CMAKE_Swift_IMPLICIT_LINK_DIRECTORIES
|
\ CMAKE_Swift_IMPLICIT_LINK_DIRECTORIES
|
||||||
@@ -1341,6 +1324,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_Swift_LINKER_WRAPPER_FLAG
|
\ CMAKE_Swift_LINKER_WRAPPER_FLAG
|
||||||
\ CMAKE_Swift_LINKER_WRAPPER_FLAG_SEP
|
\ CMAKE_Swift_LINKER_WRAPPER_FLAG_SEP
|
||||||
\ CMAKE_Swift_LINK_EXECUTABLE
|
\ CMAKE_Swift_LINK_EXECUTABLE
|
||||||
|
\ CMAKE_Swift_MODULE_DIRECTORY
|
||||||
\ CMAKE_Swift_OUTPUT_EXTENSION
|
\ CMAKE_Swift_OUTPUT_EXTENSION
|
||||||
\ CMAKE_Swift_PLATFORM_ID
|
\ CMAKE_Swift_PLATFORM_ID
|
||||||
\ CMAKE_Swift_SIMULATE_ID
|
\ CMAKE_Swift_SIMULATE_ID
|
||||||
@@ -1376,9 +1360,11 @@ syn keyword cmakeVariable contained
|
|||||||
\ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
|
\ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
|
||||||
\ CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
|
\ CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
|
||||||
\ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
|
\ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
|
||||||
|
\ CMAKE_VS_JUST_MY_CODE_DEBUGGING
|
||||||
\ CMAKE_VS_MSBUILD_COMMAND
|
\ CMAKE_VS_MSBUILD_COMMAND
|
||||||
\ CMAKE_VS_NsightTegra_VERSION
|
\ CMAKE_VS_NsightTegra_VERSION
|
||||||
\ CMAKE_VS_PLATFORM_NAME
|
\ CMAKE_VS_PLATFORM_NAME
|
||||||
|
\ CMAKE_VS_PLATFORM_NAME_DEFAULT
|
||||||
\ CMAKE_VS_PLATFORM_TOOLSET
|
\ CMAKE_VS_PLATFORM_TOOLSET
|
||||||
\ CMAKE_VS_PLATFORM_TOOLSET_CUDA
|
\ CMAKE_VS_PLATFORM_TOOLSET_CUDA
|
||||||
\ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
|
\ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
|
||||||
@@ -1449,7 +1435,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CTEST_CUSTOM_POST_TEST
|
\ CTEST_CUSTOM_POST_TEST
|
||||||
\ CTEST_CUSTOM_PRE_MEMCHECK
|
\ CTEST_CUSTOM_PRE_MEMCHECK
|
||||||
\ CTEST_CUSTOM_PRE_TEST
|
\ CTEST_CUSTOM_PRE_TEST
|
||||||
\ CTEST_CUSTOM_TEST_IGNORE
|
\ CTEST_CUSTOM_TESTS_IGNORE
|
||||||
\ CTEST_CUSTOM_WARNING_EXCEPTION
|
\ CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
\ CTEST_CUSTOM_WARNING_MATCH
|
\ CTEST_CUSTOM_WARNING_MATCH
|
||||||
\ CTEST_CVS_CHECKOUT
|
\ CTEST_CVS_CHECKOUT
|
||||||
@@ -1483,6 +1469,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ CTEST_SCP_COMMAND
|
\ CTEST_SCP_COMMAND
|
||||||
\ CTEST_SITE
|
\ CTEST_SITE
|
||||||
\ CTEST_SOURCE_DIRECTORY
|
\ CTEST_SOURCE_DIRECTORY
|
||||||
|
\ CTEST_SUBMIT_URL
|
||||||
\ CTEST_SVN_COMMAND
|
\ CTEST_SVN_COMMAND
|
||||||
\ CTEST_SVN_OPTIONS
|
\ CTEST_SVN_OPTIONS
|
||||||
\ CTEST_SVN_UPDATE_OPTIONS
|
\ CTEST_SVN_UPDATE_OPTIONS
|
||||||
@@ -1492,11 +1479,13 @@ syn keyword cmakeVariable contained
|
|||||||
\ CTEST_UPDATE_COMMAND
|
\ CTEST_UPDATE_COMMAND
|
||||||
\ CTEST_UPDATE_OPTIONS
|
\ CTEST_UPDATE_OPTIONS
|
||||||
\ CTEST_UPDATE_VERSION_ONLY
|
\ CTEST_UPDATE_VERSION_ONLY
|
||||||
|
\ CTEST_UPDATE_VERSION_OVERRIDE
|
||||||
\ CTEST_USE_LAUNCHERS
|
\ CTEST_USE_LAUNCHERS
|
||||||
\ CYGWIN
|
\ CYGWIN
|
||||||
\ ENV
|
\ ENV
|
||||||
\ EXECUTABLE_OUTPUT_PATH
|
\ EXECUTABLE_OUTPUT_PATH
|
||||||
\ GHS-MULTI
|
\ GHS-MULTI
|
||||||
|
\ IOS
|
||||||
\ LIBRARY_OUTPUT_PATH
|
\ LIBRARY_OUTPUT_PATH
|
||||||
\ MINGW
|
\ MINGW
|
||||||
\ MSVC
|
\ MSVC
|
||||||
@@ -1512,6 +1501,7 @@ syn keyword cmakeVariable contained
|
|||||||
\ MSVC_IDE
|
\ MSVC_IDE
|
||||||
\ MSVC_TOOLSET_VERSION
|
\ MSVC_TOOLSET_VERSION
|
||||||
\ MSVC_VERSION
|
\ MSVC_VERSION
|
||||||
|
\ MSYS
|
||||||
\ PROJECT_BINARY_DIR
|
\ PROJECT_BINARY_DIR
|
||||||
\ PROJECT_DESCRIPTION
|
\ PROJECT_DESCRIPTION
|
||||||
\ PROJECT_HOMEPAGE_URL
|
\ PROJECT_HOMEPAGE_URL
|
||||||
@@ -1568,6 +1558,7 @@ syn keyword cmakeKWExternalProject contained
|
|||||||
\ EP_UPDATE_DISCONNECTED
|
\ EP_UPDATE_DISCONNECTED
|
||||||
\ EXCLUDE_FROM_ALL
|
\ EXCLUDE_FROM_ALL
|
||||||
\ FORCE
|
\ FORCE
|
||||||
|
\ GHS
|
||||||
\ GIT_CONFIG
|
\ GIT_CONFIG
|
||||||
\ GIT_PROGRESS
|
\ GIT_PROGRESS
|
||||||
\ GIT_REMOTE_NAME
|
\ GIT_REMOTE_NAME
|
||||||
@@ -1592,10 +1583,12 @@ syn keyword cmakeKWExternalProject contained
|
|||||||
\ LOG_DOWNLOAD
|
\ LOG_DOWNLOAD
|
||||||
\ LOG_INSTALL
|
\ LOG_INSTALL
|
||||||
\ LOG_MERGED_STDOUTERR
|
\ LOG_MERGED_STDOUTERR
|
||||||
|
\ LOG_OUTPUT_ON_FAILURE
|
||||||
\ LOG_PATCH
|
\ LOG_PATCH
|
||||||
\ LOG_TEST
|
\ LOG_TEST
|
||||||
\ LOG_UPDATE
|
\ LOG_UPDATE
|
||||||
\ MAKE_EXE
|
\ MAKE_EXE
|
||||||
|
\ MULTI
|
||||||
\ NAMES
|
\ NAMES
|
||||||
\ NETRC
|
\ NETRC
|
||||||
\ NETRC_FILE
|
\ NETRC_FILE
|
||||||
@@ -1645,6 +1638,7 @@ syn keyword cmakeKWadd_compile_options contained
|
|||||||
\ COMPILE_OPTIONS
|
\ COMPILE_OPTIONS
|
||||||
\ SHELL
|
\ SHELL
|
||||||
\ UNIX_COMMAND
|
\ UNIX_COMMAND
|
||||||
|
\ WX
|
||||||
|
|
||||||
syn keyword cmakeKWadd_custom_command contained
|
syn keyword cmakeKWadd_custom_command contained
|
||||||
\ APPEND
|
\ APPEND
|
||||||
@@ -1660,6 +1654,8 @@ syn keyword cmakeKWadd_custom_command contained
|
|||||||
\ GENERATED
|
\ GENERATED
|
||||||
\ IMPLICIT_DEPENDS
|
\ IMPLICIT_DEPENDS
|
||||||
\ INCLUDE_DIRECTORIES
|
\ INCLUDE_DIRECTORIES
|
||||||
|
\ JOB_POOL
|
||||||
|
\ JOB_POOLS
|
||||||
\ JOIN
|
\ JOIN
|
||||||
\ MAIN_DEPENDENCY
|
\ MAIN_DEPENDENCY
|
||||||
\ NOT
|
\ NOT
|
||||||
@@ -1685,6 +1681,8 @@ syn keyword cmakeKWadd_custom_target contained
|
|||||||
\ DEPENDS
|
\ DEPENDS
|
||||||
\ GENERATED
|
\ GENERATED
|
||||||
\ INCLUDE_DIRECTORIES
|
\ INCLUDE_DIRECTORIES
|
||||||
|
\ JOB_POOL
|
||||||
|
\ JOB_POOLS
|
||||||
\ JOIN
|
\ JOIN
|
||||||
\ SOURCES
|
\ SOURCES
|
||||||
\ TARGET_PROPERTY
|
\ TARGET_PROPERTY
|
||||||
@@ -1740,6 +1738,7 @@ syn keyword cmakeKWadd_library contained
|
|||||||
\ POST_BUILD
|
\ POST_BUILD
|
||||||
\ PRE_BUILD
|
\ PRE_BUILD
|
||||||
\ PRE_LINK
|
\ PRE_LINK
|
||||||
|
\ PUBLIC_HEADER
|
||||||
\ RUNTIME_OUTPUT_DIRECTORY
|
\ RUNTIME_OUTPUT_DIRECTORY
|
||||||
\ SHARED
|
\ SHARED
|
||||||
\ STATIC
|
\ STATIC
|
||||||
@@ -1754,6 +1753,7 @@ syn keyword cmakeKWadd_link_options contained
|
|||||||
\ LINKER
|
\ LINKER
|
||||||
\ LINK_OPTIONS
|
\ LINK_OPTIONS
|
||||||
\ SHELL
|
\ SHELL
|
||||||
|
\ STATIC_LIBRARY_OPTIONS
|
||||||
\ UNIX_COMMAND
|
\ UNIX_COMMAND
|
||||||
\ _LINKER_WRAPPER_FLAG
|
\ _LINKER_WRAPPER_FLAG
|
||||||
\ _LINKER_WRAPPER_FLAG_SEP
|
\ _LINKER_WRAPPER_FLAG_SEP
|
||||||
@@ -1767,6 +1767,7 @@ syn keyword cmakeKWadd_test contained
|
|||||||
\ CONFIGURATIONS
|
\ CONFIGURATIONS
|
||||||
\ FAIL_REGULAR_EXPRESSION
|
\ FAIL_REGULAR_EXPRESSION
|
||||||
\ NAME
|
\ NAME
|
||||||
|
\ OFF
|
||||||
\ PASS_REGULAR_EXPRESSION
|
\ PASS_REGULAR_EXPRESSION
|
||||||
\ TARGET_FILE
|
\ TARGET_FILE
|
||||||
\ WILL_FAIL
|
\ WILL_FAIL
|
||||||
@@ -1818,6 +1819,7 @@ syn keyword cmakeKWcmake_parse_arguments contained
|
|||||||
\ MY_INSTALL_CONFIGURATIONS
|
\ MY_INSTALL_CONFIGURATIONS
|
||||||
\ MY_INSTALL_DESTINATION
|
\ MY_INSTALL_DESTINATION
|
||||||
\ MY_INSTALL_FAST
|
\ MY_INSTALL_FAST
|
||||||
|
\ MY_INSTALL_KEYWORDS_MISSING_VALUES
|
||||||
\ MY_INSTALL_OPTIONAL
|
\ MY_INSTALL_OPTIONAL
|
||||||
\ MY_INSTALL_RENAME
|
\ MY_INSTALL_RENAME
|
||||||
\ MY_INSTALL_TARGETS
|
\ MY_INSTALL_TARGETS
|
||||||
@@ -1828,6 +1830,7 @@ syn keyword cmakeKWcmake_parse_arguments contained
|
|||||||
\ TARGETS
|
\ TARGETS
|
||||||
\ TRUE
|
\ TRUE
|
||||||
\ UNDEFINED
|
\ UNDEFINED
|
||||||
|
\ _KEYWORDS_MISSING_VALUES
|
||||||
\ _UNPARSED_ARGUMENTS
|
\ _UNPARSED_ARGUMENTS
|
||||||
|
|
||||||
syn keyword cmakeKWcmake_policy contained
|
syn keyword cmakeKWcmake_policy contained
|
||||||
@@ -1926,6 +1929,7 @@ syn keyword cmakeKWctest_start contained
|
|||||||
|
|
||||||
syn keyword cmakeKWctest_submit contained
|
syn keyword cmakeKWctest_submit contained
|
||||||
\ API
|
\ API
|
||||||
|
\ BUILD_ID
|
||||||
\ CAPTURE_CMAKE_ERROR
|
\ CAPTURE_CMAKE_ERROR
|
||||||
\ CDASH_UPLOAD
|
\ CDASH_UPLOAD
|
||||||
\ CDASH_UPLOAD_TYPE
|
\ CDASH_UPLOAD_TYPE
|
||||||
@@ -1938,6 +1942,7 @@ syn keyword cmakeKWctest_submit contained
|
|||||||
\ RETRY_COUNT
|
\ RETRY_COUNT
|
||||||
\ RETRY_DELAY
|
\ RETRY_DELAY
|
||||||
\ RETURN_VALUE
|
\ RETURN_VALUE
|
||||||
|
\ SUBMIT_URL
|
||||||
|
|
||||||
syn keyword cmakeKWctest_test contained
|
syn keyword cmakeKWctest_test contained
|
||||||
\ APPEND
|
\ APPEND
|
||||||
@@ -1993,6 +1998,9 @@ syn keyword cmakeKWenable_language contained
|
|||||||
\ CUDA
|
\ CUDA
|
||||||
\ OPTIONAL
|
\ OPTIONAL
|
||||||
|
|
||||||
|
syn keyword cmakeKWenable_testing contained
|
||||||
|
\ BUILD_TESTING
|
||||||
|
|
||||||
syn keyword cmakeKWexec_program contained
|
syn keyword cmakeKWexec_program contained
|
||||||
\ ARGS
|
\ ARGS
|
||||||
\ OUTPUT_VARIABLE
|
\ OUTPUT_VARIABLE
|
||||||
@@ -2002,6 +2010,7 @@ syn keyword cmakeKWexecute_process contained
|
|||||||
\ ANSI
|
\ ANSI
|
||||||
\ AUTO
|
\ AUTO
|
||||||
\ COMMAND
|
\ COMMAND
|
||||||
|
\ COMMAND_ECHO
|
||||||
\ ENCODING
|
\ ENCODING
|
||||||
\ ERROR_FILE
|
\ ERROR_FILE
|
||||||
\ ERROR_QUIET
|
\ ERROR_QUIET
|
||||||
@@ -2017,6 +2026,8 @@ syn keyword cmakeKWexecute_process contained
|
|||||||
\ RESULTS_VARIABLE
|
\ RESULTS_VARIABLE
|
||||||
\ RESULT_VARIABLE
|
\ RESULT_VARIABLE
|
||||||
\ RFC
|
\ RFC
|
||||||
|
\ STDERR
|
||||||
|
\ STDOUT
|
||||||
\ TIMEOUT
|
\ TIMEOUT
|
||||||
\ UTF
|
\ UTF
|
||||||
\ VERBATIM
|
\ VERBATIM
|
||||||
@@ -2055,6 +2066,8 @@ syn keyword cmakeKWfile contained
|
|||||||
\ CONFIGURE_DEPENDS
|
\ CONFIGURE_DEPENDS
|
||||||
\ CONTENT
|
\ CONTENT
|
||||||
\ COPY
|
\ COPY
|
||||||
|
\ COPY_ON_ERROR
|
||||||
|
\ CREATE_LINK
|
||||||
\ DESTINATION
|
\ DESTINATION
|
||||||
\ DIRECTORY_PERMISSIONS
|
\ DIRECTORY_PERMISSIONS
|
||||||
\ DOWNLOAD
|
\ DOWNLOAD
|
||||||
@@ -2064,6 +2077,7 @@ syn keyword cmakeKWfile contained
|
|||||||
\ FILES_MATCHING
|
\ FILES_MATCHING
|
||||||
\ FILE_PERMISSIONS
|
\ FILE_PERMISSIONS
|
||||||
\ FOLLOW_SYMLINKS
|
\ FOLLOW_SYMLINKS
|
||||||
|
\ FOLLOW_SYMLINK_CHAIN
|
||||||
\ FUNCTION
|
\ FUNCTION
|
||||||
\ GENERATE
|
\ GENERATE
|
||||||
\ GLOB
|
\ GLOB
|
||||||
@@ -2108,12 +2122,14 @@ syn keyword cmakeKWfile contained
|
|||||||
\ REMOVE_RECURSE
|
\ REMOVE_RECURSE
|
||||||
\ RENAME
|
\ RENAME
|
||||||
\ REQUIRED
|
\ REQUIRED
|
||||||
|
\ RESULT
|
||||||
\ RESULT_VARIABLE
|
\ RESULT_VARIABLE
|
||||||
\ SHOW_PROGRESS
|
\ SHOW_PROGRESS
|
||||||
\ SIZE
|
\ SIZE
|
||||||
\ SSL
|
\ SSL
|
||||||
\ STATUS
|
\ STATUS
|
||||||
\ STRINGS
|
\ STRINGS
|
||||||
|
\ SYMBOLIC
|
||||||
\ TIMESTAMP
|
\ TIMESTAMP
|
||||||
\ TLS_CAINFO
|
\ TLS_CAINFO
|
||||||
\ TLS_VERIFY
|
\ TLS_VERIFY
|
||||||
@@ -2170,6 +2186,7 @@ syn keyword cmakeKWfind_library contained
|
|||||||
|
|
||||||
syn keyword cmakeKWfind_package contained
|
syn keyword cmakeKWfind_package contained
|
||||||
\ ABI
|
\ ABI
|
||||||
|
\ BUNDLE
|
||||||
\ CMAKE_DISABLE_FIND_PACKAGE_
|
\ CMAKE_DISABLE_FIND_PACKAGE_
|
||||||
\ CMAKE_FIND_ROOT_PATH_BOTH
|
\ CMAKE_FIND_ROOT_PATH_BOTH
|
||||||
\ COMPONENTS
|
\ COMPONENTS
|
||||||
@@ -2178,6 +2195,7 @@ syn keyword cmakeKWfind_package contained
|
|||||||
\ DEC
|
\ DEC
|
||||||
\ DVAR
|
\ DVAR
|
||||||
\ EXACT
|
\ EXACT
|
||||||
|
\ FRAMEWORK
|
||||||
\ HINTS
|
\ HINTS
|
||||||
\ MODULE
|
\ MODULE
|
||||||
\ NAMES
|
\ NAMES
|
||||||
@@ -2295,8 +2313,10 @@ syn keyword cmakeKWget_filename_component contained
|
|||||||
\ BASE_DIR
|
\ BASE_DIR
|
||||||
\ DIRECTORY
|
\ DIRECTORY
|
||||||
\ EXT
|
\ EXT
|
||||||
|
\ LAST_EXT
|
||||||
\ NAME
|
\ NAME
|
||||||
\ NAME_WE
|
\ NAME_WE
|
||||||
|
\ NAME_WLE
|
||||||
\ PATH
|
\ PATH
|
||||||
\ PROGRAM
|
\ PROGRAM
|
||||||
\ PROGRAM_ARGS
|
\ PROGRAM_ARGS
|
||||||
@@ -2432,6 +2452,7 @@ syn keyword cmakeKWinstall contained
|
|||||||
\ EXPORT
|
\ EXPORT
|
||||||
\ EXPORT_ANDROID_MK
|
\ EXPORT_ANDROID_MK
|
||||||
\ EXPORT_LINK_INTERFACE_LIBRARIES
|
\ EXPORT_LINK_INTERFACE_LIBRARIES
|
||||||
|
\ EXPORT_NAME
|
||||||
\ FILES
|
\ FILES
|
||||||
\ FILES_MATCHING
|
\ FILES_MATCHING
|
||||||
\ FILE_PERMISSIONS
|
\ FILE_PERMISSIONS
|
||||||
@@ -2466,6 +2487,7 @@ syn keyword cmakeKWinstall contained
|
|||||||
\ PRE_INSTALL_SCRIPT
|
\ PRE_INSTALL_SCRIPT
|
||||||
\ PRIVATE_HEADER
|
\ PRIVATE_HEADER
|
||||||
\ PROGRAMS
|
\ PROGRAMS
|
||||||
|
\ PROPERTIES
|
||||||
\ PUBLIC_HEADER
|
\ PUBLIC_HEADER
|
||||||
\ REGEX
|
\ REGEX
|
||||||
\ RENAME
|
\ RENAME
|
||||||
@@ -2479,6 +2501,7 @@ syn keyword cmakeKWinstall contained
|
|||||||
\ SETUID
|
\ SETUID
|
||||||
\ SHAREDSTATE
|
\ SHAREDSTATE
|
||||||
\ SOVERSION
|
\ SOVERSION
|
||||||
|
\ STATIC
|
||||||
\ SYSCONF
|
\ SYSCONF
|
||||||
\ TARGETS
|
\ TARGETS
|
||||||
\ TRUE
|
\ TRUE
|
||||||
@@ -2533,6 +2556,8 @@ syn keyword cmakeKWlist contained
|
|||||||
\ ORDER
|
\ ORDER
|
||||||
\ OUTPUT_VARIABLE
|
\ OUTPUT_VARIABLE
|
||||||
\ PARENT_SCOPE
|
\ PARENT_SCOPE
|
||||||
|
\ POP_BACK
|
||||||
|
\ POP_FRONT
|
||||||
\ PREPEND
|
\ PREPEND
|
||||||
\ REGEX
|
\ REGEX
|
||||||
\ REMOVE_AT
|
\ REMOVE_AT
|
||||||
@@ -2580,11 +2605,15 @@ syn keyword cmakeKWmath contained
|
|||||||
|
|
||||||
syn keyword cmakeKWmessage contained
|
syn keyword cmakeKWmessage contained
|
||||||
\ AUTHOR_WARNING
|
\ AUTHOR_WARNING
|
||||||
|
\ DEBUG
|
||||||
\ DEPRECATION
|
\ DEPRECATION
|
||||||
\ FATAL_ERROR
|
\ FATAL_ERROR
|
||||||
\ GUI
|
\ GUI
|
||||||
|
\ NOTICE
|
||||||
\ SEND_ERROR
|
\ SEND_ERROR
|
||||||
\ STATUS
|
\ STATUS
|
||||||
|
\ TRACE
|
||||||
|
\ VERBOSE
|
||||||
\ WARNING
|
\ WARNING
|
||||||
|
|
||||||
syn keyword cmakeKWoption contained
|
syn keyword cmakeKWoption contained
|
||||||
@@ -2613,6 +2642,12 @@ syn keyword cmakeKWproject contained
|
|||||||
\ _VERSION_PATCH
|
\ _VERSION_PATCH
|
||||||
\ _VERSION_TWEAK
|
\ _VERSION_TWEAK
|
||||||
|
|
||||||
|
syn keyword cmakeKWqt_wrap_cpp contained
|
||||||
|
\ AUTOMOC
|
||||||
|
|
||||||
|
syn keyword cmakeKWqt_wrap_ui contained
|
||||||
|
\ AUTOUIC
|
||||||
|
|
||||||
syn keyword cmakeKWremove contained
|
syn keyword cmakeKWremove contained
|
||||||
\ VALUE
|
\ VALUE
|
||||||
\ VAR
|
\ VAR
|
||||||
@@ -2635,6 +2670,7 @@ syn keyword cmakeKWset contained
|
|||||||
\ STRINGS
|
\ STRINGS
|
||||||
|
|
||||||
syn keyword cmakeKWset_directory_properties contained
|
syn keyword cmakeKWset_directory_properties contained
|
||||||
|
\ DIRECTORY
|
||||||
\ PROPERTIES
|
\ PROPERTIES
|
||||||
|
|
||||||
syn keyword cmakeKWset_property contained
|
syn keyword cmakeKWset_property contained
|
||||||
@@ -2652,6 +2688,7 @@ syn keyword cmakeKWset_property contained
|
|||||||
|
|
||||||
syn keyword cmakeKWset_source_files_properties contained
|
syn keyword cmakeKWset_source_files_properties contained
|
||||||
\ PROPERTIES
|
\ PROPERTIES
|
||||||
|
\ SOURCE
|
||||||
|
|
||||||
syn keyword cmakeKWset_target_properties contained
|
syn keyword cmakeKWset_target_properties contained
|
||||||
\ PROPERTIES
|
\ PROPERTIES
|
||||||
@@ -2659,6 +2696,7 @@ syn keyword cmakeKWset_target_properties contained
|
|||||||
|
|
||||||
syn keyword cmakeKWset_tests_properties contained
|
syn keyword cmakeKWset_tests_properties contained
|
||||||
\ PROPERTIES
|
\ PROPERTIES
|
||||||
|
\ TEST
|
||||||
|
|
||||||
syn keyword cmakeKWsource_group contained
|
syn keyword cmakeKWsource_group contained
|
||||||
\ FILES
|
\ FILES
|
||||||
@@ -2697,6 +2735,7 @@ syn keyword cmakeKWstring contained
|
|||||||
\ RANDOM
|
\ RANDOM
|
||||||
\ RANDOM_SEED
|
\ RANDOM_SEED
|
||||||
\ REGEX
|
\ REGEX
|
||||||
|
\ REPEAT
|
||||||
\ REPLACE
|
\ REPLACE
|
||||||
\ REVERSE
|
\ REVERSE
|
||||||
\ RFC
|
\ RFC
|
||||||
@@ -2793,7 +2832,6 @@ syn keyword cmakeKWtarget_link_libraries contained
|
|||||||
\ LINK_PUBLIC
|
\ LINK_PUBLIC
|
||||||
\ OBJECT
|
\ OBJECT
|
||||||
\ OLD
|
\ OLD
|
||||||
\ OSX
|
|
||||||
\ PRIVATE
|
\ PRIVATE
|
||||||
\ PUBLIC
|
\ PUBLIC
|
||||||
\ SHARED
|
\ SHARED
|
||||||
@@ -2814,6 +2852,7 @@ syn keyword cmakeKWtarget_link_options contained
|
|||||||
\ PRIVATE
|
\ PRIVATE
|
||||||
\ PUBLIC
|
\ PUBLIC
|
||||||
\ SHELL
|
\ SHELL
|
||||||
|
\ STATIC_LIBRARY_OPTIONS
|
||||||
\ UNIX_COMMAND
|
\ UNIX_COMMAND
|
||||||
\ _LINKER_WRAPPER_FLAG
|
\ _LINKER_WRAPPER_FLAG
|
||||||
\ _LINKER_WRAPPER_FLAG_SEP
|
\ _LINKER_WRAPPER_FLAG_SEP
|
||||||
@@ -2845,17 +2884,20 @@ syn keyword cmakeKWtry_compile contained
|
|||||||
\ DEFINED
|
\ DEFINED
|
||||||
\ DLINK_LIBRARIES
|
\ DLINK_LIBRARIES
|
||||||
\ DVAR
|
\ DVAR
|
||||||
|
\ EXECUTABLE
|
||||||
\ FALSE
|
\ FALSE
|
||||||
|
\ GHS
|
||||||
\ INCLUDE_DIRECTORIES
|
\ INCLUDE_DIRECTORIES
|
||||||
\ LANG
|
\ LANG
|
||||||
\ LINK_DIRECTORIES
|
\ LINK_DIRECTORIES
|
||||||
\ LINK_LIBRARIES
|
\ LINK_LIBRARIES
|
||||||
\ LINK_OPTIONS
|
\ LINK_OPTIONS
|
||||||
|
\ MULTI
|
||||||
\ NOT
|
\ NOT
|
||||||
\ OUTPUT_VARIABLE
|
\ OUTPUT_VARIABLE
|
||||||
\ PRIVATE
|
\ PRIVATE
|
||||||
\ RESULT_VAR
|
|
||||||
\ SOURCES
|
\ SOURCES
|
||||||
|
\ STATIC_LIBRARY
|
||||||
\ STATIC_LIBRARY_OPTIONS
|
\ STATIC_LIBRARY_OPTIONS
|
||||||
\ TRUE
|
\ TRUE
|
||||||
\ TYPE
|
\ TYPE
|
||||||
@@ -2869,7 +2911,6 @@ syn keyword cmakeKWtry_run contained
|
|||||||
\ CMAKE_FLAGS
|
\ CMAKE_FLAGS
|
||||||
\ COMPILE_DEFINITIONS
|
\ COMPILE_DEFINITIONS
|
||||||
\ COMPILE_OUTPUT_VARIABLE
|
\ COMPILE_OUTPUT_VARIABLE
|
||||||
\ COMPILE_RESULT_VAR
|
|
||||||
\ DLINK_LIBRARIES
|
\ DLINK_LIBRARIES
|
||||||
\ DVAR
|
\ DVAR
|
||||||
\ FAILED_TO_RUN
|
\ FAILED_TO_RUN
|
||||||
@@ -2879,7 +2920,6 @@ syn keyword cmakeKWtry_run contained
|
|||||||
\ LINK_LIBRARIES
|
\ LINK_LIBRARIES
|
||||||
\ LINK_OPTIONS
|
\ LINK_OPTIONS
|
||||||
\ RUN_OUTPUT_VARIABLE
|
\ RUN_OUTPUT_VARIABLE
|
||||||
\ RUN_RESULT_VAR
|
|
||||||
\ TRUE
|
\ TRUE
|
||||||
\ TYPE
|
\ TYPE
|
||||||
\ VALUE
|
\ VALUE
|
||||||
@@ -2911,6 +2951,8 @@ syn keyword cmakeKWwrite_file contained
|
|||||||
syn keyword cmakeGeneratorExpressions contained
|
syn keyword cmakeGeneratorExpressions contained
|
||||||
\ AND
|
\ AND
|
||||||
\ ANGLE
|
\ ANGLE
|
||||||
|
\ ARCHIVE_OUTPUT_NAME
|
||||||
|
\ ARCHIVE_OUTPUT_NAME_
|
||||||
\ BAR
|
\ BAR
|
||||||
\ BOOL
|
\ BOOL
|
||||||
\ BUILD_INTERFACE
|
\ BUILD_INTERFACE
|
||||||
@@ -2920,11 +2962,15 @@ syn keyword cmakeGeneratorExpressions contained
|
|||||||
\ COMPILE_DEFINITIONS
|
\ COMPILE_DEFINITIONS
|
||||||
\ COMPILE_FEATURES
|
\ COMPILE_FEATURES
|
||||||
\ COMPILE_LANGUAGE
|
\ COMPILE_LANGUAGE
|
||||||
|
\ COMPILE_LANG_AND_ID
|
||||||
\ COMPILING_CUDA
|
\ COMPILING_CUDA
|
||||||
\ COMPILING_CXX
|
\ COMPILING_CXX_WITH_CLANG
|
||||||
|
\ COMPILING_CXX_WITH_INTEL
|
||||||
|
\ COMPILING_C_WITH_CLANG
|
||||||
\ CONFIG
|
\ CONFIG
|
||||||
\ CONFIGURATION
|
\ CONFIGURATION
|
||||||
\ CUDA
|
\ CUDA_COMPILER_ID
|
||||||
|
\ CUDA_COMPILER_VERSION
|
||||||
\ CUSTOM_KEYS
|
\ CUSTOM_KEYS
|
||||||
\ CXX_COMPILER_ID
|
\ CXX_COMPILER_ID
|
||||||
\ CXX_COMPILER_VERSION
|
\ CXX_COMPILER_VERSION
|
||||||
@@ -2933,14 +2979,19 @@ syn keyword cmakeGeneratorExpressions contained
|
|||||||
\ C_COMPILER_VERSION
|
\ C_COMPILER_VERSION
|
||||||
\ C_STANDARD
|
\ C_STANDARD
|
||||||
\ DEBUG_MODE
|
\ DEBUG_MODE
|
||||||
|
\ DEBUG_POSTFIX
|
||||||
|
\ EXCLUDE
|
||||||
\ EXPORT
|
\ EXPORT
|
||||||
\ FALSE
|
\ FALSE
|
||||||
|
\ FILTER
|
||||||
\ FOO_EXTRA_THINGS
|
\ FOO_EXTRA_THINGS
|
||||||
\ GENERATE
|
\ GENERATE
|
||||||
\ GENEX_EVAL
|
\ GENEX_EVAL
|
||||||
\ GNU
|
\ GNU
|
||||||
\ IF
|
\ IF
|
||||||
\ IGNORE
|
\ IGNORE
|
||||||
|
\ IMPORT_PREFIX
|
||||||
|
\ IMPORT_SUFFIX
|
||||||
\ INCLUDE_DIRECTORIES
|
\ INCLUDE_DIRECTORIES
|
||||||
\ INSTALL_INTERFACE
|
\ INSTALL_INTERFACE
|
||||||
\ INSTALL_PREFIX
|
\ INSTALL_PREFIX
|
||||||
@@ -2948,24 +2999,31 @@ syn keyword cmakeGeneratorExpressions contained
|
|||||||
\ IN_LIST
|
\ IN_LIST
|
||||||
\ JOIN
|
\ JOIN
|
||||||
\ LANG
|
\ LANG
|
||||||
|
\ LANG_COMPILER_ID
|
||||||
|
\ LIBRARY_OUTPUT_NAME
|
||||||
|
\ LIBRARY_OUTPUT_NAME_
|
||||||
\ LINK_LIBRARIES
|
\ LINK_LIBRARIES
|
||||||
\ LINK_ONLY
|
\ LINK_ONLY
|
||||||
\ LOWER_CASE
|
\ LOWER_CASE
|
||||||
\ MAKE_C_IDENTIFIER
|
\ MAKE_C_IDENTIFIER
|
||||||
\ MAP_IMPORTED_CONFIG_
|
\ MAP_IMPORTED_CONFIG_
|
||||||
\ MSYS
|
|
||||||
\ NO
|
\ NO
|
||||||
\ NOT
|
\ NOT
|
||||||
\ OBJECT_LIBRARY
|
|
||||||
\ OFF
|
\ OFF
|
||||||
\ OLD_COMPILER
|
\ OLD_COMPILER
|
||||||
|
\ OUTPUT_NAME
|
||||||
|
\ OUTPUT_NAME_
|
||||||
\ PDB_NAME
|
\ PDB_NAME
|
||||||
\ PDB_NAME_
|
\ PDB_NAME_
|
||||||
\ PDB_OUTPUT_DIRECTORY
|
\ PDB_OUTPUT_DIRECTORY
|
||||||
\ PDB_OUTPUT_DIRECTORY_
|
\ PDB_OUTPUT_DIRECTORY_
|
||||||
\ PLATFORM_ID
|
\ PLATFORM_ID
|
||||||
|
\ POSIX
|
||||||
\ PRIVATE
|
\ PRIVATE
|
||||||
\ PUBLIC
|
\ PUBLIC
|
||||||
|
\ REMOVE_DUPLICATES
|
||||||
|
\ RUNTIME_OUTPUT_NAME
|
||||||
|
\ RUNTIME_OUTPUT_NAME_
|
||||||
\ SDK
|
\ SDK
|
||||||
\ SEMICOLON
|
\ SEMICOLON
|
||||||
\ SHELL_PATH
|
\ SHELL_PATH
|
||||||
@@ -2974,15 +3032,22 @@ syn keyword cmakeGeneratorExpressions contained
|
|||||||
\ TARGET_BUNDLE_DIR
|
\ TARGET_BUNDLE_DIR
|
||||||
\ TARGET_EXISTS
|
\ TARGET_EXISTS
|
||||||
\ TARGET_FILE
|
\ TARGET_FILE
|
||||||
|
\ TARGET_FILE_BASE_NAME
|
||||||
\ TARGET_FILE_DIR
|
\ TARGET_FILE_DIR
|
||||||
\ TARGET_FILE_NAME
|
\ TARGET_FILE_NAME
|
||||||
|
\ TARGET_FILE_PREFIX
|
||||||
|
\ TARGET_FILE_SUFFIX
|
||||||
\ TARGET_GENEX_EVAL
|
\ TARGET_GENEX_EVAL
|
||||||
\ TARGET_LINKER_FILE
|
\ TARGET_LINKER_FILE
|
||||||
|
\ TARGET_LINKER_FILE_BASE_NAME
|
||||||
\ TARGET_LINKER_FILE_DIR
|
\ TARGET_LINKER_FILE_DIR
|
||||||
\ TARGET_LINKER_FILE_NAME
|
\ TARGET_LINKER_FILE_NAME
|
||||||
|
\ TARGET_LINKER_FILE_PREFIX
|
||||||
|
\ TARGET_LINKER_FILE_SUFFIX
|
||||||
\ TARGET_NAME_IF_EXISTS
|
\ TARGET_NAME_IF_EXISTS
|
||||||
\ TARGET_OBJECTS
|
\ TARGET_OBJECTS
|
||||||
\ TARGET_PDB_FILE
|
\ TARGET_PDB_FILE
|
||||||
|
\ TARGET_PDB_FILE_BASE_NAME
|
||||||
\ TARGET_PDB_FILE_DIR
|
\ TARGET_PDB_FILE_DIR
|
||||||
\ TARGET_PDB_FILE_NAME
|
\ TARGET_PDB_FILE_NAME
|
||||||
\ TARGET_POLICY
|
\ TARGET_POLICY
|
||||||
@@ -2996,6 +3061,7 @@ syn keyword cmakeGeneratorExpressions contained
|
|||||||
\ VERSION_GREATER_EQUAL
|
\ VERSION_GREATER_EQUAL
|
||||||
\ VERSION_LESS
|
\ VERSION_LESS
|
||||||
\ VERSION_LESS_EQUAL
|
\ VERSION_LESS_EQUAL
|
||||||
|
\ _POSTFIX
|
||||||
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
|
||||||
@@ -3189,6 +3255,7 @@ hi def link cmakeKWctest_update ModeMsg
|
|||||||
hi def link cmakeKWctest_upload ModeMsg
|
hi def link cmakeKWctest_upload ModeMsg
|
||||||
hi def link cmakeKWdefine_property ModeMsg
|
hi def link cmakeKWdefine_property ModeMsg
|
||||||
hi def link cmakeKWenable_language ModeMsg
|
hi def link cmakeKWenable_language ModeMsg
|
||||||
|
hi def link cmakeKWenable_testing ModeMsg
|
||||||
hi def link cmakeKWexec_program ModeMsg
|
hi def link cmakeKWexec_program ModeMsg
|
||||||
hi def link cmakeKWexecute_process ModeMsg
|
hi def link cmakeKWexecute_process ModeMsg
|
||||||
hi def link cmakeKWexport ModeMsg
|
hi def link cmakeKWexport ModeMsg
|
||||||
@@ -3228,6 +3295,8 @@ hi def link cmakeKWmath ModeMsg
|
|||||||
hi def link cmakeKWmessage ModeMsg
|
hi def link cmakeKWmessage ModeMsg
|
||||||
hi def link cmakeKWoption ModeMsg
|
hi def link cmakeKWoption ModeMsg
|
||||||
hi def link cmakeKWproject ModeMsg
|
hi def link cmakeKWproject ModeMsg
|
||||||
|
hi def link cmakeKWqt_wrap_cpp ModeMsg
|
||||||
|
hi def link cmakeKWqt_wrap_ui ModeMsg
|
||||||
hi def link cmakeKWremove ModeMsg
|
hi def link cmakeKWremove ModeMsg
|
||||||
hi def link cmakeKWseparate_arguments ModeMsg
|
hi def link cmakeKWseparate_arguments ModeMsg
|
||||||
hi def link cmakeKWset ModeMsg
|
hi def link cmakeKWset ModeMsg
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ if !exists('g:crystal_no_comment_fold')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\|select\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|ifdef\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|ifdef\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(rescue\|return\|self\|super\|previous_def\|then\|true\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(rescue\|return\|self\|super\|previous_def\|then\|true\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|with\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|with\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
||||||
|
|||||||
577
syntax/d.vim
Normal file
577
syntax/d.vim
Normal file
@@ -0,0 +1,577 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file for the D programming language (version 1.076 and 2.069).
|
||||||
|
"
|
||||||
|
" Language: D
|
||||||
|
" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
|
||||||
|
" Last Change: 2016 Feb 2
|
||||||
|
" Version: 0.28
|
||||||
|
"
|
||||||
|
" Please submit bugs/comments/suggestions to the github repo:
|
||||||
|
" https://github.com/JesseKPhillips/d.vim
|
||||||
|
"
|
||||||
|
" Options:
|
||||||
|
" d_comment_strings - Set to highlight strings and numbers in comments.
|
||||||
|
"
|
||||||
|
" d_hl_operator_overload - Set to highlight D's specially named functions
|
||||||
|
" that when overloaded implement unary and binary operators (e.g. opCmp).
|
||||||
|
"
|
||||||
|
" d_hl_object_types - Set to highlight some common types from object.di.
|
||||||
|
|
||||||
|
"load the ddoc syntax
|
||||||
|
runtime! /syntax/ddoc.vim
|
||||||
|
|
||||||
|
" Quit when a syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Support cpoptions
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" Set the current syntax to be known as d
|
||||||
|
let b:current_syntax = "d"
|
||||||
|
|
||||||
|
|
||||||
|
" Keyword definitions
|
||||||
|
"
|
||||||
|
syn keyword dExternal contained import module
|
||||||
|
syn keyword dAssert assert
|
||||||
|
syn keyword dConditional if else switch
|
||||||
|
syn keyword dBranch goto break continue
|
||||||
|
syn keyword dRepeat while for do foreach foreach_reverse
|
||||||
|
syn keyword dBoolean true false
|
||||||
|
syn keyword dConstant null
|
||||||
|
syn keyword dConstant __FILE__ __LINE__ __EOF__ __VERSION__
|
||||||
|
syn keyword dConstant __DATE__ __TIME__ __TIMESTAMP__ __VENDOR__
|
||||||
|
syn keyword dConstant __MODULE__ __FUNCTION__ __PRETTY_FUNCTION__
|
||||||
|
syn keyword dTypedef alias typedef
|
||||||
|
syn keyword dStructure template interface class struct union
|
||||||
|
syn keyword dEnum enum
|
||||||
|
syn keyword dOperator new delete typeof typeid cast align is
|
||||||
|
syn keyword dOperator this super
|
||||||
|
if exists("d_hl_operator_overload")
|
||||||
|
syn keyword dOpOverload opNeg opCom opPostInc opPostDec opCast opAdd
|
||||||
|
syn keyword dOpOverload opSub opSub_r opMul opDiv opDiv_r opMod
|
||||||
|
syn keyword dOpOverload opMod_r opAnd opOr opXor opShl opShl_r opShr
|
||||||
|
syn keyword dOpOverload opShr_r opUShr opUShr_r opCat
|
||||||
|
syn keyword dOpOverload opCat_r opEquals opCmp
|
||||||
|
syn keyword dOpOverload opAssign opAddAssign opSubAssign opMulAssign
|
||||||
|
syn keyword dOpOverload opDivAssign opModAssign opAndAssign
|
||||||
|
syn keyword dOpOverload opOrAssign opXorAssign opShlAssign
|
||||||
|
syn keyword dOpOverload opShrAssign opUShrAssign opCatAssign
|
||||||
|
syn keyword dOpOverload opIndex opIndexAssign opIndexOpAssign
|
||||||
|
syn keyword dOpOverload opCall opSlice opSliceAssign opSliceOpAssign
|
||||||
|
syn keyword dOpOverload opPos opAdd_r opMul_r opAnd_r opOr_r opXor_r
|
||||||
|
syn keyword dOpOverload opIn opIn_r opPow opDispatch opStar opDot
|
||||||
|
syn keyword dOpOverload opApply opApplyReverse opDollar
|
||||||
|
syn keyword dOpOverload opUnary opIndexUnary opSliceUnary
|
||||||
|
syn keyword dOpOverload opBinary opBinaryRight
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn keyword dType byte ubyte short ushort int uint long ulong cent ucent
|
||||||
|
syn keyword dType void bool Object
|
||||||
|
syn keyword dType float double real
|
||||||
|
syn keyword dType ushort int uint long ulong float
|
||||||
|
syn keyword dType char wchar dchar string wstring dstring
|
||||||
|
syn keyword dType ireal ifloat idouble creal cfloat cdouble
|
||||||
|
syn keyword dType size_t ptrdiff_t sizediff_t equals_t hash_t
|
||||||
|
if exists("d_hl_object_types")
|
||||||
|
syn keyword dType Object Throwable AssociativeArray Error Exception
|
||||||
|
syn keyword dType Interface OffsetTypeInfo TypeInfo TypeInfo_Typedef
|
||||||
|
syn keyword dType TypeInfo_Enum TypeInfo_Pointer TypeInfo_Array
|
||||||
|
syn keyword dType TypeInfo_StaticArray TypeInfo_AssociativeArray
|
||||||
|
syn keyword dType TypeInfo_Function TypeInfo_Delegate TypeInfo_Class
|
||||||
|
syn keyword dType ClassInfo TypeInfo_Interface TypeInfo_Struct
|
||||||
|
syn keyword dType TypeInfo_Tuple TypeInfo_Const TypeInfo_Invariant
|
||||||
|
syn keyword dType TypeInfo_Shared TypeInfo_Inout MemberInfo
|
||||||
|
syn keyword dType MemberInfo_field MemberInfo_function ModuleInfo
|
||||||
|
endif
|
||||||
|
syn keyword dDebug deprecated unittest invariant
|
||||||
|
syn keyword dExceptions throw try catch finally
|
||||||
|
syn keyword dScopeDecl public protected private export package
|
||||||
|
syn keyword dStatement debug return with
|
||||||
|
syn keyword dStatement function delegate __ctfe mixin macro __simd
|
||||||
|
syn keyword dStatement in out body
|
||||||
|
syn keyword dStorageClass contained in out scope
|
||||||
|
syn keyword dStorageClass inout ref lazy pure nothrow
|
||||||
|
syn keyword dStorageClass auto static override final abstract volatile
|
||||||
|
syn keyword dStorageClass __gshared __vector
|
||||||
|
syn keyword dStorageClass synchronized shared immutable const lazy
|
||||||
|
syn keyword dIdentifier _arguments _argptr __vptr __monitor
|
||||||
|
syn keyword dIdentifier _ctor _dtor __argTypes __overloadset
|
||||||
|
syn keyword dScopeIdentifier contained exit success failure
|
||||||
|
syn keyword dTraitsIdentifier contained isAbstractClass isArithmetic
|
||||||
|
syn keyword dTraitsIdentifier contained isAssociativeArray isFinalClass
|
||||||
|
syn keyword dTraitsIdentifier contained isPOD isNested isFloating
|
||||||
|
syn keyword dTraitsIdentifier contained isIntegral isScalar isStaticArray
|
||||||
|
syn keyword dTraitsIdentifier contained isUnsigned isVirtualFunction
|
||||||
|
syn keyword dTraitsIdentifier contained isVirtualMethod isAbstractFunction
|
||||||
|
syn keyword dTraitsIdentifier contained isFinalFunction isStaticFunction
|
||||||
|
syn keyword dTraitsIdentifier contained isOverrideFunction isTemplate
|
||||||
|
syn keyword dTraitsIdentifier contained isRef isOut isLazy hasMember
|
||||||
|
syn keyword dTraitsIdentifier contained identifier getAliasThis
|
||||||
|
syn keyword dTraitsIdentifier contained getAttributes getFunctionAttributes getMember
|
||||||
|
syn keyword dTraitsIdentifier contained getOverloads getPointerBitmap getProtection
|
||||||
|
syn keyword dTraitsIdentifier contained getVirtualFunctions getVirtualIndex
|
||||||
|
syn keyword dTraitsIdentifier contained getVirtualMethods getUnitTests
|
||||||
|
syn keyword dTraitsIdentifier contained parent classInstanceSize allMembers
|
||||||
|
syn keyword dTraitsIdentifier contained derivedMembers isSame compiles
|
||||||
|
syn keyword dPragmaIdentifier contained inline lib mangle msg startaddress GNU_asm
|
||||||
|
syn keyword dExternIdentifier contained C C++ D Windows Pascal System Objective-C
|
||||||
|
syn keyword dAttribute contained safe trusted system
|
||||||
|
syn keyword dAttribute contained property disable nogc
|
||||||
|
syn keyword dVersionIdentifier contained DigitalMars GNU LDC SDC D_NET
|
||||||
|
syn keyword dVersionIdentifier contained X86 X86_64 ARM PPC PPC64 IA64 MIPS MIPS64 Alpha
|
||||||
|
syn keyword dVersionIdentifier contained SPARC SPARC64 S390 S390X HPPA HPPA64 SH SH64
|
||||||
|
syn keyword dVersionIdentifier contained linux Posix OSX FreeBSD Windows Win32 Win64
|
||||||
|
syn keyword dVersionIdentifier contained OpenBSD BSD Solaris AIX SkyOS SysV3 SysV4 Hurd
|
||||||
|
syn keyword dVersionIdentifier contained Cygwin MinGW
|
||||||
|
syn keyword dVersionIdentifier contained LittleEndian BigEndian
|
||||||
|
syn keyword dVersionIdentifier contained D_InlineAsm_X86 D_InlineAsm_X86_64
|
||||||
|
syn keyword dVersionIdentifier contained D_Version2 D_Coverage D_Ddoc D_LP64 D_PIC
|
||||||
|
syn keyword dVersionIdentifier contained unittest assert none all
|
||||||
|
|
||||||
|
syn cluster dComment contains=dNestedComment,dBlockComment,dLineComment
|
||||||
|
|
||||||
|
" Highlight the sharpbang
|
||||||
|
syn match dSharpBang "\%^#!.*" display
|
||||||
|
|
||||||
|
" Attributes/annotations
|
||||||
|
syn match dAnnotation "@[_$a-zA-Z][_$a-zA-Z0-9_]*\>" contains=dAttribute
|
||||||
|
|
||||||
|
" Version Identifiers
|
||||||
|
syn match dVersion "\<version\>"
|
||||||
|
syn match dVersion "\<version\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+7 contains=dVersionIdentifier
|
||||||
|
|
||||||
|
" Scope Identifiers
|
||||||
|
syn match dStatement "\<scope\>"
|
||||||
|
syn match dStatement "\<scope\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+5 contains=dScopeIdentifier
|
||||||
|
|
||||||
|
" Traits Statement
|
||||||
|
syn match dStatement "\<__traits\>"
|
||||||
|
syn match dStatement "\<__traits\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+8 contains=dTraitsIdentifier
|
||||||
|
|
||||||
|
" Pragma Statement
|
||||||
|
syn match dPragma "\<pragma\>"
|
||||||
|
syn match dPragma "\<pragma\s*([_a-zA-Z][_a-zA-Z0-9]*\>"he=s+6 contains=dPragmaIdentifier
|
||||||
|
|
||||||
|
" Necessary to highlight C++ in extern modifiers.
|
||||||
|
syn match dExternIdentifier "C\(++\)\?" contained
|
||||||
|
|
||||||
|
" Extern Identifiers
|
||||||
|
syn match dExternal "\<extern\>"
|
||||||
|
syn match dExtern "\<extern\s*([_a-zA-Z][_a-zA-Z0-9\+]*\>"he=s+6 contains=dExternIdentifier
|
||||||
|
|
||||||
|
" Make import a region to prevent highlighting keywords
|
||||||
|
syn region dImport start="\<import\_s" end=";" contains=dExternal,@dComment
|
||||||
|
|
||||||
|
" Make module a region to prevent highlighting keywords
|
||||||
|
syn region dImport start="\<module\_s" end=";" contains=dExternal,@dComment
|
||||||
|
|
||||||
|
" dTokens is used by the token string highlighting
|
||||||
|
syn cluster dTokens contains=dExternal,dConditional,dBranch,dRepeat,dBoolean
|
||||||
|
syn cluster dTokens add=dConstant,dTypedef,dStructure,dOperator,dOpOverload
|
||||||
|
syn cluster dTokens add=dType,dDebug,dExceptions,dScopeDecl,dStatement
|
||||||
|
syn cluster dTokens add=dStorageClass,dPragma,dAssert,dAnnotation,dEnum
|
||||||
|
syn cluster dTokens add=dParenString,dBrackString,dAngleString,dCurlyString
|
||||||
|
syn cluster dTokens add=dTokenString,dDelimString,dHereString
|
||||||
|
|
||||||
|
" Create a match for parameter lists to identify storage class
|
||||||
|
syn region paramlist start="(" end=")" contains=@dTokens
|
||||||
|
|
||||||
|
" Labels
|
||||||
|
"
|
||||||
|
" We contain dScopeDecl so public: private: etc. are not highlighted like labels
|
||||||
|
syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl,dEnum
|
||||||
|
syn keyword dLabel case default
|
||||||
|
|
||||||
|
syn cluster dTokens add=dUserLabel,dLabel
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
"
|
||||||
|
syn match dCommentError display "\*/"
|
||||||
|
syn match dNestedCommentError display "+/"
|
||||||
|
|
||||||
|
syn keyword dTodo contained TODO FIXME TEMP REFACTOR REVIEW HACK BUG XXX
|
||||||
|
syn match dCommentStar contained "^\s*\*[^/]"me=e-1
|
||||||
|
syn match dCommentStar contained "^\s*\*$"
|
||||||
|
syn match dCommentPlus contained "^\s*+[^/]"me=e-1
|
||||||
|
syn match dCommentPlus contained "^\s*+$"
|
||||||
|
if exists("d_comment_strings")
|
||||||
|
syn region dBlockCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@Spell
|
||||||
|
syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@Spell
|
||||||
|
syn region dLineCommentString contained start=+"+ end=+$\|"+ contains=dUnicode,dEscSequence,@Spell
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,dCommentStartError,@Spell fold
|
||||||
|
syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell fold
|
||||||
|
syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
|
||||||
|
|
||||||
|
syn cluster ddocComment contains=ddocBlockComment,ddocNestedComment,ddocLineComment
|
||||||
|
syn region ddocBlockComment start="/\*\*" end="\*/" contains=dBlockCommentString,dTodo,dCommentStartError,@Spell fold
|
||||||
|
syn region ddocNestedComment start="/++" end="+/" contains=ddocNestedComment,dNestedCommentString,dTodo,@Spell fold
|
||||||
|
syn match ddocLineComment "///.*" contains=dLineCommentString,dTodo,@Spell
|
||||||
|
|
||||||
|
hi link dLineCommentString dBlockCommentString
|
||||||
|
hi link dBlockCommentString dString
|
||||||
|
hi link dNestedCommentString dString
|
||||||
|
hi link dCommentStar dBlockComment
|
||||||
|
hi link dCommentPlus dNestedComment
|
||||||
|
|
||||||
|
syn cluster dTokens add=dBlockComment,dNestedComment,dLineComment,ddocBlockComment,ddocNestedComment,ddocLineComment
|
||||||
|
|
||||||
|
" /+ +/ style comments and strings that span multiple lines can cause
|
||||||
|
" problems. To play it safe, set minlines to a large number.
|
||||||
|
syn sync minlines=200
|
||||||
|
" Use ccomment for /* */ style comments
|
||||||
|
syn sync ccomment dBlockComment
|
||||||
|
|
||||||
|
" Characters
|
||||||
|
"
|
||||||
|
syn match dSpecialCharError contained "[^']"
|
||||||
|
|
||||||
|
" Escape sequences (oct,specal char,hex,wchar, character entities \&xxx;)
|
||||||
|
" These are not contained because they are considered string literals.
|
||||||
|
syn match dEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)"
|
||||||
|
syn match dEscSequence "\\&[^;& \t]\+;"
|
||||||
|
syn match dCharacter "'[^']*'" contains=dEscSequence,dSpecialCharError
|
||||||
|
syn match dCharacter "'\\''" contains=dEscSequence
|
||||||
|
syn match dCharacter "'[^\\]'"
|
||||||
|
|
||||||
|
syn cluster dTokens add=dEscSequence,dCharacter
|
||||||
|
|
||||||
|
" Unicode characters
|
||||||
|
"
|
||||||
|
syn match dUnicode "\\u\d\{4\}"
|
||||||
|
|
||||||
|
" String.
|
||||||
|
"
|
||||||
|
syn match dFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
|
syn match dFormat display "%%" contained
|
||||||
|
|
||||||
|
syn region dString start=+"+ end=+"[cwd]\=+ skip=+\\\\\|\\"+ contains=dFormat,dEscSequence,@Spell
|
||||||
|
syn region dRawString start=+`+ end=+`[cwd]\=+ contains=@Spell
|
||||||
|
syn region dRawString start=+r"+ end=+"[cwd]\=+ contains=@Spell
|
||||||
|
syn region dHexString start=+x"+ end=+"[cwd]\=+ contains=@Spell
|
||||||
|
syn region dDelimString start=+q"\z(.\)+ end=+\z1"+ contains=@Spell
|
||||||
|
syn region dHereString start=+q"\z(\I\i*\)\n+ end=+^\z1"+ contains=@Spell
|
||||||
|
|
||||||
|
|
||||||
|
" Nesting delimited string contents
|
||||||
|
"
|
||||||
|
syn region dNestParenString start=+(+ end=+)+ contained transparent contains=dNestParenString,@Spell
|
||||||
|
syn region dNestBrackString start=+\[+ end=+\]+ contained transparent contains=dNestBrackString,@Spell
|
||||||
|
syn region dNestAngleString start=+<+ end=+>+ contained transparent contains=dNestAngleString,@Spell
|
||||||
|
syn region dNestCurlyString start=+{+ end=+}+ contained transparent contains=dNestCurlyString,@Spell
|
||||||
|
|
||||||
|
" Nesting delimited strings
|
||||||
|
"
|
||||||
|
syn region dParenString matchgroup=dParenString start=+q"(+ end=+)"+ contains=dNestParenString,@Spell
|
||||||
|
syn region dBrackString matchgroup=dBrackString start=+q"\[+ end=+\]"+ contains=dNestBrackString,@Spell
|
||||||
|
syn region dAngleString matchgroup=dAngleString start=+q"<+ end=+>"+ contains=dNestAngleString,@Spell
|
||||||
|
syn region dCurlyString matchgroup=dCurlyString start=+q"{+ end=+}"+ contains=dNestCurlyString,@Spell
|
||||||
|
|
||||||
|
hi link dParenString dNestString
|
||||||
|
hi link dBrackString dNestString
|
||||||
|
hi link dAngleString dNestString
|
||||||
|
hi link dCurlyString dNestString
|
||||||
|
|
||||||
|
syn cluster dTokens add=dString,dRawString,dHexString,dDelimString,dNestString
|
||||||
|
|
||||||
|
" Token strings
|
||||||
|
"
|
||||||
|
syn region dNestTokenString start=+{+ end=+}+ contained contains=dNestTokenString,@dTokens,dFormat
|
||||||
|
syn region dTokenString matchgroup=dTokenStringBrack transparent start=+q{+ end=+}+ contains=dNestTokenString,@dTokens,dFormat
|
||||||
|
|
||||||
|
syn cluster dTokens add=dTokenString
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
"
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
syn match dDec display "\<\d[0-9_]*\(u\=l\=\|l\=u\=\)\>"
|
||||||
|
|
||||||
|
" Hex number
|
||||||
|
syn match dHex display "\<0x[0-9a-f_]\+\(u\=l\=\|l\=u\=\)\>"
|
||||||
|
|
||||||
|
syn match dOctal display "\<0[0-7_]\+\(u\=l\=\|l\=u\=\)\>"
|
||||||
|
" flag an octal number with wrong digits
|
||||||
|
syn match dOctalError display "\<0[0-7_]*[89][0-9_]*"
|
||||||
|
|
||||||
|
" binary numbers
|
||||||
|
syn match dBinary display "\<0b[01_]\+\(u\=l\=\|l\=u\=\)\>"
|
||||||
|
|
||||||
|
"floating point without the dot
|
||||||
|
syn match dFloat display "\<\d[0-9_]*\(fi\=\|l\=i\)\>"
|
||||||
|
"floating point number, with dot, optional exponent
|
||||||
|
syn match dFloat display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\=[fl]\=i\="
|
||||||
|
"floating point number, starting with a dot, optional exponent
|
||||||
|
syn match dFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
|
||||||
|
"floating point number, without dot, with exponent
|
||||||
|
"syn match dFloat display "\<\d\+e[-+]\=\d\+[fl]\=\>"
|
||||||
|
syn match dFloat display "\<\d[0-9_]*e[-+]\=[0-9_]\+[fl]\=\>"
|
||||||
|
|
||||||
|
"floating point without the dot
|
||||||
|
syn match dHexFloat display "\<0x[0-9a-f_]\+\(fi\=\|l\=i\)\>"
|
||||||
|
"floating point number, with dot, optional exponent
|
||||||
|
syn match dHexFloat display "\<0x[0-9a-f_]\+\.[0-9a-f_]*\(p[-+]\=[0-9_]\+\)\=[fl]\=i\="
|
||||||
|
"floating point number, without dot, with exponent
|
||||||
|
syn match dHexFloat display "\<0x[0-9a-f_]\+p[-+]\=[0-9_]\+[fl]\=i\=\>"
|
||||||
|
|
||||||
|
syn cluster dTokens add=dDec,dHex,dOctal,dOctalError,dBinary,dFloat,dHexFloat
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
" Pragma (preprocessor) support
|
||||||
|
" TODO: Highlight following Integer and optional Filespec.
|
||||||
|
syn region dPragma start="#\s*\(line\>\)" skip="\\$" end="$"
|
||||||
|
|
||||||
|
" Block
|
||||||
|
"
|
||||||
|
syn region dBlock start="{" end="}" transparent fold
|
||||||
|
|
||||||
|
|
||||||
|
" The default highlighting.
|
||||||
|
"
|
||||||
|
hi def link dBinary Number
|
||||||
|
hi def link dDec Number
|
||||||
|
hi def link dHex Number
|
||||||
|
hi def link dOctal Number
|
||||||
|
hi def link dFloat Float
|
||||||
|
hi def link dHexFloat Float
|
||||||
|
hi def link dDebug Debug
|
||||||
|
hi def link dBranch Conditional
|
||||||
|
hi def link dConditional Conditional
|
||||||
|
hi def link dLabel Label
|
||||||
|
hi def link dUserLabel Label
|
||||||
|
hi def link dRepeat Repeat
|
||||||
|
hi def link dExceptions Exception
|
||||||
|
hi def link dAssert Statement
|
||||||
|
hi def link dStatement Statement
|
||||||
|
hi def link dScopeDecl dStorageClass
|
||||||
|
hi def link dStorageClass StorageClass
|
||||||
|
hi def link dBoolean Boolean
|
||||||
|
hi def link dUnicode Special
|
||||||
|
hi def link dTokenStringBrack String
|
||||||
|
hi def link dHereString String
|
||||||
|
hi def link dNestString String
|
||||||
|
hi def link dDelimString String
|
||||||
|
hi def link dRawString String
|
||||||
|
hi def link dString String
|
||||||
|
hi def link dHexString String
|
||||||
|
hi def link dCharacter Character
|
||||||
|
hi def link dEscSequence SpecialChar
|
||||||
|
hi def link dFormat SpecialChar
|
||||||
|
hi def link dSpecialCharError Error
|
||||||
|
hi def link dOctalError Error
|
||||||
|
hi def link dOperator Operator
|
||||||
|
hi def link dOpOverload Identifier
|
||||||
|
hi def link dConstant Constant
|
||||||
|
hi def link dTypedef Typedef
|
||||||
|
hi def link dEnum Structure
|
||||||
|
hi def link dStructure Structure
|
||||||
|
hi def link dTodo Todo
|
||||||
|
hi def link dType Type
|
||||||
|
hi def link dLineComment Comment
|
||||||
|
hi def link dBlockComment Comment
|
||||||
|
hi def link dNestedComment Comment
|
||||||
|
hi def link ddocLineComment Comment
|
||||||
|
hi def link ddocBlockComment Comment
|
||||||
|
hi def link ddocNestedComment Comment
|
||||||
|
hi def link dCommentError Error
|
||||||
|
hi def link dNestedCommentError Error
|
||||||
|
hi def link dCommentStartError Error
|
||||||
|
hi def link dExternal Include
|
||||||
|
hi def link dAnnotation PreProc
|
||||||
|
hi def link dSharpBang PreProc
|
||||||
|
hi def link dAttribute StorageClass
|
||||||
|
hi def link dIdentifier Identifier
|
||||||
|
hi def link dVersion dStatement
|
||||||
|
hi def link dVersionIdentifier Identifier
|
||||||
|
hi def link dScopeIdentifier Identifier
|
||||||
|
hi def link dTraitsIdentifier Identifier
|
||||||
|
hi def link dPragma PreProc
|
||||||
|
hi def link dPragmaIdentifier Identifier
|
||||||
|
hi def link dExtern dExternal
|
||||||
|
hi def link dExternIdentifier Identifier
|
||||||
|
|
||||||
|
" Marks contents of the asm statement body as special
|
||||||
|
|
||||||
|
syn match dAsmStatement "\<asm\>"
|
||||||
|
syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement,dAsmOpCode,@dComment,DUserLabel
|
||||||
|
|
||||||
|
hi def link dAsmBody dUnicode
|
||||||
|
hi def link dAsmStatement dStatement
|
||||||
|
hi def link dAsmOpCode Identifier
|
||||||
|
|
||||||
|
syn keyword dAsmOpCode contained aaa aad aam aas
|
||||||
|
syn keyword dAsmOpCode contained add addpd addps addsd
|
||||||
|
syn keyword dAsmOpCode contained and andnpd andnps andpd
|
||||||
|
syn keyword dAsmOpCode contained arpl bound bsf bsr
|
||||||
|
syn keyword dAsmOpCode contained bt btc btr bts
|
||||||
|
syn keyword dAsmOpCode contained call bswap andps addss
|
||||||
|
syn keyword dAsmOpCode contained cbw cdq clc cld
|
||||||
|
syn keyword dAsmOpCode contained cli clts cmc cmova
|
||||||
|
syn keyword dAsmOpCode contained cmovb cmovbe cmovc cmove
|
||||||
|
syn keyword dAsmOpCode contained cmovge cmovl cmovle cmovna
|
||||||
|
syn keyword dAsmOpCode contained cmovnae cmovg cmovae clflush
|
||||||
|
syn keyword dAsmOpCode contained cmovnb cmovnbe cmovnc cmovne
|
||||||
|
syn keyword dAsmOpCode contained cmovnge cmovnl cmovnle cmovno
|
||||||
|
syn keyword dAsmOpCode contained cmovns cmovnz cmovo cmovp
|
||||||
|
syn keyword dAsmOpCode contained cmovpo cmovs cmovz cmp
|
||||||
|
syn keyword dAsmOpCode contained cmppd cmovpe cmovnp cmovng
|
||||||
|
syn keyword dAsmOpCode contained cmpps cmps cmpsb cmpsd
|
||||||
|
syn keyword dAsmOpCode contained cmpsw cmpxch8b cmpxchg comisd
|
||||||
|
syn keyword dAsmOpCode contained cpuid cvtdq2pd cvtdq2ps cvtpd2dq
|
||||||
|
syn keyword dAsmOpCode contained cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq
|
||||||
|
syn keyword dAsmOpCode contained cvtps2pd cvtpd2pi comiss cmpss
|
||||||
|
syn keyword dAsmOpCode contained cvtps2pi cvtsd2si cvtsd2ss cvtsi2sd
|
||||||
|
syn keyword dAsmOpCode contained cvtss2sd cvtss2si cvttpd2dq cvttpd2pi
|
||||||
|
syn keyword dAsmOpCode contained cvttps2pi cvttsd2si cvttss2si cwd
|
||||||
|
syn keyword dAsmOpCode contained da daa das db
|
||||||
|
syn keyword dAsmOpCode contained dd cwde cvttps2dq cvtsi2ss
|
||||||
|
syn keyword dAsmOpCode contained de dec df di
|
||||||
|
syn keyword dAsmOpCode contained divpd divps divsd divss
|
||||||
|
syn keyword dAsmOpCode contained dq ds dt dw
|
||||||
|
syn keyword dAsmOpCode contained enter f2xm1 fabs fadd
|
||||||
|
syn keyword dAsmOpCode contained faddp emms dl div
|
||||||
|
syn keyword dAsmOpCode contained fbld fbstp fchs fclex
|
||||||
|
syn keyword dAsmOpCode contained fcmovbe fcmove fcmovnb fcmovnbe
|
||||||
|
syn keyword dAsmOpCode contained fcmovnu fcmovu fcom fcomi
|
||||||
|
syn keyword dAsmOpCode contained fcomp fcompp fcos fdecstp
|
||||||
|
syn keyword dAsmOpCode contained fdisi fcomip fcmovne fcmovb
|
||||||
|
syn keyword dAsmOpCode contained fdiv fdivp fdivr fdivrp
|
||||||
|
syn keyword dAsmOpCode contained ffree fiadd ficom ficomp
|
||||||
|
syn keyword dAsmOpCode contained fidivr fild fimul fincstp
|
||||||
|
syn keyword dAsmOpCode contained fist fistp fisub fisubr
|
||||||
|
syn keyword dAsmOpCode contained fld finit fidiv feni
|
||||||
|
syn keyword dAsmOpCode contained fld1 fldcw fldenv fldl2e
|
||||||
|
syn keyword dAsmOpCode contained fldlg2 fldln2 fldpi fldz
|
||||||
|
syn keyword dAsmOpCode contained fmulp fnclex fndisi fneni
|
||||||
|
syn keyword dAsmOpCode contained fnop fnsave fnstcw fnstenv
|
||||||
|
syn keyword dAsmOpCode contained fnstsw fninit fmul fldl2t
|
||||||
|
syn keyword dAsmOpCode contained fpatan fprem fprem1 fptan
|
||||||
|
syn keyword dAsmOpCode contained frstor fsave fscale fsetpm
|
||||||
|
syn keyword dAsmOpCode contained fsincos fsqrt fst fstcw
|
||||||
|
syn keyword dAsmOpCode contained fstp fstsw fsub fsubp
|
||||||
|
syn keyword dAsmOpCode contained fsubr fstenv fsin frndint
|
||||||
|
syn keyword dAsmOpCode contained fsubrp ftst fucom fucomi
|
||||||
|
syn keyword dAsmOpCode contained fucomp fucompp fwait fxam
|
||||||
|
syn keyword dAsmOpCode contained fxrstor fxsave fxtract fyl2x
|
||||||
|
syn keyword dAsmOpCode contained hlt idiv imul in
|
||||||
|
syn keyword dAsmOpCode contained inc fyl2xp1 fxch fucomip
|
||||||
|
syn keyword dAsmOpCode contained ins insb insd insw
|
||||||
|
syn keyword dAsmOpCode contained into invd invlpg iret
|
||||||
|
syn keyword dAsmOpCode contained ja jae jb jbe
|
||||||
|
syn keyword dAsmOpCode contained jcxz je jecxz jg
|
||||||
|
syn keyword dAsmOpCode contained jge jc iretd int
|
||||||
|
syn keyword dAsmOpCode contained jl jle jmp jna
|
||||||
|
syn keyword dAsmOpCode contained jnb jnbe jnc jne
|
||||||
|
syn keyword dAsmOpCode contained jnge jnl jnle jno
|
||||||
|
syn keyword dAsmOpCode contained jns jnz jo jp
|
||||||
|
syn keyword dAsmOpCode contained jpe jnp jng jnae
|
||||||
|
syn keyword dAsmOpCode contained jpo js jz lahf
|
||||||
|
syn keyword dAsmOpCode contained ldmxcsr lds lea leave
|
||||||
|
syn keyword dAsmOpCode contained lfence lfs lgdt lgs
|
||||||
|
syn keyword dAsmOpCode contained lldt lmsw lock lods
|
||||||
|
syn keyword dAsmOpCode contained lodsb lidt les lar
|
||||||
|
syn keyword dAsmOpCode contained lodsd lodsw loop loope
|
||||||
|
syn keyword dAsmOpCode contained loopnz loopz lsl lss
|
||||||
|
syn keyword dAsmOpCode contained maskmovdqu maskmovq maxpd maxps
|
||||||
|
syn keyword dAsmOpCode contained maxss mfence minpd minps
|
||||||
|
syn keyword dAsmOpCode contained minsd maxsd ltr loopne
|
||||||
|
syn keyword dAsmOpCode contained minss mov movapd movaps
|
||||||
|
syn keyword dAsmOpCode contained movdq2q movdqa movdqu movhlps
|
||||||
|
syn keyword dAsmOpCode contained movhps movlhps movlpd movlps
|
||||||
|
syn keyword dAsmOpCode contained movmskps movntdq movnti movntpd
|
||||||
|
syn keyword dAsmOpCode contained movntps movmskpd movhpd movd
|
||||||
|
syn keyword dAsmOpCode contained movntq movq movq2dq movs
|
||||||
|
syn keyword dAsmOpCode contained movsd movss movsw movsx
|
||||||
|
syn keyword dAsmOpCode contained movups movzx mul mulpd
|
||||||
|
syn keyword dAsmOpCode contained mulsd mulss neg nop
|
||||||
|
syn keyword dAsmOpCode contained not mulps movupd movsb
|
||||||
|
syn keyword dAsmOpCode contained or orpd orps out
|
||||||
|
syn keyword dAsmOpCode contained outsb outsd outsw packssdw
|
||||||
|
syn keyword dAsmOpCode contained packuswb paddb paddd paddq
|
||||||
|
syn keyword dAsmOpCode contained paddsw paddusb paddusw paddw
|
||||||
|
syn keyword dAsmOpCode contained pand paddsb packsswb outs
|
||||||
|
syn keyword dAsmOpCode contained pandn pavgb pavgw pcmpeqb
|
||||||
|
syn keyword dAsmOpCode contained pcmpeqw pcmpgtb pcmpgtd pcmpgtw
|
||||||
|
syn keyword dAsmOpCode contained pinsrw pmaddwd pmaxsw pmaxub
|
||||||
|
syn keyword dAsmOpCode contained pminub pmovmskb pmulhuw pmulhw
|
||||||
|
syn keyword dAsmOpCode contained pmullw pminsw pextrw pcmpeqd
|
||||||
|
syn keyword dAsmOpCode contained pmuludq pop popa popad
|
||||||
|
syn keyword dAsmOpCode contained popfd por prefetchnta prefetcht0
|
||||||
|
syn keyword dAsmOpCode contained prefetcht2 psadbw pshufd pshufhw
|
||||||
|
syn keyword dAsmOpCode contained pshufw pslld pslldq psllq
|
||||||
|
syn keyword dAsmOpCode contained psllw pshuflw prefetcht1 popf
|
||||||
|
syn keyword dAsmOpCode contained psrad psraw psrld psrldq
|
||||||
|
syn keyword dAsmOpCode contained psrlw psubb psubd psubq
|
||||||
|
syn keyword dAsmOpCode contained psubsw psubusb psubusw psubw
|
||||||
|
syn keyword dAsmOpCode contained punpckhdq punpckhqdq punpckhwd punpcklbw
|
||||||
|
syn keyword dAsmOpCode contained punpckldq punpckhbw psubsb psrlq
|
||||||
|
syn keyword dAsmOpCode contained punpcklqdq punpcklwd push pusha
|
||||||
|
syn keyword dAsmOpCode contained pushf pushfd pxor rcl
|
||||||
|
syn keyword dAsmOpCode contained rcpss rcr rdmsr rdpmc
|
||||||
|
syn keyword dAsmOpCode contained rep repe repne repnz
|
||||||
|
syn keyword dAsmOpCode contained repz rdtsc rcpps pushad
|
||||||
|
syn keyword dAsmOpCode contained ret retf rol ror
|
||||||
|
syn keyword dAsmOpCode contained rsqrtps rsqrtss sahf sal
|
||||||
|
syn keyword dAsmOpCode contained sbb scas scasb scasd
|
||||||
|
syn keyword dAsmOpCode contained seta setae setb setbe
|
||||||
|
syn keyword dAsmOpCode contained setc scasw sar rsm
|
||||||
|
syn keyword dAsmOpCode contained sete setg setge setl
|
||||||
|
syn keyword dAsmOpCode contained setna setnae setnb setnbe
|
||||||
|
syn keyword dAsmOpCode contained setne setng setnge setnl
|
||||||
|
syn keyword dAsmOpCode contained setno setnp setns setnz
|
||||||
|
syn keyword dAsmOpCode contained seto setnle setnc setle
|
||||||
|
syn keyword dAsmOpCode contained setp setpe setpo sets
|
||||||
|
syn keyword dAsmOpCode contained sfence sgdt shl shld
|
||||||
|
syn keyword dAsmOpCode contained shrd shufpd shufps sidt
|
||||||
|
syn keyword dAsmOpCode contained smsw sqrtpd sqrtps sqrtsd
|
||||||
|
syn keyword dAsmOpCode contained sqrtss sldt shr setz
|
||||||
|
syn keyword dAsmOpCode contained stc std sti stmxcsr
|
||||||
|
syn keyword dAsmOpCode contained stosb stosd stosw str
|
||||||
|
syn keyword dAsmOpCode contained subpd subps subsd subss
|
||||||
|
syn keyword dAsmOpCode contained sysexit test ucomisd ucomiss
|
||||||
|
syn keyword dAsmOpCode contained ud2 sysenter sub stos
|
||||||
|
syn keyword dAsmOpCode contained unpckhpd unpckhps unpcklpd unpcklps
|
||||||
|
syn keyword dAsmOpCode contained verw wbinvd wrmsr xadd
|
||||||
|
syn keyword dAsmOpCode contained xchg xlatb xor xorpd
|
||||||
|
syn keyword dAsmOpCode contained xorps pfrcpit1 pfmin movddup
|
||||||
|
syn keyword dAsmOpCode contained addsubpd addsubps fisttp haddps
|
||||||
|
syn keyword dAsmOpCode contained hsubpd hsubps lddqu monitor
|
||||||
|
syn keyword dAsmOpCode contained haddpd xlat wait verr
|
||||||
|
syn keyword dAsmOpCode contained movshdup movsldup mwait pfcmpeq
|
||||||
|
syn keyword dAsmOpCode contained pavgusb pf2id pfacc pfadd
|
||||||
|
syn keyword dAsmOpCode contained pfcmpge pfcmpgt pfmax pfmul
|
||||||
|
syn keyword dAsmOpCode contained pfnacc pfpnacc pfrcp pfrcpit1
|
||||||
|
syn keyword dAsmOpCode contained pfrsqit1 pfrsqrt pfsub pfsubr
|
||||||
|
syn keyword dAsmOpCode contained pmulhrw pswapd syscall sysret
|
||||||
|
syn keyword dAsmOpCode contained vpmuldq xgetbv cmpxchg8b cmpxchg16b
|
||||||
|
syn keyword dAsmOpCode contained pabsb pabsd pabsw palignr
|
||||||
|
syn keyword dAsmOpCode contained phaddd phaddsw phaddw phsubd
|
||||||
|
syn keyword dAsmOpCode contained phsubsw phsubw pmaddubsw pmulhrsw
|
||||||
|
syn keyword dAsmOpCode contained pshufb psignb psignd psignw
|
||||||
|
syn keyword dAsmOpCode contained popfq pushfq blendpd blendps
|
||||||
|
syn keyword dAsmOpCode contained blendvpd blendvps extractps insertps
|
||||||
|
syn keyword dAsmOpCode contained movntdqa mpsadbw packusdw pblendvb
|
||||||
|
syn keyword dAsmOpCode contained pblendw pcmpeqq pextrb pextrd
|
||||||
|
syn keyword dAsmOpCode contained pextrq phminposuw pinsrb pinsrd
|
||||||
|
syn keyword dAsmOpCode contained pinsrq pmaxsb pmaxsd pmaxud
|
||||||
|
syn keyword dAsmOpCode contained pmaxuw pminsb pminsd pminud
|
||||||
|
syn keyword dAsmOpCode contained pminuw pmulld ptest roundpd
|
||||||
|
syn keyword dAsmOpCode contained roundps roundsd roundss pmuldq
|
||||||
|
syn keyword dAsmOpCode contained pmovsxbd pmovsxdq pmovzxbq pmovzxdq
|
||||||
|
syn keyword dAsmOpCode contained pmovsxbq pmovsxwd pmovzxbq pmovzxwd
|
||||||
|
syn keyword dAsmOpCode contained pmovsxbw pmovsxwq pmovzxbw pmovzxwq
|
||||||
|
syn keyword dAsmOpCode contained crc32 pcmpestri pcmpestrm pcmpgtq
|
||||||
|
syn keyword dAsmOpCode contained pcmpistri pcmpistrm popcnt pi2fd
|
||||||
|
syn keyword dAsmOpCode contained adc
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
55
syntax/dcov.vim
Normal file
55
syntax/dcov.vim
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file for coverage information for the reference compiler (DMD) of
|
||||||
|
" the D programming language.
|
||||||
|
"
|
||||||
|
" Language: dcov (dlang coverage testing output)
|
||||||
|
" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
|
||||||
|
" Last Change: 2015-07-10
|
||||||
|
"
|
||||||
|
" Contributors:
|
||||||
|
" - Joakim Brannstrom <joakim.brannstrom@gmx.com>
|
||||||
|
"
|
||||||
|
" Please submit bugs/comments/suggestions to the github repo:
|
||||||
|
" https://github.com/JesseKPhillips/d.vim
|
||||||
|
|
||||||
|
" Quit when a (custom) syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Provide highlight of D code.
|
||||||
|
runtime! syntax/d.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
" Source lines
|
||||||
|
syn match dcovCode "^\s*|"
|
||||||
|
syn match dcovExecuted "^\s*\d\+|"
|
||||||
|
syn match dcovNotExecuted "^\s*0\+|"
|
||||||
|
|
||||||
|
" Coverage statistic
|
||||||
|
" 0% is critical
|
||||||
|
" 1-39% is low
|
||||||
|
" 40-99 is partial
|
||||||
|
" 100% is complete
|
||||||
|
syn match dcovFile contained "^.\{-}\s\+\( is \)\@!"
|
||||||
|
syn match dcovPartial contained "\d\+% cov\w*"
|
||||||
|
syn match dcovFull contained "100% cov\w*"
|
||||||
|
syn match dcovLow contained "[1-3]\=\d\=% cov\w*"
|
||||||
|
syn match dcovNone contained "0% cov\w*"
|
||||||
|
syn match dcovStat "^\(.\{0,7}|\)\@!.*$" contains=dcovFull,dcovPartial,dcovNone,dcovFile,dcovLow
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
|
" Only used when an item doesn't have highlighting yet
|
||||||
|
hi def link dcovNotExecuted Constant
|
||||||
|
hi def link dcovExecuted Type
|
||||||
|
hi def link dcovCode Comment
|
||||||
|
hi def link dcovFull PreProc
|
||||||
|
hi def link dcovFile Identifier
|
||||||
|
hi def link dcovNone Error
|
||||||
|
hi def link dcovLow Operator
|
||||||
|
hi def link dcovPartial Structure
|
||||||
|
|
||||||
|
let b:current_syntax = "dcov"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'tmux') != -1
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
runtime! /syntax/ddoc.vim
|
||||||
86
syntax/ddoc.vim
Normal file
86
syntax/ddoc.vim
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if &filetype == "ddoc"
|
||||||
|
"ddoc file type
|
||||||
|
" Quit when a syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Support cpoptions
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" Set the current syntax to be known as ddoc
|
||||||
|
let b:current_syntax = "ddoc"
|
||||||
|
|
||||||
|
syn match ddocIdentifier "\$(\zs\a\w*\ze\_W*" display conceal contained
|
||||||
|
syn match ddocIdentifierDecl "^\s*\zs\a\w*\ze\s*=" display contained
|
||||||
|
syn region ddocDecl start="^\s*\a\w*\s*=" end="\(\n\_^\s*\_$\|\n^\s*\a\w*\s*=\)" transparent fold contains=ddocIdentifierDecl,ddocIdentifier
|
||||||
|
|
||||||
|
"use html comment when fold method is marker
|
||||||
|
set commentstring=<!--%s-->
|
||||||
|
|
||||||
|
hi! def link ddocIdentifier Macro
|
||||||
|
hi! def link ddocIdentifierDecl Macro
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
elseif &filetype == "dd" || &filetype == "d" && getline(1) =~ "^Ddoc"
|
||||||
|
"Ddoc source file or .d File begining with Ddoc
|
||||||
|
" Quit when a syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Support cpoptions
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
" Set the current syntax to be known as ddoc
|
||||||
|
let b:current_syntax = "ddoc"
|
||||||
|
|
||||||
|
syn match ddocKeyword "\%^Ddoc" display
|
||||||
|
syn keyword ddocKeyword MACROS contained
|
||||||
|
syn match ddocIdentifier "\$(\zs\a\w*\ze\_W*" display conceal
|
||||||
|
syn match ddocIdentifierDecl "^\s*\zs\a\w*\ze\s*=" display contained
|
||||||
|
"can slow down to much
|
||||||
|
"syn match ddocIdentifierDecl "\(^\s*MACROS:\s\+\)\@<=\zs\a\w*\ze\s*=" display contained
|
||||||
|
syn region ddocDecl start="^\s*MACROS:\_s\+" end="\%$" transparent fold contains=ddocKeyword,ddocIdentifierDecl,ddocIdentifier
|
||||||
|
|
||||||
|
"use html comment when fold method is marker
|
||||||
|
set commentstring=<!--%s-->
|
||||||
|
|
||||||
|
" highlight only ddoc Identifiers
|
||||||
|
hi! def link ddocIdentifier Macro
|
||||||
|
hi! def link ddocIdentifierDecl Macro
|
||||||
|
hi! def link ddocKeyword Macro
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
finish
|
||||||
|
elseif &filetype == "d"
|
||||||
|
"Ddoc inside comments
|
||||||
|
syn keyword ddocKeyword MACROS contained
|
||||||
|
syn match ddocIdentifier "\$(\zs\a\w*\ze\_W*" display contained conceal containedin=@ddocComment
|
||||||
|
|
||||||
|
syn match ddocIdentifierBlockDecl "^\*\=\s*\a\w*\ze\s*=" display contained
|
||||||
|
"can slow down to much
|
||||||
|
"syn match ddocIdentifierBlockDecl "\(^*\=\s*MACROS:\s\+\)\@<=\zs\a\w*\ze\s*=" display contained
|
||||||
|
|
||||||
|
syn region ddocBlockDecl start="^\*\=\s*\zsMACROS:\_s\+" end="\ze\*/" transparent fold contained containedin=ddocBlockComment contains=ddocKeyword,ddocIdentifierBlockDecl,ddocIdentifier
|
||||||
|
|
||||||
|
syn match ddocIdentifierNestedDecl "^+\=\s*\a\w*\ze\s*=" display contained
|
||||||
|
"can slow down to much
|
||||||
|
"syn match ddocIdentifierNestedDecl "\(^+\=\s*MACROS:\s\+\)\@<=\zs\a\w*\ze\s*=" display contained
|
||||||
|
|
||||||
|
syn region ddocNestedDecl start="^+\=\s*\zsMACROS:\_s\+" end="\ze+/" transparent fold contained containedin=ddocNestedComment contains=ddocKeyword,ddocIdentifierNestedDecl,ddocIdentifier
|
||||||
|
|
||||||
|
"reset to default commentstring
|
||||||
|
set commentstring=/*%s*/
|
||||||
|
hi! def link ddocIdentifier Macro
|
||||||
|
hi! def link ddocIdentifierBlockDecl Macro
|
||||||
|
hi! def link ddocIdentifierNestedDecl Macro
|
||||||
|
hi! def link ddocKeyword Macro
|
||||||
|
endif
|
||||||
94
syntax/dsdl.vim
Normal file
94
syntax/dsdl.vim
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dlang') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file for DUB configurations."
|
||||||
|
"
|
||||||
|
" Language: SDLang (dub config)
|
||||||
|
" Maintainer: Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
|
||||||
|
" Last Change: 2015-07-11
|
||||||
|
"
|
||||||
|
" Contributors:
|
||||||
|
" - Joakim Brannstrom <joakim.brannstrom@gmx.com>
|
||||||
|
"
|
||||||
|
" Please submit bugs/comments/suggestions to the github repo:
|
||||||
|
" https://github.com/JesseKPhillips/d.vim
|
||||||
|
|
||||||
|
" Quit when a (custom) syntax file was already loaded
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" General matchers
|
||||||
|
syn match dsdlAssign contained "="
|
||||||
|
syn match dsdlAttribute "\w*\s*=" contains=dsdlAssign
|
||||||
|
syn match dsdlStatement "^\s*[a-zA-Z:]*"
|
||||||
|
|
||||||
|
" Keyword grouping
|
||||||
|
syn keyword dsdlInfo name description copyright authors license
|
||||||
|
syn keyword dsdlStructure buildRequirements buildType configuration
|
||||||
|
syn keyword dsdlBoolean true false on off
|
||||||
|
|
||||||
|
syn keyword dsdlTodo contained TODO FIXME XXX
|
||||||
|
|
||||||
|
" dsdlCommentGroup allows adding matches for special things in comments
|
||||||
|
syn cluster dsdlCommentGroup contains=dsdlTodo
|
||||||
|
|
||||||
|
" Highlight % items in strings.
|
||||||
|
syn match dsdlFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
|
|
||||||
|
" dsdlCppString: same as dsdlString, but ends at end of line
|
||||||
|
syn region dsdlString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,dsdlFormat,@Spell extend
|
||||||
|
syn region dsdlCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,dsdlFormat,@Spell
|
||||||
|
|
||||||
|
syn cluster dsdlStringGroup contains=dsdlCppString
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn region dsdlCommentL start="//" skip="\\$" end="$" keepend contains=@dsdlCommentGroup,cSpaceError,@Spell
|
||||||
|
syn region dsdlComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@dsdlCommentGroup,dsdlCommentStartError,cSpaceError,@Spell fold extend
|
||||||
|
" keep a // comment separately, it terminates a preproc. conditional
|
||||||
|
syn match dsdlCommentError display "\*/"
|
||||||
|
syn match dsdlCommentStartError display "/\*"me=e-1 contained
|
||||||
|
|
||||||
|
"integer number, or floating point number without a dot and with "f".
|
||||||
|
syn case ignore
|
||||||
|
syn match dsdlNumbers display transparent "\<\d\|\.\d" contains=dsdlNumber,dsdlFloat,cOctalError,dsdlOctal
|
||||||
|
" Same, but without octal error (for comments)
|
||||||
|
syn match dsdlNumbersCom display contained transparent "\<\d\|\.\d" contains=dsdlNumber,dsdlFloat,dsdlOctal
|
||||||
|
syn match dsdlNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
"hex number
|
||||||
|
syn match dsdlNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
" Flag the first zero of an octal number as something special
|
||||||
|
syn match dsdlOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=dsdlOctalZero
|
||||||
|
syn match dsdlOctalZero display contained "\<0"
|
||||||
|
syn match dsdlFloat display contained "\d\+f"
|
||||||
|
"floating point number, with dot, optional exponent
|
||||||
|
syn match dsdlFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
|
||||||
|
"floating point number, starting with a dot, optional exponent
|
||||||
|
syn match dsdlFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
|
||||||
|
"floating point number, without dot, with exponent
|
||||||
|
syn match dsdlFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
|
" Only used when an item doesn't have highlighting yet
|
||||||
|
hi def link dsdlInfo Constant
|
||||||
|
hi def link dsdlAssign Special
|
||||||
|
hi def link dsdlBoolean Boolean
|
||||||
|
hi def link dsdlFormat SpecialChar
|
||||||
|
hi def link dsdlCppString dsdlString
|
||||||
|
hi def link dsdlCommentL dsdlComment
|
||||||
|
hi def link dsdlNumber Number
|
||||||
|
hi def link dsdlOctal Number
|
||||||
|
hi def link dsdlOctalZero PreProc " link this to Error if you want
|
||||||
|
hi def link dsdlFloat Float
|
||||||
|
hi def link dsdlCommentError Error
|
||||||
|
hi def link dsdlCommentStartError Error
|
||||||
|
hi def link dsdlStructure Structure
|
||||||
|
hi def link dsdlString String
|
||||||
|
hi def link dsdlComment Comment
|
||||||
|
hi def link dsdlTodo Todo
|
||||||
|
hi def link dsdlStatement Statement
|
||||||
|
hi def link dsdlAttribute Tag
|
||||||
|
|
||||||
|
let b:current_syntax = "dsdl"
|
||||||
@@ -31,10 +31,10 @@ syn keyword lispFunc ignore-stdout ignore-stderr ignore-outputs
|
|||||||
syn keyword lispFunc with-stdout-to with-stderr-to with-outputs-to
|
syn keyword lispFunc with-stdout-to with-stderr-to with-outputs-to
|
||||||
syn keyword lispFunc write-file system bash
|
syn keyword lispFunc write-file system bash
|
||||||
|
|
||||||
syn cluster lispBaseListCluster add=jbuildVar
|
syn cluster lispBaseListCluster add=duneVar
|
||||||
syn match jbuildVar '\${[@<^]}' containedin=lispSymbol
|
syn match duneVar '\${[@<^]}' containedin=lispSymbol
|
||||||
syn match jbuildVar '\${\k\+\(:\k\+\)\?}' containedin=lispSymbol
|
syn match duneVar '\${\k\+\(:\k\+\)\?}' containedin=lispSymbol
|
||||||
|
|
||||||
hi def link jbuildVar Identifier
|
hi def link duneVar Identifier
|
||||||
|
|
||||||
let b:current_syntax = "jbuild"
|
let b:current_syntax = "dune"
|
||||||
@@ -24,7 +24,10 @@ if !exists("b:eelixir_subtype")
|
|||||||
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
|
||||||
endif
|
endif
|
||||||
if b:eelixir_subtype == ''
|
if b:eelixir_subtype == ''
|
||||||
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
let b:eelixir_subtype = matchstr(&filetype,'^leex\.\zs\w\+')
|
||||||
|
endif
|
||||||
|
if b:eelixir_subtype == ''
|
||||||
|
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.leex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
|
||||||
endif
|
endif
|
||||||
if b:eelixir_subtype == 'ex'
|
if b:eelixir_subtype == 'ex'
|
||||||
let b:eelixir_subtype = 'elixir'
|
let b:eelixir_subtype = 'elixir'
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ syn match elixirOperator '\.\.\|\.'
|
|||||||
syn match elixirOperator "\^\^\^\|\^"
|
syn match elixirOperator "\^\^\^\|\^"
|
||||||
syn match elixirOperator '\\\\\|::\|\*\|/\|\~\~\~\|@'
|
syn match elixirOperator '\\\\\|::\|\*\|/\|\~\~\~\|@'
|
||||||
|
|
||||||
|
syn match elixirAlias '\([a-z]\)\@<![A-Z]\w*\%(\.[A-Z]\w*\)*'
|
||||||
|
|
||||||
syn match elixirAtom '\(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)'
|
syn match elixirAtom '\(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)'
|
||||||
syn match elixirAtom '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)'
|
syn match elixirAtom '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)'
|
||||||
syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!"
|
syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!"
|
||||||
|
|
||||||
syn match elixirAlias '\([a-z]\)\@<![A-Z]\w*'
|
|
||||||
|
|
||||||
syn keyword elixirBoolean true false nil
|
syn keyword elixirBoolean true false nil
|
||||||
|
|
||||||
syn match elixirVariable '@[a-z]\w*'
|
syn match elixirVariable '@[a-z]\w*'
|
||||||
@@ -109,6 +109,12 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/"
|
|||||||
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\z1+ skip=+\\"+ fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\z1+ skip=+\\"+ fold
|
||||||
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\z1+ skip=+\\'+ fold
|
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\z1+ skip=+\\'+ fold
|
||||||
|
|
||||||
|
|
||||||
|
" LiveView Sigils surrounded with ~L"""
|
||||||
|
syntax include @HTML syntax/html.vim
|
||||||
|
syntax region elixirLiveViewSigil matchgroup=elixirSigilDelimiter keepend start=+\~L\z("""\)+ end=+^\s*\z1+ skip=+\\"+ contains=@HTML fold
|
||||||
|
|
||||||
|
|
||||||
" Documentation
|
" Documentation
|
||||||
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
|
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
|
||||||
syn include @markdown syntax/markdown.vim
|
syn include @markdown syntax/markdown.vim
|
||||||
@@ -127,9 +133,9 @@ syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc
|
|||||||
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
|
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
|
||||||
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+^\s*\z1+ contains=@elixirDocStringContained fold keepend
|
||||||
|
|
||||||
" Defines
|
" Defines
|
||||||
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ syn match elmFloat "\(\<\d\+\.\d\+\>\)"
|
|||||||
|
|
||||||
" Identifiers
|
" Identifiers
|
||||||
syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator
|
syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator
|
||||||
|
syn match elmFuncName /^\l\w*/
|
||||||
|
|
||||||
" Folding
|
" Folding
|
||||||
syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold
|
syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold
|
||||||
@@ -54,6 +55,7 @@ syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\<ca
|
|||||||
syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold
|
syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold
|
||||||
syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\<let\>" end="\<in\>" contains=ALL fold
|
syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\<let\>" end="\<in\>" contains=ALL fold
|
||||||
|
|
||||||
|
hi def link elmFuncName Function
|
||||||
hi def link elmCaseBlockDefinition Conditional
|
hi def link elmCaseBlockDefinition Conditional
|
||||||
hi def link elmCaseBlockItemDefinition Conditional
|
hi def link elmCaseBlockItemDefinition Conditional
|
||||||
hi def link elmLetBlockDefinition TypeDef
|
hi def link elmLetBlockDefinition TypeDef
|
||||||
|
|||||||
@@ -42,25 +42,48 @@ highlight default link gomodReplaceOperator Operator
|
|||||||
|
|
||||||
|
|
||||||
" highlight versions:
|
" highlight versions:
|
||||||
|
" * vX.Y.Z-pre
|
||||||
" * vX.Y.Z
|
" * vX.Y.Z
|
||||||
" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
|
" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
|
||||||
" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
|
" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
|
||||||
" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef
|
" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef
|
||||||
" * +incompatible suffix when X > 1
|
" see https://godoc.org/golang.org/x/tools/internal/semver for more
|
||||||
|
" information about how semantic versions are parsed and
|
||||||
|
" https://golang.org/cmd/go/ for how pseudo-versions and +incompatible
|
||||||
|
" are applied.
|
||||||
|
|
||||||
|
|
||||||
" match vX.Y.Z and their prereleases
|
" match vX.Y.Z and their prereleases
|
||||||
syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%(\w\+\.\)\+0\.\d\{14}-\x\+\)\?"
|
syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?"
|
||||||
" match target when most recent version before the target is X.Y.Z
|
" ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^
|
||||||
syntax match gomodVersion "v\d\+\.\d\+\.[1-9]\{1}\d*\%(-0\.\%(\d\{14}-\x\+\)\)\?"
|
" ^--------------------------------------- semantic version -------------------------------------------------------^
|
||||||
" match target without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
|
||||||
|
" match pseudo versions
|
||||||
|
" without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||||
syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+"
|
syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+"
|
||||||
|
" when most recent version before target is a pre-release
|
||||||
|
syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+"
|
||||||
|
" ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^
|
||||||
|
" ^------------------------------------- semantic version --------------------------------------------------^
|
||||||
|
" most recent version before the target is X.Y.Z
|
||||||
|
syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+"
|
||||||
|
" ^--- version ---^^--------------- metadata ---------------------^
|
||||||
|
|
||||||
" match vX.Y.Z and their prereleases for X>1
|
" match incompatible vX.Y.Z and their prereleases
|
||||||
syntax match gomodVersion "v[2-9]\{1}\d\?\.\d\+\.\d\+\%(-\%(\w\+\.\)\+0\.\d\{14\}-\x\+\)\?\%(+incompatible\>\)\?"
|
syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible"
|
||||||
" match target when most recent version before the target is X.Y.Z for X>1
|
" ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^
|
||||||
syntax match gomodVersion "v[2-9]\{1}\d\?\.\d\+\.[1-9]\{1}\d*\%(-0\.\%(\d\{14\}-\x\+\)\)\?\%(+incompatible\>\)\?"
|
" ^------------------------------------------- semantic version -----------------------------------------------------------^
|
||||||
" match target without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) for X>1
|
|
||||||
syntax match gomodVersion "v[2-9]\{1}\d\?\.0\.0-\d\{14\}-\x\+\%(+incompatible\>\)\?"
|
|
||||||
|
|
||||||
|
" match incompatible pseudo versions
|
||||||
|
" incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||||
|
syntax match gomodVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible"
|
||||||
|
" when most recent version before target is a pre-release
|
||||||
|
syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible"
|
||||||
|
" ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^
|
||||||
|
" ^---------------------------------------- semantic version ------------------------------------------------------^
|
||||||
|
" most recent version before the target is X.Y.Z
|
||||||
|
syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible"
|
||||||
|
" ^------- version -------^^---------------- metadata ---------------------^
|
||||||
highlight default link gomodVersion Identifier
|
highlight default link gomodVersion Identifier
|
||||||
|
|
||||||
let b:current_syntax = "gomod"
|
let b:current_syntax = "gomod"
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 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 "=" display
|
|
||||||
syn match graphqlOperator "!" display
|
|
||||||
syn match graphqlOperator "|" display
|
|
||||||
syn match graphqlOperator "\M..." display
|
|
||||||
|
|
||||||
syn keyword graphqlBoolean true false
|
|
||||||
syn keyword graphqlNull null
|
|
||||||
syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" display
|
|
||||||
syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
|
|
||||||
syn region graphqlString start=+"""+ end=+"""+
|
|
||||||
|
|
||||||
syn keyword graphqlKeyword on nextgroup=graphqlType skipwhite
|
|
||||||
|
|
||||||
syn keyword graphqlStructure enum scalar type union nextgroup=graphqlType skipwhite
|
|
||||||
syn keyword graphqlStructure input interface subscription nextgroup=graphqlType skipwhite
|
|
||||||
syn keyword graphqlStructure implements nextgroup=graphqlType skipwhite
|
|
||||||
syn keyword graphqlStructure query mutation fragment nextgroup=graphqlName skipwhite
|
|
||||||
syn keyword graphqlStructure directive nextgroup=graphqlDirective skipwhite
|
|
||||||
syn keyword graphqlStructure extend nextgroup=graphqlStructure skipwhite
|
|
||||||
syn keyword graphqlStructure schema nextgroup=graphqlFold skipwhite
|
|
||||||
|
|
||||||
syn match graphqlDirective "\<@\h\w*\>" display
|
|
||||||
syn match graphqlVariable "\<\$\h\w*\>" display
|
|
||||||
syn match graphqlName "\<\h\w*\>" display
|
|
||||||
syn match graphqlType "\<_*\u\w*\>" display
|
|
||||||
syn match graphqlConstant "\<[A-Z_]\+\>" display
|
|
||||||
|
|
||||||
syn keyword graphqlMetaFields __schema __type __typename
|
|
||||||
|
|
||||||
syn region graphqlFold matchgroup=graphqlBraces start="{" end="}" transparent fold contains=ALLBUT,graphqlStructure
|
|
||||||
syn region graphqlList matchgroup=graphqlBraces start="\[" end="]" 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 graphqlName Identifier
|
|
||||||
hi def link graphqlMetaFields Special
|
|
||||||
hi def link graphqlKeyword Keyword
|
|
||||||
hi def link graphqlStructure Structure
|
|
||||||
hi def link graphqlType Type
|
|
||||||
hi def link graphqlVariable Identifier
|
|
||||||
|
|
||||||
syn sync minlines=500
|
|
||||||
|
|
||||||
let b:current_syntax = 'graphql'
|
|
||||||
48
syntax/hcl.vim
Normal file
48
syntax/hcl.vim
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'hcl') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match hclEqual '='
|
||||||
|
syn match hclSimpleString '"[^\"]*"'
|
||||||
|
syn region hclComment display oneline start='\%\(^\|\s\)#' end='$'
|
||||||
|
syn region hclComment display oneline start='\%\(^\|\s\)//' end='$'
|
||||||
|
syn region hclInterpolation display oneline start='(' end=')' contains=hclInterpolation,hclSimpleString
|
||||||
|
syn region hclSmartString display oneline start='"' end='"\s*$' contains=hclInterpolation
|
||||||
|
|
||||||
|
syn keyword hclRootKeywords variable provider resource nextgroup=hclString,hclString skipwhite
|
||||||
|
syn keyword hclRootKeywords default nextgroup=hclEquals skipwhite
|
||||||
|
|
||||||
|
|
||||||
|
syn keyword hclAwsResourcesKeywords availability_zones desired_capacity force_delete health_check_grace_period health_check_type launch_configuration load_balancers max_size min_size name vpc_zone_identifier nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords allocated_storage availability_zone backup_retention_period backup_window db_subnet_group_name engine engine_version final_snapshot_identifier identifier instance_class iops maintenance_window multi_az name password port publicly_accessible security_group_names skip_final_snapshot username vpc_security_group_ids nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords cidr description ingress name security_group_id security_group_name security_group_owner_id source_security_group_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords description name subnet_ids nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords instance vpc nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords availability_zones health_check healthy_threshold instance_port instance_protocol instances internal interval lb_port lb_protocol listener name security_groups ssl_certificate_id subnets target timeout unhealthy_threshold nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords ami associate_public_ip_address availability_zone ebs_optimized iam_instance_profile instance_type key_name private_ip security_groups source_dest_check subnet_id tags user_data nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords vpc_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords iam_instance_profile image_id instance_type key_name name name_prefix security_groups user_data nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords name records ttl type zone_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords name nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords route_table_id subnet_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords cidr_block gateway_id instance_id route vpc_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords acl bucket nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords cidr_blocks description from_port ingress name owner_id protocol security_groups self tags to_port vpc_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords availability_zone- cidr_block map_public_ip_on_launch vpc_id nextgroup=hclEquals,hclString skipwhite
|
||||||
|
syn keyword hclAwsResourcesKeywords cidr_block enable_dns_hostnames enable_dns_support tags nextgroup=hclEquals,hclString skipwhite
|
||||||
|
|
||||||
|
|
||||||
|
hi def link hclComment Comment
|
||||||
|
hi def link hclEqual Operator
|
||||||
|
hi def link hclRootKeywords Statement
|
||||||
|
hi def link hclAwsResourcesKeywords Type
|
||||||
|
hi def link hclSmartString String
|
||||||
|
hi def link hclInterpolation String
|
||||||
|
hi def link hclSimpleString PreProc
|
||||||
|
|
||||||
|
let b:current_syntax = "hcl"
|
||||||
139
syntax/hive.vim
Normal file
139
syntax/hive.vim
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'hive') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: HIVE Query Language
|
||||||
|
" Maintainer: German Lashevich <german.lashevich@gmail.com>
|
||||||
|
" Last Change: 2019-04-30
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
syn keyword sqlSpecial false null true
|
||||||
|
|
||||||
|
syn keyword sqlKeyword access add as asc begin check cluster column
|
||||||
|
syn keyword sqlKeyword compress connect current cursor decimal default desc
|
||||||
|
syn keyword sqlKeyword if else elsif end exception exclusive file for from
|
||||||
|
syn keyword sqlKeyword function having identified immediate increment
|
||||||
|
syn keyword sqlKeyword index initial into level loop maxextents mode modify
|
||||||
|
syn keyword sqlKeyword nocompress nowait of offline on online start
|
||||||
|
syn keyword sqlKeyword successful synonym table partition then to trigger uid
|
||||||
|
syn keyword sqlKeyword unique user validate values view whenever hivevar
|
||||||
|
syn keyword sqlKeyword where with option pctfree privileges procedure limit
|
||||||
|
syn keyword sqlKeyword public resource return row rowlabel rownum rows
|
||||||
|
syn keyword sqlKeyword session share size smallint type using cross full outer left join right inner
|
||||||
|
syn keyword sqlKeyword format delimited fields terminated collection items external window msck repair
|
||||||
|
syn keyword sqlKeyword stored sequencefile partitioned data local inpath overwrite clustered buckets sorted
|
||||||
|
syn keyword sqlKeyword keys extended textfile location distribute directory tablesample using reduce lateral
|
||||||
|
syn keyword sqlKeyword case when database serde serdeproperties inputformat outputformat over
|
||||||
|
syn keyword sqlKeyword unbounded preceding parquet tblproperties
|
||||||
|
|
||||||
|
syn keyword sqlKeyword dmin after archive before bucket cascade change
|
||||||
|
syn keyword sqlKeyword lusterstatus columns compact compactions compute
|
||||||
|
syn keyword sqlKeyword oncatenate continue databases datetime dbproperties
|
||||||
|
syn keyword sqlKeyword eferred defined dependency directories disable elem_type
|
||||||
|
syn keyword sqlKeyword nable escaped export fileformat first formatted
|
||||||
|
syn keyword sqlKeyword unctions hold_ddltime idxproperties ignore indexes
|
||||||
|
syn keyword sqlKeyword nputdriver jar key_type lines locks logical long mapjoin
|
||||||
|
syn keyword sqlKeyword aterialized metadata noscan no_drop outputdriver owner
|
||||||
|
syn keyword sqlKeyword artitions plus pretty principals protection purge read
|
||||||
|
syn keyword sqlKeyword eadonly rebuild recordreader recordwriter reload replace
|
||||||
|
syn keyword sqlKeyword eplication restrict rewrite role roles schema schemas
|
||||||
|
syn keyword sqlKeyword emi server sets shared show show_database skewed sort
|
||||||
|
syn keyword sqlKeyword sl statistics streamtable tables temporary touch
|
||||||
|
syn keyword sqlKeyword ransactions unarchive undo uniontype unlock unset
|
||||||
|
syn keyword sqlKeyword nsigned uri utc utctimestamp value_type while
|
||||||
|
syn keyword sqlKeyword uthorization both by conf cube current_timestamp
|
||||||
|
syn keyword sqlKeyword xchange fetch following group grouping import interval
|
||||||
|
syn keyword sqlKeyword ess macro more none order partialscan percent preserve
|
||||||
|
syn keyword sqlKeyword ange reads rollup uniquejoin utc_tmestamp autocommit
|
||||||
|
syn keyword sqlKeyword solation offset snapshot transaction work write only
|
||||||
|
syn keyword sqlKeyword bort key last norely novalidate nulls rely cache
|
||||||
|
syn keyword sqlKeyword onstraint foreign primary references detail dow
|
||||||
|
syn keyword sqlKeyword xpression operator quarter summary vectorization week
|
||||||
|
syn keyword sqlKeyword ears months weeks days hours minutes seconds dayofweek
|
||||||
|
syn keyword sqlKeyword xtract integer precision views timestamptz zone time
|
||||||
|
syn keyword sqlKeyword umeric sync
|
||||||
|
|
||||||
|
syn match sqlKeyword 'group\s\+by'
|
||||||
|
syn match sqlKeyword 'order\s\+by'
|
||||||
|
|
||||||
|
syn keyword sqlOperator not and or < <= == >= > <> != is
|
||||||
|
syn keyword sqlOperator in any some all between exists
|
||||||
|
syn keyword sqlOperator like escape rlike regexp
|
||||||
|
syn keyword sqlOperator union intersect minus
|
||||||
|
syn keyword sqlOperator prior distinct isnull count
|
||||||
|
syn keyword sqlOperator sysdate out
|
||||||
|
syn keyword sqlOperator round floor ceil rand concat substr upper ucase
|
||||||
|
syn keyword sqlOperator lower lcase trim ltrim rtrim regexp_replace size
|
||||||
|
syn keyword sqlOperator coalesce cast from_unixtime to_date year month day get_json_object
|
||||||
|
syn keyword sqlOperator current_date add_months row_number date_format first_value
|
||||||
|
syn keyword sqlOperator sum avg min max transform
|
||||||
|
syn keyword sqlOperator variance var_samp stddev_pop stddev_samp
|
||||||
|
syn keyword sqlOperator covar_pop covar_samp corr percentile percentil_approx
|
||||||
|
syn keyword sqlOperator histogram_numeric collect_set inline explode
|
||||||
|
syn keyword sqlOperator exp ln log10 log2 log pow sqrt bin hex unhex conv
|
||||||
|
syn keyword sqlOperator abs pmod sin asin cos acos tan atan degrees radians
|
||||||
|
syn keyword sqlOperator positive negative sign e pi binary
|
||||||
|
syn keyword sqlOperator map_keys map_values array_contains sort_array
|
||||||
|
syn keyword sqlOperator unix_timestamp dayofmonth hour minute second weekofyear
|
||||||
|
syn keyword sqlOperator datediff date_add date_sub from_utc_timestamp to_utc_timestamp
|
||||||
|
syn keyword sqlOperator ascii context_ngrams concate_ws find_in_set format_number
|
||||||
|
syn keyword sqlOperator in_file instr length locate lpad ltrim ngrams parse_url
|
||||||
|
syn keyword sqlOperator printf regexp_extract repeat reverse rpad trim sentences
|
||||||
|
syn keyword sqlOperator space split str_to_map translate trim java_method reflect
|
||||||
|
syn keyword sqlOperator xpath xpath_string xpath_boolean xpath_short xpath_int xpath_long xpath_float xpath_double xpath_number
|
||||||
|
|
||||||
|
syn keyword sqlStatement alter analyze audit comment commit create
|
||||||
|
syn keyword sqlStatement delete drop execute explain grant insert lock noaudit
|
||||||
|
syn keyword sqlStatement rename revoke rollback savepoint select set
|
||||||
|
syn keyword sqlStatement truncate update describe load use
|
||||||
|
|
||||||
|
syn keyword sqlType tinyint smallint int bigint float double boolean string
|
||||||
|
syn keyword sqlType array map struct named_struct create_union timestamp date varchar char
|
||||||
|
|
||||||
|
syn match hiveVar "hive\.[a-zA-Z.]\+"
|
||||||
|
syn match hiveVar "mapred\.[a-zA-Z.]\+"
|
||||||
|
|
||||||
|
" Strings and characters:
|
||||||
|
syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||||
|
syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||||
|
|
||||||
|
" Numbers:
|
||||||
|
syn match sqlNumber "[-+]\=\d\+[ISL]\="
|
||||||
|
" Floating point number with decimal no E or e
|
||||||
|
syn match sqlNumber '[-+]\=\d\+\.\d\+'
|
||||||
|
" Floating point like number with E and no decimal point (+,-)
|
||||||
|
syn match sqlNumber '[-+]\=\d[[:digit:]]*[eE][\-+]\=\d\+'
|
||||||
|
syn match sqlNumber '\d[[:digit:]]*[eE][\-+]\=\d\+'
|
||||||
|
" Floating point like number with E and decimal point (+,-)
|
||||||
|
syn match sqlNumber '[-+]\=\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+'
|
||||||
|
syn match sqlNumber '\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+'
|
||||||
|
|
||||||
|
" Comments:
|
||||||
|
syn region sqlComment start="/\*" end="\*/" contains=sqlTodo
|
||||||
|
syn match sqlComment "--.*$" contains=sqlTodo
|
||||||
|
|
||||||
|
syn sync ccomment sqlComment
|
||||||
|
|
||||||
|
" Todo
|
||||||
|
syn keyword sqlTodo contained TODO FIXME XXX DEBUG NOTE
|
||||||
|
|
||||||
|
hi link sqlComment Comment
|
||||||
|
hi link sqlKeyword Identifier
|
||||||
|
hi link sqlNumber Number
|
||||||
|
hi link sqlOperator Constant
|
||||||
|
hi link sqlSpecial Special
|
||||||
|
hi link sqlStatement Statement
|
||||||
|
hi link sqlString String
|
||||||
|
hi link sqlType Type
|
||||||
|
hi link sqlTodo Todo
|
||||||
|
hi link hiveVar Special
|
||||||
|
|
||||||
|
let b:current_syntax = "hive"
|
||||||
|
|
||||||
|
" vim: ts=4
|
||||||
@@ -5,8 +5,8 @@ endif
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: i3 config file
|
" Language: i3 config file
|
||||||
" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
||||||
" Version: 0.3
|
" Version: 0.4
|
||||||
" Last Change: 2017-10-27 23:59
|
" Last Change: 2019-03-23 21:54
|
||||||
|
|
||||||
" References:
|
" References:
|
||||||
" http://i3wm.org/docs/userguide.html#configuring
|
" http://i3wm.org/docs/userguide.html#configuring
|
||||||
@@ -24,231 +24,231 @@ en
|
|||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
" Error
|
" Error
|
||||||
syn match Error /.*/
|
syn match i3ConfigError /.*/
|
||||||
|
|
||||||
" Todo
|
" Todo
|
||||||
syn keyword Todo TODO FIXME XXX contained
|
syn keyword i3ConfigTodo TODO FIXME XXX contained
|
||||||
|
|
||||||
" Comment
|
" Comment
|
||||||
" Comments are started with a # and can only be used at the beginning of a line
|
" Comments are started with a # and can only be used at the beginning of a line
|
||||||
syn match Comment /^\s*#.*$/ contains=Todo
|
syn match i3ConfigComment /^\s*#.*$/ contains=i3ConfigTodo
|
||||||
|
|
||||||
" Font
|
" Font
|
||||||
" A FreeType font description is composed by:
|
" A FreeType font description is composed by:
|
||||||
" a font family, a style, a weight, a variant, a stretch and a size.
|
" a font family, a style, a weight, a variant, a stretch and a size.
|
||||||
syn match FontSeparator /,/ contained
|
syn match i3ConfigFontSeparator /,/ contained
|
||||||
syn match FontSeparator /:/ contained
|
syn match i3ConfigFontSeparator /:/ contained
|
||||||
syn keyword FontKeyword font contained
|
syn keyword i3ConfigFontKeyword font contained
|
||||||
syn match FontNamespace /\w\+:/ contained contains=FontSeparator
|
syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigFontSeparator
|
||||||
syn match FontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=FontNamespace,FontSeparator,FontKeyword
|
syn match i3ConfigFontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=i3ConfigFontNamespace,i3ConfigFontSeparator,i3ConfigFontKeyword
|
||||||
syn match FontSize /\s\=\d\+\(px\)\?\s\?$/ contained
|
syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained
|
||||||
syn match Font /^\s*font\s\+.*$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
|
syn match i3ConfigFont /^\s*font\s\+.*$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||||
"syn match Font /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
|
"syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||||
"syn match Font /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
|
"syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||||
"syn match Font /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=FontContent,FontSeparator,FontSize,FontNamespace
|
"syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||||
|
|
||||||
" variables
|
" variables
|
||||||
syn match String /\(['"]\)\(.\{-}\)\1/ contained
|
syn match i3ConfigString /\(['"]\)\(.\{-}\)\1/ contained
|
||||||
syn match Color /#\w\{6}/ contained
|
syn match i3ConfigColor /#\w\{6}/ contained
|
||||||
syn match VariableModifier /+/ contained
|
syn match i3ConfigVariableModifier /+/ contained
|
||||||
syn match VariableAndModifier /+\w\+/ contained contains=VariableModifier
|
syn match i3ConfigVariableAndModifier /+\w\+/ contained contains=i3ConfigVariableModifier
|
||||||
syn match Variable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=VariableModifier,VariableAndModifier
|
syn match i3ConfigVariable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=i3ConfigVariableModifier,i3ConfigVariableAndModifier
|
||||||
syn keyword InitializeKeyword set contained
|
syn keyword i3ConfigInitializeKeyword set contained
|
||||||
syn match Initialize /^\s*set\s\+.*$/ contains=Variable,InitializeKeyword,Color,String
|
syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString
|
||||||
|
|
||||||
" Gaps
|
" Gaps
|
||||||
syn keyword GapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle contained
|
syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle contained
|
||||||
syn match GapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(\d\+\|\$.*\)\)$/ contains=GapStyleKeyword,number,Variable
|
syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,number,i3ConfigVariable
|
||||||
syn keyword SmartGapKeyword on inverse_outer contained
|
syn keyword i3ConfigSmartGapKeyword on inverse_outer contained
|
||||||
syn match SmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=SmartGapKeyword
|
syn match i3ConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=i3ConfigSmartGapKeyword
|
||||||
syn keyword SmartBorderKeyword on no_gaps contained
|
syn keyword i3ConfigSmartBorderKeyword on no_gaps contained
|
||||||
syn match SmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=SmartBorderKeyword
|
syn match i3ConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=i3ConfigSmartBorderKeyword
|
||||||
|
|
||||||
" Keyboard bindings
|
" Keyboard bindings
|
||||||
syn keyword Action toggle fullscreen restart key import kill shrink grow contained
|
syn keyword i3ConfigAction toggle fullscreen restart key import kill shrink grow contained
|
||||||
syn keyword Action focus move split layout resize restore reload mute unmute exit contained
|
syn keyword i3ConfigAction focus move split layout resize restore reload mute unmute exit contained
|
||||||
syn match Modifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=VariableModifier
|
syn match i3ConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=i3ConfigVariableModifier
|
||||||
syn match Number /\s\d\+/ contained
|
syn match i3ConfigNumber /\s\d\+/ contained
|
||||||
syn keyword BindKeyword bindsym bindcode exec gaps contained
|
syn keyword i3ConfigBindKeyword bindsym bindcode exec gaps contained
|
||||||
syn match BindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained
|
syn match i3ConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained
|
||||||
syn match Bind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=Variable,BindKeyword,VariableAndModifier,BindArgument,Number,Modifier,Action,String,GapStyleKeyword
|
syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigBindArgument,i3ConfigNumber,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword
|
||||||
|
|
||||||
" Floating
|
" Floating
|
||||||
syn keyword SizeSpecial x contained
|
syn keyword i3ConfigSizeSpecial x contained
|
||||||
syn match NegativeSize /-/ contained
|
syn match i3ConfigNegativeSize /-/ contained
|
||||||
syn match Size /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=SizeSpecial,Number,NegativeSize
|
syn match i3ConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber,i3ConfigNegativeSize
|
||||||
syn match Floating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=Variable
|
syn match i3ConfigFloating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=i3ConfigVariable
|
||||||
syn match Floating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=Size
|
syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=Size
|
||||||
|
|
||||||
" Orientation
|
" Orientation
|
||||||
syn keyword OrientationKeyword vertical horizontal auto contained
|
syn keyword i3ConfigOrientationKeyword vertical horizontal auto contained
|
||||||
syn match Orientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=OrientationKeyword
|
syn match i3ConfigOrientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=i3ConfigOrientationKeyword
|
||||||
|
|
||||||
" Layout
|
" Layout
|
||||||
syn keyword LayoutKeyword default stacking tabbed contained
|
syn keyword i3ConfigLayoutKeyword default stacking tabbed contained
|
||||||
syn match Layout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\s\?$/ contains=LayoutKeyword
|
syn match i3ConfigLayout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\s\?$/ contains=i3ConfigLayoutKeyword
|
||||||
|
|
||||||
" Border style
|
" Border style
|
||||||
syn keyword BorderStyleKeyword none normal pixel contained
|
syn keyword i3ConfigBorderStyleKeyword none normal pixel contained
|
||||||
syn match BorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=BorderStyleKeyword,number
|
syn match i3ConfigBorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=i3ConfigBorderStyleKeyword,number
|
||||||
|
|
||||||
" Hide borders and edges
|
" Hide borders and edges
|
||||||
syn keyword EdgeKeyword none vertical horizontal both smart smart_no_gaps contained
|
syn keyword i3ConfigEdgeKeyword none vertical horizontal both smart smart_no_gaps contained
|
||||||
syn match Edge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\|smart\|smart_no_gaps\)\s\?$/ contains=EdgeKeyword
|
syn match i3ConfigEdge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\|smart\|smart_no_gaps\)\s\?$/ contains=i3ConfigEdgeKeyword
|
||||||
|
|
||||||
" Arbitrary commands for specific windows (for_window)
|
" Arbitrary commands for specific windows (for_window)
|
||||||
syn keyword CommandKeyword for_window contained
|
syn keyword i3ConfigCommandKeyword for_window contained
|
||||||
syn region WindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=String
|
syn region i3ConfigWindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=i3ConfigString
|
||||||
syn region WindowCommandSpecial start="\[" end="\]" contained contains=WindowStringSpacial,String
|
syn region i3ConfigWindowCommandSpecial start="\[" end="\]" contained contains=WindowStringSpacial,i3ConfigString
|
||||||
syn match ArbitraryCommand /^\s*for_window\s\+.*$/ contains=WindowCommandSpecial,CommandKeyword,BorderStyleKeyword,LayoutKeyword,OrientationKeyword,Size,Number
|
syn match i3ConfigArbitraryCommand /^\s*for_window\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigCommandKeyword,i3ConfigBorderStyleKeyword,i3ConfigLayoutKeyword,i3ConfigOrientationKeyword,Size,i3ConfigNumber
|
||||||
|
|
||||||
" Disable focus open opening
|
" Disable focus open opening
|
||||||
syn keyword NoFocusKeyword no_focus contained
|
syn keyword i3ConfigNoFocusKeyword no_focus contained
|
||||||
syn match DisableFocus /^\s*no_focus\s\+.*$/ contains=WindowCommandSpecial,NoFocusKeyword
|
syn match i3ConfigDisableFocus /^\s*no_focus\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigNoFocusKeyword
|
||||||
|
|
||||||
" Move client to specific workspace automatically
|
" Move client to specific workspace automatically
|
||||||
syn keyword AssignKeyword assign contained
|
syn keyword i3ConfigAssignKeyword assign contained
|
||||||
syn match AssignSpecial /→/ contained
|
syn match i3ConfigAssignSpecial /→/ contained
|
||||||
syn match Assign /^\s*assign\s\+.*$/ contains=AssignKeyword,WindowCommandSpecial,AssignSpecial
|
syn match i3ConfigAssign /^\s*assign\s\+.*$/ contains=i3ConfigAssignKeyword,i3ConfigWindowCommandSpecial,i3ConfigAssignSpecial
|
||||||
|
|
||||||
" X resources
|
" X resources
|
||||||
syn keyword ResourceKeyword set_from_resource contained
|
syn keyword i3ConfigResourceKeyword set_from_resource contained
|
||||||
syn match Resource /^\s*set_from_resource\s\+.*$/ contains=ResourceKeyword,WindowCommandSpecial,Color,Variable
|
syn match i3ConfigResource /^\s*set_from_resource\s\+.*$/ contains=i3ConfigResourceKeyword,i3ConfigWindowCommandSpecial,i3ConfigColor,i3ConfigVariable
|
||||||
|
|
||||||
" Auto start applications
|
" Auto start applications
|
||||||
syn keyword ExecKeyword exec exec_always contained
|
syn keyword i3ConfigExecKeyword exec exec_always contained
|
||||||
syn match NoStartupId /--no-startup-id/ contained " We are not using BindArgument as only no-startup-id is supported here
|
syn match i3ConfigNoStartupId /--no-startup-id/ contained " We are not using i3ConfigBindArgument as only no-startup-id is supported here
|
||||||
syn match Exec /^\s*exec\(_always\)\?\s\+.*$/ contains=ExecKeyword,NoStartupId,String
|
syn match i3ConfigExec /^\s*exec\(_always\)\?\s\+.*$/ contains=i3ConfigExecKeyword,i3ConfigNoStartupId,i3ConfigString
|
||||||
|
|
||||||
" Automatically putting workspaces on specific screens
|
" Automatically putting workspaces on specific screens
|
||||||
syn keyword WorkspaceKeyword workspace contained
|
syn keyword i3ConfigWorkspaceKeyword workspace contained
|
||||||
syn keyword Output output contained
|
syn keyword i3ConfigOutput output contained
|
||||||
syn match Workspace /^\s*workspace\s\+.*$/ contains=WorkspaceKeyword,Number,String,Output
|
syn match i3ConfigWorkspace /^\s*workspace\s\+.*$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigOutput
|
||||||
|
|
||||||
" Changing colors
|
" Changing colors
|
||||||
syn keyword ClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
|
syn keyword i3ConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
|
||||||
syn match ClientColor /^\s*client.\w\+\s\+.*$/ contains=ClientColorKeyword,Color,Variable
|
syn match i3ConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable
|
||||||
|
|
||||||
" Interprocess communication
|
" Interprocess communication
|
||||||
syn match InterprocessKeyword /ipc-socket/ contained
|
syn match i3ConfigInterprocessKeyword /ipc-socket/ contained
|
||||||
syn match Interprocess /^\s*ipc-socket\s\+.*$/ contains=InterprocessKeyword
|
syn match i3ConfigInterprocess /^\s*ipc-socket\s\+.*$/ contains=i3ConfigInterprocessKeyword
|
||||||
|
|
||||||
" Mouse warping
|
" Mouse warping
|
||||||
syn keyword MouseWarpingKeyword mouse_warping contained
|
syn keyword i3ConfigMouseWarpingKeyword mouse_warping contained
|
||||||
syn keyword MouseWarpingType output none contained
|
syn keyword i3ConfigMouseWarpingType output none contained
|
||||||
syn match MouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ contains=MouseWarpingKeyword,MouseWarpingType
|
syn match i3ConfigMouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ contains=i3ConfigMouseWarpingKeyword,i3ConfigMouseWarpingType
|
||||||
|
|
||||||
" Focus follows mouse
|
" Focus follows mouse
|
||||||
syn keyword FocusFollowsMouseKeyword focus_follows_mouse contained
|
syn keyword i3ConfigFocusFollowsMouseKeyword focus_follows_mouse contained
|
||||||
syn keyword FocusFollowsMouseType yes no contained
|
syn keyword i3ConfigFocusFollowsMouseType yes no contained
|
||||||
syn match FocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=FocusFollowsMouseKeyword,FocusFollowsMouseType
|
syn match i3ConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusFollowsMouseKeyword,i3ConfigFocusFollowsMouseType
|
||||||
|
|
||||||
" Popups during fullscreen mode
|
" Popups during fullscreen mode
|
||||||
syn keyword PopupOnFullscreenKeyword popup_during_fullscreen contained
|
syn keyword i3ConfigPopupOnFullscreenKeyword popup_during_fullscreen contained
|
||||||
syn keyword PopuponFullscreenType smart ignore leave_fullscreen contained
|
syn keyword i3ConfigPopuponFullscreenType smart ignore leave_fullscreen contained
|
||||||
syn match PopupOnFullscreen /^\s*popup_during_fullscreen\s\+\w\+\s\?$/ contains=PopupOnFullscreenKeyword,PopupOnFullscreenType
|
syn match i3ConfigPopupOnFullscreen /^\s*popup_during_fullscreen\s\+\w\+\s\?$/ contains=i3ConfigPopupOnFullscreenKeyword,i3ConfigPopupOnFullscreenType
|
||||||
|
|
||||||
" Focus wrapping
|
" Focus wrapping
|
||||||
syn keyword FocusWrappingKeyword force_focus_wrapping focus_wrapping contained
|
syn keyword i3ConfigFocusWrappingKeyword force_focus_wrapping focus_wrapping contained
|
||||||
syn keyword FocusWrappingType yes no contained
|
syn keyword i3ConfigFocusWrappingType yes no contained
|
||||||
syn match FocusWrapping /^\s*\(force_\)\?focus_wrapping\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,FocusWrappingKeyword
|
syn match i3ConfigFocusWrapping /^\s*\(force_\)\?focus_wrapping\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigFocusWrappingKeyword
|
||||||
|
|
||||||
" Forcing Xinerama
|
" Forcing Xinerama
|
||||||
syn keyword ForceXineramaKeyword force_xinerama contained
|
syn keyword i3ConfigForceXineramaKeyword force_xinerama contained
|
||||||
syn match ForceXinerama /^\s*force_xinerama\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,ForceXineramaKeyword
|
syn match i3ConfigForceXinerama /^\s*force_xinerama\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigForceXineramaKeyword
|
||||||
|
|
||||||
" Automatic back-and-forth when switching to the current workspace
|
" Automatic back-and-forth when switching to the current workspace
|
||||||
syn keyword AutomaticSwitchKeyword workspace_auto_back_and_forth contained
|
syn keyword i3ConfigAutomaticSwitchKeyword workspace_auto_back_and_forth contained
|
||||||
syn match AutomaticSwitch /^\s*workspace_auto_back_and_forth\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,AutomaticSwitchKeyword
|
syn match i3ConfigAutomaticSwitch /^\s*workspace_auto_back_and_forth\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigAutomaticSwitchKeyword
|
||||||
|
|
||||||
" Delay urgency hint
|
" Delay urgency hint
|
||||||
syn keyword TimeUnit ms contained
|
syn keyword i3ConfigTimeUnit ms contained
|
||||||
syn keyword DelayUrgencyKeyword force_display_urgency_hint contained
|
syn keyword i3ConfigDelayUrgencyKeyword force_display_urgency_hint contained
|
||||||
syn match DelayUrgency /^\s*force_display_urgency_hint\s\+\d\+\s\+ms\s\?$/ contains=FocusWrappingType,DelayUrgencyKeyword,Number,TimeUnit
|
syn match i3ConfigDelayUrgency /^\s*force_display_urgency_hint\s\+\d\+\s\+ms\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDelayUrgencyKeyword,i3ConfigNumber,i3ConfigTimeUnit
|
||||||
|
|
||||||
" Focus on window activation
|
" Focus on window activation
|
||||||
syn keyword FocusOnActivationKeyword focus_on_window_activation contained
|
syn keyword i3ConfigFocusOnActivationKeyword focus_on_window_activation contained
|
||||||
syn keyword FocusOnActivationType smart urgent focus none contained
|
syn keyword i3ConfigFocusOnActivationType smart urgent focus none contained
|
||||||
syn match FocusOnActivation /^\s*focus_on_window_activation\s\+\(smart\|urgent\|focus\|none\)\s\?$/ contains=FocusOnActivationKeyword,FocusOnActivationType
|
syn match i3ConfigFocusOnActivation /^\s*focus_on_window_activation\s\+\(smart\|urgent\|focus\|none\)\s\?$/ contains=i3ConfigFocusOnActivationKeyword,i3ConfigFocusOnActivationType
|
||||||
|
|
||||||
" Automatic back-and-forth when switching to the current workspace
|
" Automatic back-and-forth when switching to the current workspace
|
||||||
syn keyword DrawingMarksKeyword show_marks contained
|
syn keyword i3ConfigDrawingMarksKeyword show_marks contained
|
||||||
syn match DrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,DrawingMarksKeyword
|
syn match i3ConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=i3ConfigFocusWrappingType,i3ConfigDrawingMarksKeyword
|
||||||
|
|
||||||
" Group mode/bar
|
" Group mode/bar
|
||||||
syn keyword BlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
|
syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
|
||||||
syn region Block start=+.*s\?{$+ end=+^}$+ contains=BlockKeyword,String,Bind,Comment,Font,FocusWrappingType,Color,Variable transparent keepend extend
|
syn region i3ConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,Bind,i3ConfigComment,Font,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||||
|
|
||||||
" Line continuation
|
" Line continuation
|
||||||
syn region LineCont start=/^.*\\$/ end=/^.*$/ contains=BlockKeyword,String,Bind,Comment,Font,FocusWrappingType,Color,Variable transparent keepend extend
|
syn region i3ConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=i3ConfigBlockKeyword,i3ConfigString,Bind,i3ConfigComment,Font,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||||
|
|
||||||
" Define the highlighting.
|
" Define the highlighting.
|
||||||
hi! def link Error Error
|
hi! def link i3ConfigError Error
|
||||||
hi! def link Todo Todo
|
hi! def link i3ConfigTodo Todo
|
||||||
hi! def link Comment Comment
|
hi! def link i3ConfigComment Comment
|
||||||
hi! def link FontContent Type
|
hi! def link i3ConfigFontContent Type
|
||||||
hi! def link FocusOnActivationType Type
|
hi! def link i3ConfigFocusOnActivationType Type
|
||||||
hi! def link PopupOnFullscreenType Type
|
hi! def link i3ConfigPopupOnFullscreenType Type
|
||||||
hi! def link OrientationKeyword Type
|
hi! def link i3ConfigOrientationKeyword Type
|
||||||
hi! def link MouseWarpingType Type
|
hi! def link i3ConfigMouseWarpingType Type
|
||||||
hi! def link FocusFollowsMouseType Type
|
hi! def link i3ConfigFocusFollowsMouseType Type
|
||||||
hi! def link GapStyleKeyword Type
|
hi! def link i3ConfigGapStyleKeyword Type
|
||||||
hi! def link SmartGapKeyword Type
|
hi! def link i3ConfigSmartGapKeyword Type
|
||||||
hi! def link SmartBorderKeyword Type
|
hi! def link i3ConfigSmartBorderKeyword Type
|
||||||
hi! def link LayoutKeyword Type
|
hi! def link i3ConfigLayoutKeyword Type
|
||||||
hi! def link BorderStyleKeyword Type
|
hi! def link i3ConfigBorderStyleKeyword Type
|
||||||
hi! def link EdgeKeyword Type
|
hi! def link i3ConfigEdgeKeyword Type
|
||||||
hi! def link Action Type
|
hi! def link i3ConfigAction Type
|
||||||
hi! def link Command Type
|
hi! def link i3ConfigCommand Type
|
||||||
hi! def link Output Type
|
hi! def link i3ConfigOutput Type
|
||||||
hi! def link WindowCommandSpecial Type
|
hi! def link i3ConfigWindowCommandSpecial Type
|
||||||
hi! def link FocusWrappingType Type
|
hi! def link i3ConfigFocusWrappingType Type
|
||||||
hi! def link FontSize Constant
|
hi! def link i3ConfigFontSize Constant
|
||||||
hi! def link Color Constant
|
hi! def link i3ConfigColor Constant
|
||||||
hi! def link Number Constant
|
hi! def link i3ConfigNumber Constant
|
||||||
hi! def link VariableAndModifier Constant
|
hi! def link i3ConfigVariableAndModifier Constant
|
||||||
hi! def link TimeUnit Constant
|
hi! def link i3ConfigTimeUnit Constant
|
||||||
hi! def link Modifier Constant
|
hi! def link i3ConfigModifier Constant
|
||||||
hi! def link String Constant
|
hi! def link i3ConfigString Constant
|
||||||
hi! def link NegativeSize Constant
|
hi! def link i3ConfigNegativeSize Constant
|
||||||
hi! def link FontSeparator Special
|
hi! def link i3ConfigFontSeparator Special
|
||||||
hi! def link VariableModifier Special
|
hi! def link i3ConfigVariableModifier Special
|
||||||
hi! def link SizeSpecial Special
|
hi! def link i3ConfigSizeSpecial Special
|
||||||
hi! def link WindowSpecial Special
|
hi! def link i3ConfigWindowSpecial Special
|
||||||
hi! def link AssignSpecial Special
|
hi! def link i3ConfigAssignSpecial Special
|
||||||
hi! def link FontNamespace PreProc
|
hi! def link i3ConfigFontNamespace PreProc
|
||||||
hi! def link BindArgument PreProc
|
hi! def link i3ConfigBindArgument PreProc
|
||||||
hi! def link NoStartupId PreProc
|
hi! def link i3ConfigNoStartupId PreProc
|
||||||
hi! def link FontKeyword Identifier
|
hi! def link i3ConfigFontKeyword Identifier
|
||||||
hi! def link BindKeyword Identifier
|
hi! def link i3ConfigBindKeyword Identifier
|
||||||
hi! def link Orientation Identifier
|
hi! def link i3ConfigOrientation Identifier
|
||||||
hi! def link GapStyle Identifier
|
hi! def link i3ConfigGapStyle Identifier
|
||||||
hi! def link SmartGap Identifier
|
hi! def link i3ConfigSmartGap Identifier
|
||||||
hi! def link SmartBorder Identifier
|
hi! def link i3ConfigSmartBorder Identifier
|
||||||
hi! def link Layout Identifier
|
hi! def link i3ConfigLayout Identifier
|
||||||
hi! def link BorderStyle Identifier
|
hi! def link i3ConfigBorderStyle Identifier
|
||||||
hi! def link Edge Identifier
|
hi! def link i3ConfigEdge Identifier
|
||||||
hi! def link Floating Identifier
|
hi! def link i3ConfigFloating Identifier
|
||||||
hi! def link CommandKeyword Identifier
|
hi! def link i3ConfigCommandKeyword Identifier
|
||||||
hi! def link NoFocusKeyword Identifier
|
hi! def link i3ConfigNoFocusKeyword Identifier
|
||||||
hi! def link InitializeKeyword Identifier
|
hi! def link i3ConfigInitializeKeyword Identifier
|
||||||
hi! def link AssignKeyword Identifier
|
hi! def link i3ConfigAssignKeyword Identifier
|
||||||
hi! def link ResourceKeyword Identifier
|
hi! def link i3ConfigResourceKeyword Identifier
|
||||||
hi! def link ExecKeyword Identifier
|
hi! def link i3ConfigExecKeyword Identifier
|
||||||
hi! def link WorkspaceKeyword Identifier
|
hi! def link i3ConfigWorkspaceKeyword Identifier
|
||||||
hi! def link ClientColorKeyword Identifier
|
hi! def link i3ConfigClientColorKeyword Identifier
|
||||||
hi! def link InterprocessKeyword Identifier
|
hi! def link i3ConfigInterprocessKeyword Identifier
|
||||||
hi! def link MouseWarpingKeyword Identifier
|
hi! def link i3ConfigMouseWarpingKeyword Identifier
|
||||||
hi! def link FocusFollowsMouseKeyword Identifier
|
hi! def link i3ConfigFocusFollowsMouseKeyword Identifier
|
||||||
hi! def link PopupOnFullscreenKeyword Identifier
|
hi! def link i3ConfigPopupOnFullscreenKeyword Identifier
|
||||||
hi! def link FocusWrappingKeyword Identifier
|
hi! def link i3ConfigFocusWrappingKeyword Identifier
|
||||||
hi! def link ForceXineramaKeyword Identifier
|
hi! def link i3ConfigForceXineramaKeyword Identifier
|
||||||
hi! def link AutomaticSwitchKeyword Identifier
|
hi! def link i3ConfigAutomaticSwitchKeyword Identifier
|
||||||
hi! def link DelayUrgencyKeyword Identifier
|
hi! def link i3ConfigDelayUrgencyKeyword Identifier
|
||||||
hi! def link FocusOnActivationKeyword Identifier
|
hi! def link i3ConfigFocusOnActivationKeyword Identifier
|
||||||
hi! def link DrawingMarksKeyword Identifier
|
hi! def link i3ConfigDrawingMarksKeyword Identifier
|
||||||
hi! def link BlockKeyword Identifier
|
hi! def link i3ConfigBlockKeyword Identifier
|
||||||
hi! def link Variable Statement
|
hi! def link i3ConfigVariable Statement
|
||||||
hi! def link ArbitraryCommand Type
|
hi! def link i3ConfigArbitraryCommand Type
|
||||||
|
|
||||||
let b:current_syntax = "i3config"
|
let b:current_syntax = "i3config"
|
||||||
|
|||||||
87
syntax/ion.vim
Normal file
87
syntax/ion.vim
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'ion') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if v:version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists('b:current_syntax')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn region ionDoubleQuote start='"' skip='\'' end='"' contains=ionArrayVar,ionVariable,ionProcess
|
||||||
|
syn region ionSingleQuote start='\'' skip='"' end='\''
|
||||||
|
syn region ionArrayVar start="@{" end="}"
|
||||||
|
syn match ionArrayVar "@[a-zA-Z0-9_]\+"
|
||||||
|
syn region ionVariable start="${" end="}"
|
||||||
|
syn match ionVariable "$[a-zA-Z0-9_]\+"
|
||||||
|
syn region ionProcess start="$(" end=")" transparent
|
||||||
|
syn region ionProcess start="@(" end=")" transparent
|
||||||
|
syn match ionNumber '[+-]\?\([0-9]*[.]\)\?[0-9]\+'
|
||||||
|
syn match ionComment '[#].*$'
|
||||||
|
syn match ionOperator '&'
|
||||||
|
syn match ionOperator '&&'
|
||||||
|
syn match ionOperator '||'
|
||||||
|
syn match ionOperator '[|<>&]'
|
||||||
|
syn match ionFlag '[ ]\([-]\)\w\+'
|
||||||
|
|
||||||
|
syntax keyword ionKeyword .
|
||||||
|
syntax keyword ionKeyword ..
|
||||||
|
syntax keyword ionKeyword alias
|
||||||
|
syntax keyword ionKeyword and
|
||||||
|
syntax keyword ionKeyword bg
|
||||||
|
syntax keyword ionKeyword break
|
||||||
|
syntax keyword ionKeyword calc
|
||||||
|
syntax keyword ionKeyword case
|
||||||
|
syntax keyword ionKeyword cd
|
||||||
|
syntax keyword ionKeyword complete
|
||||||
|
syntax keyword ionKeyword continue
|
||||||
|
syntax keyword ionKeyword count
|
||||||
|
syntax keyword ionKeyword dirs
|
||||||
|
syntax keyword ionKeyword disown
|
||||||
|
syntax keyword ionKeyword drop
|
||||||
|
syntax keyword ionKeyword echo
|
||||||
|
syntax keyword ionKeyword else
|
||||||
|
syntax keyword ionKeyword end
|
||||||
|
syntax keyword ionKeyword eval
|
||||||
|
syntax keyword ionKeyword exec
|
||||||
|
syntax keyword ionKeyword exit
|
||||||
|
syntax keyword ionKeyword false
|
||||||
|
syntax keyword ionKeyword fg
|
||||||
|
syntax keyword ionKeyword fn
|
||||||
|
syntax keyword ionKeyword for
|
||||||
|
syntax keyword ionKeyword help
|
||||||
|
syntax keyword ionKeyword history
|
||||||
|
syntax keyword ionKeyword if
|
||||||
|
syntax keyword ionKeyword in
|
||||||
|
syntax keyword ionKeyword jobs
|
||||||
|
syntax keyword ionKeyword let
|
||||||
|
syntax keyword ionKeyword match
|
||||||
|
syntax keyword ionKeyword matches
|
||||||
|
syntax keyword ionKeyword mkdir
|
||||||
|
syntax keyword ionKeyword not
|
||||||
|
syntax keyword ionKeyword or
|
||||||
|
syntax keyword ionKeyword popd
|
||||||
|
syntax keyword ionKeyword pushd
|
||||||
|
syntax keyword ionKeyword pwd
|
||||||
|
syntax keyword ionKeyword read
|
||||||
|
syntax keyword ionKeyword set
|
||||||
|
syntax keyword ionKeyword source
|
||||||
|
syntax keyword ionKeyword status
|
||||||
|
syntax keyword ionKeyword suspend
|
||||||
|
syntax keyword ionKeyword test
|
||||||
|
syntax keyword ionKeyword time
|
||||||
|
syntax keyword ionKeyword true
|
||||||
|
syntax keyword ionKeyword unalias
|
||||||
|
syntax keyword ionKeyword wait
|
||||||
|
syntax keyword ionKeyword while
|
||||||
|
|
||||||
|
hi def link ionKeyword Keyword
|
||||||
|
hi def link ionArrayVar Constant
|
||||||
|
hi def link ionVariable Identifier
|
||||||
|
hi def link ionNumber Number
|
||||||
|
hi def link ionDoubleQuote String
|
||||||
|
hi def link ionSingleQuote String
|
||||||
|
hi def link ionProcess PreProc
|
||||||
|
hi def link ionComment Comment
|
||||||
|
hi def link ionOperator Operator
|
||||||
|
hi def link ionFlag Boolean
|
||||||
@@ -153,14 +153,16 @@ syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces s
|
|||||||
syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold
|
syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold
|
||||||
syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
||||||
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment nextgroup=jsFlowDefinition extend fold
|
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment nextgroup=jsFlowDefinition extend fold
|
||||||
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment nextgroup=jsFlowDefinition extend fold
|
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsDestructuringNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment nextgroup=jsFlowDefinition extend fold
|
||||||
syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectShorthandProp,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword extend fold
|
syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectShorthandProp,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword extend fold
|
||||||
syntax region jsBlock matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsSpreadExpression extend fold
|
syntax region jsBlock matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsSpreadExpression extend fold
|
||||||
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
|
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
|
||||||
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
||||||
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
||||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?:\@!/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?:\@!/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
|
||||||
|
" These must occur here or they will be override by jsTernaryIf
|
||||||
syntax match jsOperator /?\.\ze\_D/
|
syntax match jsOperator /?\.\ze\_D/
|
||||||
|
syntax match jsOperator /??/ skipwhite skipempty nextgroup=@jsExpression
|
||||||
|
|
||||||
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
|
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
|
||||||
syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
|
syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
|
||||||
|
|||||||
@@ -2,48 +2,64 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'json5') != -1
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Syntax setup {{{1
|
" Modified from the original taken from https://github.com/gutenye/json5.vim
|
||||||
|
|
||||||
|
" Syntax setup
|
||||||
if exists('b:current_syntax') && b:current_syntax == 'json5'
|
if exists('b:current_syntax') && b:current_syntax == 'json5'
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Syntax: Strings {{{1
|
" Numbers
|
||||||
syn region json5String start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=json5Escape
|
syn match json5Number "[-+]\=\%(0\|[1-9]\d*\)\%(\.\d*\)\=\%([eE][-+]\=\d\+\)\="
|
||||||
syn region json5String start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=json5Escape
|
syn match json5Number "[-+]\=\%(\.\d\+\)\%([eE][-+]\=\d\+\)\="
|
||||||
|
syn match json5Number "[-+]\=0[xX]\x*"
|
||||||
|
syn match json5Number "[-+]\=Infinity\|NaN"
|
||||||
|
|
||||||
" Syntax: Escape sequences
|
" An integer part of 0 followed by other digits is not allowed
|
||||||
syn match json5Escape "\\["\\/bfnrt]" contained
|
syn match json5NumError "[-+]\=0\d\(\d\|\.\)*"
|
||||||
|
|
||||||
|
" A hexadecimal number cannot have a fractional part
|
||||||
|
syn match json5NumError "[-+]\=0x\x*\.\x*"
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syn region json5String start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=json5Escape,@Spell
|
||||||
|
syn region json5String start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=json5Escape,@Spell
|
||||||
|
|
||||||
|
" Escape sequences
|
||||||
|
syn match json5Escape "\\['\"\\bfnrtv]" contained
|
||||||
syn match json5Escape "\\u\x\{4}" contained
|
syn match json5Escape "\\u\x\{4}" contained
|
||||||
|
|
||||||
" Syntax: Numbers {{{1
|
" Boolean
|
||||||
syn match json5Number "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
|
|
||||||
syn keyword json5Number Infinity -Infinity
|
|
||||||
|
|
||||||
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
|
||||||
syn match json5NumError "-\=\<0\d\.\d*\>"
|
|
||||||
|
|
||||||
" Syntax: Boolean {{{1
|
|
||||||
syn keyword json5Boolean true false
|
syn keyword json5Boolean true false
|
||||||
|
|
||||||
" Syntax: Null {{{1
|
" Null
|
||||||
syn keyword json5Null null
|
syn keyword json5Null null
|
||||||
|
|
||||||
" Syntax: Braces {{{1
|
" Delimiters and Operators
|
||||||
|
syn match json5Delimiter ","
|
||||||
|
syn match json5Operator ":"
|
||||||
|
|
||||||
|
" Braces
|
||||||
syn match json5Braces "[{}\[\]]"
|
syn match json5Braces "[{}\[\]]"
|
||||||
syn match json5ObjAssign /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/
|
|
||||||
|
|
||||||
" Syntax: Comment {{{1
|
" Keys
|
||||||
syn region json5LineComment start=+\/\/+ end=+$+ keepend
|
syn match json5Key /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@Spell
|
||||||
syn region json5LineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold
|
syn match json5Key /"\([^"]\|\\"\)\{-}"\ze\s*:/ contains=json5Escape,@Spell
|
||||||
syn region json5Comment start="/\*" end="\*/" fold
|
|
||||||
|
|
||||||
" Define the default highlighting. {{{1
|
" Comment
|
||||||
|
syn region json5LineComment start=+\/\/+ end=+$+ keepend contains=@Spell
|
||||||
|
syn region json5LineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend fold contains=@Spell
|
||||||
|
syn region json5Comment start="/\*" end="\*/" fold contains=@Spell
|
||||||
|
|
||||||
|
" Define the default highlighting
|
||||||
hi def link json5String String
|
hi def link json5String String
|
||||||
hi def link json5ObjAssign Identifier
|
hi def link json5Key Identifier
|
||||||
hi def link json5Escape Special
|
hi def link json5Escape Special
|
||||||
hi def link json5Number Number
|
hi def link json5Number Number
|
||||||
hi def link json5Braces Operator
|
hi def link json5Delimiter Delimiter
|
||||||
hi def link json5Null Function
|
hi def link json5Operator Operator
|
||||||
|
hi def link json5Braces Delimiter
|
||||||
|
hi def link json5Null Keyword
|
||||||
hi def link json5Boolean Boolean
|
hi def link json5Boolean Boolean
|
||||||
hi def link json5LineComment Comment
|
hi def link json5LineComment Comment
|
||||||
hi def link json5Comment Comment
|
hi def link json5Comment Comment
|
||||||
@@ -53,4 +69,3 @@ if !exists('b:current_syntax')
|
|||||||
let b:current_syntax = 'json5'
|
let b:current_syntax = 'json5'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" vim: fdm=marker
|
|
||||||
|
|||||||
@@ -66,16 +66,16 @@ let s:nonidS_chars = "[:space:])\\U5D}" . s:nonid_chars
|
|||||||
" the following excludes '!' since it can be used as an identifier,
|
" the following excludes '!' since it can be used as an identifier,
|
||||||
" and '$' since it can be used in interpolations
|
" and '$' since it can be used in interpolations
|
||||||
" note that \U2D is '-'
|
" note that \U2D is '-'
|
||||||
let s:uniop_chars = "+\\U2D~¬√∛∜"
|
let s:uniop_chars = "+\\U2D~¬√∛∜⋆"
|
||||||
|
|
||||||
let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±"
|
let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±⟂⋆"
|
||||||
|
|
||||||
" the following is a list of all remainig valid operator chars,
|
" the following is a list of all remainig valid operator chars,
|
||||||
" but it's more efficient when expressed with ranges (see below)
|
" but it's more efficient when expressed with ranges (see below)
|
||||||
" let s:binop_chars_extra = "↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←→" .
|
" let s:binop_chars_extra = "↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←→" .
|
||||||
" \ "∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣" .
|
" \ "∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣" .
|
||||||
" \ "⊔∓∔∸≂≏⊎⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣" .
|
" \ "⊔∓∔∸≂≏⊎⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣" .
|
||||||
" \ "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋆⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" .
|
" \ "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" .
|
||||||
" \ "⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯↑↓"
|
" \ "⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯↑↓"
|
||||||
|
|
||||||
" same as above, but with character ranges, for performance
|
" same as above, but with character ranges, for performance
|
||||||
|
|||||||
@@ -5,18 +5,16 @@ endif
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Kotlin
|
" Language: Kotlin
|
||||||
" Maintainer: Alexander Udalov
|
" Maintainer: Alexander Udalov
|
||||||
" Latest Revision: 14 January 2019
|
" Latest Revision: 26 May 2019
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists('b:current_syntax')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "kotlin"
|
|
||||||
|
|
||||||
syn keyword ktStatement break continue return
|
syn keyword ktStatement break continue return
|
||||||
syn keyword ktConditional if else when
|
syn keyword ktConditional if else when
|
||||||
syn keyword ktRepeat do for while
|
syn keyword ktRepeat do for while
|
||||||
syn keyword ktOperator as in is by
|
syn keyword ktOperator in is by
|
||||||
syn keyword ktKeyword get set out super this where
|
syn keyword ktKeyword get set out super this where
|
||||||
syn keyword ktException try catch finally throw
|
syn keyword ktException try catch finally throw
|
||||||
|
|
||||||
@@ -33,6 +31,8 @@ syn keyword ktConstant null
|
|||||||
|
|
||||||
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix suspend
|
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix suspend
|
||||||
|
|
||||||
|
syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-!%&*+/|]"
|
||||||
|
|
||||||
syn keyword ktTodo TODO FIXME XXX contained
|
syn keyword ktTodo TODO FIXME XXX contained
|
||||||
syn match ktShebang "\v^#!.*$"
|
syn match ktShebang "\v^#!.*$"
|
||||||
syn match ktLineComment "\v//.*$" contains=ktTodo,@Spell
|
syn match ktLineComment "\v//.*$" contains=ktTodo,@Spell
|
||||||
@@ -69,48 +69,48 @@ syn match ktEscapedName "\v`.*`"
|
|||||||
syn match ktExclExcl "!!"
|
syn match ktExclExcl "!!"
|
||||||
syn match ktArrow "->"
|
syn match ktArrow "->"
|
||||||
|
|
||||||
|
hi def link ktStatement Statement
|
||||||
|
hi def link ktConditional Conditional
|
||||||
|
hi def link ktRepeat Repeat
|
||||||
|
hi def link ktOperator Operator
|
||||||
|
hi def link ktKeyword Keyword
|
||||||
|
hi def link ktException Exception
|
||||||
|
hi def link ktReservedKeyword Error
|
||||||
|
|
||||||
|
hi def link ktInclude Include
|
||||||
|
|
||||||
hi link ktStatement Statement
|
hi def link ktType Type
|
||||||
hi link ktConditional Conditional
|
hi def link ktModifier StorageClass
|
||||||
hi link ktRepeat Repeat
|
hi def link ktStructure Structure
|
||||||
hi link ktOperator Operator
|
hi def link ktTypedef Typedef
|
||||||
hi link ktKeyword Keyword
|
|
||||||
hi link ktException Exception
|
|
||||||
hi link ktReservedKeyword Error
|
|
||||||
|
|
||||||
hi link ktInclude Include
|
hi def link ktBoolean Boolean
|
||||||
|
hi def link ktConstant Constant
|
||||||
|
|
||||||
hi link ktType Type
|
hi def link ktTodo Todo
|
||||||
hi link ktModifier StorageClass
|
hi def link ktShebang Comment
|
||||||
hi link ktStructure Structure
|
hi def link ktLineComment Comment
|
||||||
hi link ktTypedef Typedef
|
hi def link ktComment Comment
|
||||||
|
hi def link ktCommentMatchGroup Comment
|
||||||
|
hi def link ktDocComment Comment
|
||||||
|
hi def link ktDocTag Special
|
||||||
|
hi def link ktDocTagParam Identifier
|
||||||
|
|
||||||
hi link ktBoolean Boolean
|
hi def link ktSpecialChar SpecialChar
|
||||||
hi link ktConstant Constant
|
hi def link ktSpecialCharError Error
|
||||||
|
hi def link ktString String
|
||||||
|
hi def link ktCharacter Character
|
||||||
|
|
||||||
hi link ktTodo Todo
|
hi def link ktAnnotation Identifier
|
||||||
hi link ktShebang Comment
|
hi def link ktLabel Identifier
|
||||||
hi link ktLineComment Comment
|
|
||||||
hi link ktComment Comment
|
|
||||||
hi link ktCommentMatchGroup Comment
|
|
||||||
hi link ktDocComment Comment
|
|
||||||
hi link ktDocTag Special
|
|
||||||
hi link ktDocTagParam Identifier
|
|
||||||
|
|
||||||
hi link ktSpecialChar SpecialChar
|
hi def link ktSimpleInterpolation Identifier
|
||||||
hi link ktSpecialCharError Error
|
hi def link ktComplexInterpolationBrace Identifier
|
||||||
hi link ktString String
|
|
||||||
hi link ktCharacter Character
|
|
||||||
|
|
||||||
hi link ktAnnotation Identifier
|
hi def link ktNumber Number
|
||||||
hi link ktLabel Identifier
|
hi def link ktFloat Float
|
||||||
|
|
||||||
hi link ktSimpleInterpolation Identifier
|
hi def link ktExclExcl Special
|
||||||
hi link ktComplexInterpolationBrace Identifier
|
hi def link ktArrow Structure
|
||||||
|
|
||||||
hi link ktNumber Number
|
let b:current_syntax = 'kotlin'
|
||||||
hi link ktFloat Float
|
|
||||||
|
|
||||||
hi link ktExclExcl Special
|
|
||||||
hi link ktArrow Structure
|
|
||||||
|
|||||||
@@ -1,142 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'liquid') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim syntax file
|
|
||||||
" Language: Liquid
|
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
|
||||||
" Filenames: *.liquid
|
|
||||||
" Last Change: 2010 May 21
|
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('main_syntax')
|
|
||||||
let main_syntax = 'liquid'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:liquid_default_subtype')
|
|
||||||
let g:liquid_default_subtype = 'html'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('b:liquid_subtype') && main_syntax == 'liquid'
|
|
||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
|
||||||
let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+')
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+')
|
|
||||||
endif
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$')
|
|
||||||
endif
|
|
||||||
if b:liquid_subtype == ''
|
|
||||||
let b:liquid_subtype = g:liquid_default_subtype
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('b:liquid_subtype') && b:liquid_subtype != ''
|
|
||||||
exe 'runtime! syntax/'.b:liquid_subtype.'.vim'
|
|
||||||
unlet! b:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn case match
|
|
||||||
|
|
||||||
if exists('b:liquid_subtype') && b:liquid_subtype != 'yaml'
|
|
||||||
" YAML Front Matter
|
|
||||||
syn include @liquidYamlTop syntax/yaml.vim
|
|
||||||
unlet! b:current_syntax
|
|
||||||
syn region liquidYamlHead start="\%^---$" end="^---\s*$" keepend contains=@liquidYamlTop,@Spell
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:liquid_highlight_types')
|
|
||||||
let g:liquid_highlight_types = []
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('s:subtype')
|
|
||||||
let s:subtype = exists('b:liquid_subtype') ? b:liquid_subtype : ''
|
|
||||||
|
|
||||||
for s:type in map(copy(g:liquid_highlight_types),'matchstr(v:val,"[^=]*$")')
|
|
||||||
if s:type =~ '\.'
|
|
||||||
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
|
|
||||||
endif
|
|
||||||
exe 'syn include @liquidHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
|
|
||||||
unlet! b:current_syntax
|
|
||||||
endfor
|
|
||||||
unlet! s:type
|
|
||||||
|
|
||||||
if s:subtype == ''
|
|
||||||
unlet! b:liquid_subtype
|
|
||||||
else
|
|
||||||
let b:liquid_subtype = s:subtype
|
|
||||||
endif
|
|
||||||
unlet s:subtype
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend
|
|
||||||
syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend
|
|
||||||
syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend
|
|
||||||
syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend
|
|
||||||
|
|
||||||
syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead
|
|
||||||
syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression
|
|
||||||
syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,liquidFloat,liquidBoolean,liquidNull,liquidEmpty,liquidPipe,liquidForloop
|
|
||||||
|
|
||||||
syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained
|
|
||||||
syn keyword liquidKeyword endhighlight contained
|
|
||||||
syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend
|
|
||||||
|
|
||||||
for s:type in g:liquid_highlight_types
|
|
||||||
exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained'
|
|
||||||
exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
|
||||||
endfor
|
|
||||||
unlet! s:type
|
|
||||||
|
|
||||||
syn region liquidString matchgroup=liquidQuote start=+"+ end=+"+ contained
|
|
||||||
syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained
|
|
||||||
syn match liquidNumber "-\=\<\d\+\>" contained
|
|
||||||
syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained
|
|
||||||
syn keyword liquidBoolean true false contained
|
|
||||||
syn keyword liquidNull null nil contained
|
|
||||||
syn match liquidEmpty "\<empty\>" contained
|
|
||||||
|
|
||||||
syn keyword liquidOperator and or not contained
|
|
||||||
syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter
|
|
||||||
|
|
||||||
syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained
|
|
||||||
|
|
||||||
syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained
|
|
||||||
syn keyword liquidRepeat for endfor tablerow endtablerow in contained
|
|
||||||
syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained
|
|
||||||
syn keyword liquidKeyword assign cycle include with contained
|
|
||||||
|
|
||||||
syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained
|
|
||||||
syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained
|
|
||||||
syn keyword liquidForloopAttribute length index index0 rindex rindex0 first last contained
|
|
||||||
|
|
||||||
syn keyword liquidTablerowloop tablerowloop nextgroup=liquidTablerowloopDot contained
|
|
||||||
syn match liquidTablerowloopDot "\." nextgroup=liquidTableForloopAttribute contained
|
|
||||||
syn keyword liquidTablerowloopAttribute length index index0 col col0 index0 rindex rindex0 first last col_first col_last contained
|
|
||||||
|
|
||||||
hi def link liquidDelimiter PreProc
|
|
||||||
hi def link liquidComment Comment
|
|
||||||
hi def link liquidTypeHighlight Type
|
|
||||||
hi def link liquidConditional Conditional
|
|
||||||
hi def link liquidRepeat Repeat
|
|
||||||
hi def link liquidKeyword Keyword
|
|
||||||
hi def link liquidOperator Operator
|
|
||||||
hi def link liquidString String
|
|
||||||
hi def link liquidQuote Delimiter
|
|
||||||
hi def link liquidNumber Number
|
|
||||||
hi def link liquidFloat Float
|
|
||||||
hi def link liquidEmpty liquidNull
|
|
||||||
hi def link liquidNull liquidBoolean
|
|
||||||
hi def link liquidBoolean Boolean
|
|
||||||
hi def link liquidFilter Function
|
|
||||||
hi def link liquidForloop Identifier
|
|
||||||
hi def link liquidForloopAttribute Identifier
|
|
||||||
|
|
||||||
let b:current_syntax = 'liquid'
|
|
||||||
|
|
||||||
if exists('main_syntax') && main_syntax == 'liquid'
|
|
||||||
unlet main_syntax
|
|
||||||
endif
|
|
||||||
163
syntax/log.vim
Normal file
163
syntax/log.vim
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'log') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Generic log file
|
||||||
|
" Maintainer: MTDL9 <https://github.com/MTDL9>
|
||||||
|
" Latest Revision: 2019-04-16
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpoptions
|
||||||
|
set cpoptions&vim
|
||||||
|
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\&\!$\%\&\+\-\|\^(){}\*#]'
|
||||||
|
syn match logBrackets display '[\[\]]'
|
||||||
|
syn match logEmptyLines display '-\{3,}'
|
||||||
|
syn match logEmptyLines display '\*\{3,}'
|
||||||
|
syn match logEmptyLines display '=\{3,}'
|
||||||
|
syn match logEmptyLines display '- - '
|
||||||
|
|
||||||
|
|
||||||
|
" Constants
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
syn match logNumber '\<-\?\d\+\>'
|
||||||
|
syn match logHexNumber '\<0[xX]\x\+\>'
|
||||||
|
syn match logHexNumber '\<\d\x\+\>'
|
||||||
|
syn match logBinaryNumber '\<0[bB][01]\+\>'
|
||||||
|
syn match logFloatNumber '\<\d.\d\+[eE]\?\>'
|
||||||
|
|
||||||
|
syn keyword logBoolean TRUE FALSE True False true false
|
||||||
|
syn keyword logNull NULL Null null
|
||||||
|
|
||||||
|
syn region logString start=/"/ end=/"/ end=/$/ skip=/\\./
|
||||||
|
" Quoted strings, but no match on quotes like "don't", "plurals' elements"
|
||||||
|
syn region logString start=/'\(s \|t \| \w\)\@!/ end=/'/ end=/$/ end=/s / skip=/\\./
|
||||||
|
|
||||||
|
|
||||||
|
" Dates and Times
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
" Matches 2018-03-12T or 12/03/2018 or 12/Mar/2018
|
||||||
|
syn match logDate '\d\{2,4}[-\/]\(\d\{2}\|Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)[-\/]\d\{2,4}T\?'
|
||||||
|
" Matches 8 digit numbers at start of line starting with 20
|
||||||
|
syn match logDate '^20\d\{6}'
|
||||||
|
" Matches Fri Jan 09 or Feb 11 or Apr 3
|
||||||
|
syn match logDate '\(\(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\) \)\?\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) [0-9 ]\d'
|
||||||
|
|
||||||
|
" Matches 12:09:38 or 00:03:38.129Z or 01:32:12.102938 +0700
|
||||||
|
syn match logTime '\d\{2}:\d\{2}:\d\{2}\(\.\d\{2,6}\)\?\(\s\?[-+]\d\{2,4}\|Z\)\?\>' nextgroup=logTimeZone,logSysColumns skipwhite
|
||||||
|
|
||||||
|
" Follows logTime, matches UTC or PDT 2019 or 2019 EDT
|
||||||
|
syn match logTimeZone '\(UTC\|PDT\|EDT\|GMT\|EST\|KST\)\( \d\{4}\)\?' contained
|
||||||
|
syn match logTimeZone '\d\{4} \(UTC\|PDT\|EDT\|GMT\|EST\|KST\)' contained
|
||||||
|
|
||||||
|
|
||||||
|
" Entities
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
syn match logUrl 'http[s]\?:\/\/[^\n|,; '"]\+'
|
||||||
|
syn match logDomain /\v(^|\s)(\w|-)+(\.(\w|-)+)+\s/
|
||||||
|
syn match logUUID '\w\{8}-\w\{4}-\w\{4}-\w\{4}-\w\{12}'
|
||||||
|
syn match logMD5 '\<[a-z0-9]\{32}\>'
|
||||||
|
syn match logIPV4 '\<\d\{1,3}\(\.\d\{1,3}\)\{3}\>'
|
||||||
|
syn match logIPV6 '\<\x\{1,4}\(:\x\{1,4}\)\{7}\>'
|
||||||
|
syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}'
|
||||||
|
syn match logFilePath '\<\w:\\[^\n|,; ()'"\]{}]\+'
|
||||||
|
syn match logFilePath '\/\w[^\n|,; ()'"\]{}]\+'
|
||||||
|
|
||||||
|
|
||||||
|
" Syslog Columns
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
" Syslog hostname, program and process number columns
|
||||||
|
syn match logSysColumns '\w\(\w\|\.\|-\)\+ \(\w\|\.\|-\)\+\(\[\d\+\]\)\?:' contains=logOperator,logSysProcess contained
|
||||||
|
syn match logSysProcess '\(\w\|\.\|-\)\+\(\[\d\+\]\)\?:' contains=logOperator,logNumber,logBrackets contained
|
||||||
|
|
||||||
|
|
||||||
|
" XML Tags
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
" Simplified matches, not accurate with the spec to avoid false positives
|
||||||
|
syn match logXmlHeader /<?\(\w\|-\)\+\(\s\+\w\+\(="[^"]*"\|='[^']*'\)\?\)*?>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
|
syn match logXmlDoctype /<!DOCTYPE[^>]*>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
|
syn match logXmlTag /<\/\?\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(\(\n\|\s\)\+\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(="[^"]*"\|='[^']*'\)\?\)*\s*\/\?>/ contains=logString,logXmlAttribute,logXmlNamespace
|
||||||
|
syn match logXmlAttribute contained "\w\+=" contains=logOperator
|
||||||
|
syn match logXmlAttribute contained "\(\n\|\s\)\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(=\)\?" contains=logXmlNamespace,logOperator
|
||||||
|
syn match logXmlNamespace contained "\(\w\|-\)\+:" contains=logOperator
|
||||||
|
syn region logXmlComment start=/<!--/ end=/-->/
|
||||||
|
syn match logXmlCData /<!\[CDATA\[.*\]\]>/
|
||||||
|
syn match logXmlEntity /\&\w\+;/
|
||||||
|
|
||||||
|
|
||||||
|
" Levels
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
syn keyword logLevelEmergency EMERGENCY EMERG
|
||||||
|
syn keyword logLevelAlert ALERT
|
||||||
|
syn keyword logLevelCritical CRITICAL CRIT FATAL
|
||||||
|
syn keyword logLevelError ERROR ERR FAILURE SEVERE
|
||||||
|
syn keyword logLevelWarning WARNING WARN
|
||||||
|
syn keyword logLevelNotice NOTICE
|
||||||
|
syn keyword logLevelInfo INFO
|
||||||
|
syn keyword logLevelDebug DEBUG FINE
|
||||||
|
syn keyword logLevelTrace TRACE FINER FINEST
|
||||||
|
|
||||||
|
|
||||||
|
" Highlight links
|
||||||
|
"---------------------------------------------------------------------------
|
||||||
|
hi def link logNumber Number
|
||||||
|
hi def link logHexNumber Number
|
||||||
|
hi def link logBinaryNumber Number
|
||||||
|
hi def link logFloatNumber Float
|
||||||
|
hi def link logBoolean Boolean
|
||||||
|
hi def link logNull Constant
|
||||||
|
hi def link logString String
|
||||||
|
|
||||||
|
hi def link logDate Identifier
|
||||||
|
hi def link logTime Function
|
||||||
|
hi def link logTimeZone Identifier
|
||||||
|
|
||||||
|
hi def link logUrl Underlined
|
||||||
|
hi def link logDomain Label
|
||||||
|
hi def link logUUID Label
|
||||||
|
hi def link logMD5 Label
|
||||||
|
hi def link logIPV4 Label
|
||||||
|
hi def link logIPV6 ErrorMsg
|
||||||
|
hi def link logMacAddress Label
|
||||||
|
hi def link logFilePath Conditional
|
||||||
|
|
||||||
|
hi def link logSysColumns Conditional
|
||||||
|
hi def link logSysProcess Include
|
||||||
|
|
||||||
|
hi def link logXmlHeader Function
|
||||||
|
hi def link logXmlDoctype Function
|
||||||
|
hi def link logXmlTag Identifier
|
||||||
|
hi def link logXmlAttribute Type
|
||||||
|
hi def link logXmlNamespace Include
|
||||||
|
hi def link logXmlComment Comment
|
||||||
|
hi def link logXmlCData String
|
||||||
|
hi def link logXmlEntity Special
|
||||||
|
|
||||||
|
hi def link logOperator Operator
|
||||||
|
hi def link logBrackets Comment
|
||||||
|
hi def link logEmptyLines Comment
|
||||||
|
|
||||||
|
hi def link logLevelEmergency ErrorMsg
|
||||||
|
hi def link logLevelAlert ErrorMsg
|
||||||
|
hi def link logLevelCritical ErrorMsg
|
||||||
|
hi def link logLevelError ErrorMsg
|
||||||
|
hi def link logLevelWarning WarningMsg
|
||||||
|
hi def link logLevelNotice Character
|
||||||
|
hi def link logLevelInfo Repeat
|
||||||
|
hi def link logLevelDebug Debug
|
||||||
|
hi def link logLevelTrace Comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let b:current_syntax = 'log'
|
||||||
|
|
||||||
|
let &cpoptions = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
|||||||
syn match mkdLineBreak / \+$/
|
syn match mkdLineBreak / \+$/
|
||||||
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/`/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/`/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/``/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealcode
|
||||||
|
|||||||
1457
syntax/mma.vim
1457
syntax/mma.vim
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,7 @@ syn region nixInterpolation matchgroup=nixInterpolationDelimiter start="\${" end
|
|||||||
|
|
||||||
syn match nixSimpleStringSpecial /\\\%([nrt"\\$]\|$\)/ contained
|
syn match nixSimpleStringSpecial /\\\%([nrt"\\$]\|$\)/ contained
|
||||||
syn match nixStringSpecial /''['$]/ contained
|
syn match nixStringSpecial /''['$]/ contained
|
||||||
|
syn match nixStringSpecial /\$\$/ contained
|
||||||
syn match nixStringSpecial /''\\[nrt]/ contained
|
syn match nixStringSpecial /''\\[nrt]/ contained
|
||||||
|
|
||||||
syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained
|
syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained
|
||||||
|
|||||||
4200
syntax/pgsql.vim
4200
syntax/pgsql.vim
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -2,27 +2,27 @@ if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'plantuml') != -1
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
scriptencoding utf-8
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: PlantUML
|
" Language: PlantUML
|
||||||
" Maintainer: Anders Thøgersen <first name at bladre dot dk>
|
" Maintainer: Anders Thøgersen <first name at bladre dot dk>
|
||||||
|
" License: VIM LICENSE
|
||||||
if exists('b:current_syntax')
|
if exists('b:current_syntax')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
scriptencoding utf-8
|
|
||||||
|
|
||||||
if v:version < 600
|
if v:version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:cpo_orig=&cpo
|
let s:cpo_orig=&cpoptions
|
||||||
set cpo&vim
|
set cpoptions&vim
|
||||||
|
|
||||||
let b:current_syntax = 'plantuml'
|
let b:current_syntax = 'plantuml'
|
||||||
|
|
||||||
syntax sync minlines=100
|
syntax sync minlines=100
|
||||||
|
|
||||||
syntax match plantumlPreProc /\%(^@startuml\|^@enduml\)\|!\%(define|definelong|else|enddefinelong|endif|if|ifdef|ifndef|include|pragma|undef\)\s*.*/ contains=plantumlDir
|
syntax match plantumlPreProc /\%(^@startuml\|^@enduml\)\|!\%(define\|definelong\|else\|enddefinelong\|endif\|exit\|if\|ifdef\|ifndef\|include\|pragma\|undef\)\s*.*/ contains=plantumlDir
|
||||||
syntax region plantumlDir start=/\s\+/ms=s+1 end=/$/ contained
|
syntax region plantumlDir start=/\s\+/ms=s+1 end=/$/ contained
|
||||||
|
|
||||||
syntax keyword plantumlTypeKeyword abstract actor agent archimate artifact boundary card cloud component control
|
syntax keyword plantumlTypeKeyword abstract actor agent archimate artifact boundary card cloud component control
|
||||||
@@ -32,10 +32,10 @@ syntax keyword plantumlTypeKeyword queue rectangle stack state storage usecase
|
|||||||
syntax keyword plantumlClassKeyword class interface
|
syntax keyword plantumlClassKeyword class interface
|
||||||
|
|
||||||
syntax keyword plantumlKeyword activate again also alt as autonumber bottom box break caption center create
|
syntax keyword plantumlKeyword activate again also alt as autonumber bottom box break caption center create
|
||||||
syntax keyword plantumlKeyword critical deactivate destroy down else elseif end endif endwhile footbox footer
|
syntax keyword plantumlKeyword critical deactivate destroy down else elseif end endif endsplit endwhile footbox
|
||||||
syntax keyword plantumlKeyword fork group header hide hnote if is kill left legend link loop namespace newpage
|
syntax keyword plantumlKeyword footer fork group header hide hnote if is kill left legend link loop namespace
|
||||||
syntax keyword plantumlKeyword note of on opt over package page par partition ref repeat return right rnote
|
syntax keyword plantumlKeyword newpage note of on opt over package page par partition ref repeat return right
|
||||||
syntax keyword plantumlKeyword rotate show skin skinparam start stop title top up while
|
syntax keyword plantumlKeyword rnote rotate show skin skinparam split start stop title top up while
|
||||||
" Not in 'java - jar plantuml.jar - language' output
|
" Not in 'java - jar plantuml.jar - language' output
|
||||||
syntax keyword plantumlKeyword then detach sprite
|
syntax keyword plantumlKeyword then detach sprite
|
||||||
|
|
||||||
@@ -63,12 +63,18 @@ syntax keyword plantumlColor Sienna Silver SkyBlue SlateBlue SlateGray SlateGrey
|
|||||||
syntax keyword plantumlColor TECHNOLOGY Tan Teal Thistle Tomato Turquoise Violet Wheat White WhiteSmoke
|
syntax keyword plantumlColor TECHNOLOGY Tan Teal Thistle Tomato Turquoise Violet Wheat White WhiteSmoke
|
||||||
syntax keyword plantumlColor Yellow YellowGreen
|
syntax keyword plantumlColor Yellow YellowGreen
|
||||||
|
|
||||||
" Arrows - Differentiate between horizontal and vertical arrows
|
" Arrows
|
||||||
syntax match plantumlHorizontalArrow /\%([-\.]\%(|>\|>\|\*\|o\>\|\\\\\|\\\|\/\/\|\/\|\.\|-\)\|\%(<|\|<\|\*\|\<o\|\\\\\|\\\|\/\/\|\/\)[\.-]\)\%(\[[^\]]*\]\)\?/ contains=plantumlLabel
|
syntax match plantumlArrow /.\@=\([.-]\)\1\+\ze\s*\%(\w\|(\)/
|
||||||
syntax match plantumlDirectedOrVerticalArrowLR /[-\.]\%(le\?f\?t\?\|ri\?g\?h\?t\?\|up\?\|do\?w\?n\?\)\?[-\.]\%(|>\|>>\|>\|\*\|o\>\|\\\\\|\\\|\/\/\|\/\|\.\|-\)\%(\[[^\]]*\]\)\?/ contains=plantumlLabel
|
|
||||||
syntax match plantumlDirectedOrVerticalArrowRL /\%(<|\|<<\|<\|\*\|\<o\|\\\\\|\\\|\/\/\|\/\)[-\.]\%(le\?f\?t\?\|ri\?g\?h\?t\?\|up\?\|do\?w\?n\?\)\?[-\.]\%(\[[^\]]*\]\)\?/ contains=plantumlLabel
|
syntax match plantumlClassRelationLR /\([-.]\)\1*\%(\w\{,5\}\1\+\)\?\%(|>\|>\|*\|o\|x\|#\|{\|+\|\^\)/ contains=plantumlArrowDirectedLine
|
||||||
syntax region plantumlLabel start=/\[/ms=s+1 end=/\]/me=s-1 contained contains=plantumlText
|
syntax match plantumlClassRelationRL /\%(<|\|<\|*\|o\|x\|#\|}\|+\|\^\)\([-.]\)\1*\%(\w\{,5\}\1\+\)\?/ contains=plantumlArrowDirectedLine
|
||||||
syntax match plantumlText /\%([0-9A-Za-z\0xc0-\0xff]\|\s\|[\.,;_-]\)\+/ contained
|
|
||||||
|
syntax match plantumlArrowLR /\[\?\([-.]\)\1*\%(\w\{,5}\1\+\)\?\(>\|\\\|\/\)\2\?[ox]\?\]\?\%(\[[^\]]*\]\)\?/ contains=plantumlText,plantumlArrowDirectedLine
|
||||||
|
syntax match plantumlArrowRL /\[\?[ox]\?\(<\|\\\|\/\)\1\?\([-.]\)\2*\%(\w\{,5}\2\+\)\?\]\?\%(\[[^\]]*\]\)\?/ contains=plantumlText,plantumlArrowDirectedLine
|
||||||
|
syntax match plantumlArrowBoth /[ox]\?\(<\|\\\|\/\)\1\?\([-.]\)\2*\%(\w\{,5}\2\+\)\?\(>\|\\\|\/\)\3\?[ox]\?/ contains=plantumlArrowDirectedLine
|
||||||
|
syntax region plantumlText oneline start=/\[/ms=s+1 end=/\]/me=s-1 contained
|
||||||
|
|
||||||
|
syntax match plantumlArrowDirectedLine /\([-.]\)\%(l\%[eft]\|r\%[ight]\|up\?\|d\%[own]\)\1/ contained
|
||||||
|
|
||||||
" Note
|
" Note
|
||||||
syntax region plantumlNoteMultiLine start=/\%(^\s*[rh]\?note\)\@<=\s\%([^:"]\+$\)\@=/ end=/^\%(\s*end \?[rh]\?note$\)\@=/ contains=plantumlSpecialString,plantumlNoteMultiLineStart
|
syntax region plantumlNoteMultiLine start=/\%(^\s*[rh]\?note\)\@<=\s\%([^:"]\+$\)\@=/ end=/^\%(\s*end \?[rh]\?note$\)\@=/ contains=plantumlSpecialString,plantumlNoteMultiLineStart
|
||||||
@@ -103,7 +109,7 @@ syntax region plantumlMultilineComment start=/\/'/ end=/'\// contains=plantumlCo
|
|||||||
syntax match plantumlColonLine /\S\@<=\s*\zs:.\+$/ contains=plantumlSpecialString
|
syntax match plantumlColonLine /\S\@<=\s*\zs:.\+$/ contains=plantumlSpecialString
|
||||||
|
|
||||||
" Stereotypes
|
" Stereotypes
|
||||||
syntax match plantumlStereotype /<<.\{-1,}>>/ contains=plantumlSpecialString
|
syntax match plantumlStereotype /<<[^-.]\+>>/ contains=plantumlSpecialString
|
||||||
|
|
||||||
" Activity diagram
|
" Activity diagram
|
||||||
syntax match plantumlActivityThing /([^)]*)/
|
syntax match plantumlActivityThing /([^)]*)/
|
||||||
@@ -114,6 +120,8 @@ syntax match plantumlActivityLabel /\%(^\%(#\S\+\)\?\)\@<=:\_[^;|<>/\]}]\+[;|<>/
|
|||||||
syntax match plantumlSequenceDivider /^\s*==[^=]\+==\s*$/
|
syntax match plantumlSequenceDivider /^\s*==[^=]\+==\s*$/
|
||||||
syntax match plantumlSequenceSpace /^\s*|||\+\s*$/
|
syntax match plantumlSequenceSpace /^\s*|||\+\s*$/
|
||||||
syntax match plantumlSequenceSpace /^\s*||\d\+||\+\s*$/
|
syntax match plantumlSequenceSpace /^\s*||\d\+||\+\s*$/
|
||||||
|
syntax match plantumlSequenceDelay /^\.\{3}$/
|
||||||
|
syntax region plantumlText oneline matchgroup=plantumlSequenceDelay start=/^\.\{3}/ end=/\.\{3}$/
|
||||||
|
|
||||||
" Usecase diagram
|
" Usecase diagram
|
||||||
syntax match plantumlUsecaseActor /:.\{-1,}:/ contains=plantumlSpecialString
|
syntax match plantumlUsecaseActor /:.\{-1,}:/ contains=plantumlSpecialString
|
||||||
@@ -288,10 +296,13 @@ highlight default link plantumlTypeKeyword Type
|
|||||||
highlight default link plantumlPreProc PreProc
|
highlight default link plantumlPreProc PreProc
|
||||||
highlight default link plantumlDir Constant
|
highlight default link plantumlDir Constant
|
||||||
highlight default link plantumlColor Constant
|
highlight default link plantumlColor Constant
|
||||||
highlight default link plantumlHorizontalArrow Identifier
|
highlight default link plantumlArrow Identifier
|
||||||
highlight default link plantumlDirectedOrVerticalArrowLR Identifier
|
highlight default link plantumlArrowBoth Identifier
|
||||||
highlight default link plantumlDirectedOrVerticalArrowRL Identifier
|
highlight default link plantumlArrowLR Identifier
|
||||||
highlight default link plantumlLabel Special
|
highlight default link plantumlArrowRL Identifier
|
||||||
|
highlight default link plantumlArrowDirectedLine Identifier
|
||||||
|
highlight default link plantumlClassRelationLR Identifier
|
||||||
|
highlight default link plantumlClassRelationRL Identifier
|
||||||
highlight default link plantumlText Label
|
highlight default link plantumlText Label
|
||||||
highlight default link plantumlClass Type
|
highlight default link plantumlClass Type
|
||||||
highlight default link plantumlClassPublic Structure
|
highlight default link plantumlClassPublic Structure
|
||||||
@@ -301,6 +312,7 @@ highlight default link plantumlClassPackPrivate Function
|
|||||||
highlight default link plantumlClassSeparator Comment
|
highlight default link plantumlClassSeparator Comment
|
||||||
highlight default link plantumlSequenceDivider Comment
|
highlight default link plantumlSequenceDivider Comment
|
||||||
highlight default link plantumlSequenceSpace Comment
|
highlight default link plantumlSequenceSpace Comment
|
||||||
|
highlight default link plantumlSequenceDelay Identifier
|
||||||
highlight default link plantumlSpecialString Special
|
highlight default link plantumlSpecialString Special
|
||||||
highlight default link plantumlString String
|
highlight default link plantumlString String
|
||||||
highlight default link plantumlComment Comment
|
highlight default link plantumlComment Comment
|
||||||
@@ -314,5 +326,5 @@ highlight default link plantumlNoteMultiLine String
|
|||||||
highlight default link plantumlUsecaseActor String
|
highlight default link plantumlUsecaseActor String
|
||||||
highlight default link plantumlStereotype Type
|
highlight default link plantumlStereotype Type
|
||||||
|
|
||||||
let &cpo=s:cpo_orig
|
let &cpoptions=s:cpo_orig
|
||||||
unlet s:cpo_orig
|
unlet s:cpo_orig
|
||||||
|
|||||||
61
syntax/rego.vim
Normal file
61
syntax/rego.vim
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rego') != -1
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Rego (http://github.com/open-policy-agent/opa)
|
||||||
|
" Maintainers: Torin Sandall <torinsandall@gmail.com>
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
" language keywords
|
||||||
|
syn keyword regoKeyword package import as not with default else some
|
||||||
|
|
||||||
|
" comments
|
||||||
|
syn match regoComment "#.*$" contains=regoTodo,@Spell
|
||||||
|
syn keyword regoTodo FIXME XXX TODO contained
|
||||||
|
|
||||||
|
" data types
|
||||||
|
syn keyword regoNull null
|
||||||
|
syn keyword regoBoolean true false
|
||||||
|
syn match regoNumber "\<\(0[0-7]*\|0[xx]\x\+\|\d\+\)[ll]\=\>"
|
||||||
|
syn match regoNumber "\(\<\d\+\.\d*\|\.\d\+\)\([ee][-+]\=\d\+\)\=[ffdd]\="
|
||||||
|
syn match regoNumber "\<\d\+[ee][-+]\=\d\+[ffdd]\=\>"
|
||||||
|
syn match regoNumber "\<\d\+\([ee][-+]\=\d\+\)\=[ffdd]\>"
|
||||||
|
syn region regoString start="\"[^"]" skip="\\\"" end="\"" contains=regoStringEscape
|
||||||
|
syn match regoStringEscape "\\u[0-9a-fA-F]\{4}" contained
|
||||||
|
syn match regoStringEscape "\\[nrfvb\\\"]" contained
|
||||||
|
|
||||||
|
" rules
|
||||||
|
syn match regoRuleName "^\(\w\+\)"
|
||||||
|
syn region regoBody start="{" end="}" transparent
|
||||||
|
|
||||||
|
" operators
|
||||||
|
syn match regoEquality "="
|
||||||
|
syn match regoInequality "[<>!]"
|
||||||
|
syn match regoArith "[+-/*&|]"
|
||||||
|
syn match regoBuiltin "\w\+(" nextgroup=regoBuiltinArgs contains=regoBuiltinArgs
|
||||||
|
syn region regoBuiltinArgs start="(" end=")" contained contains=regoNull,regoBoolean,regoNumber,regoString
|
||||||
|
|
||||||
|
" highlighting
|
||||||
|
hi link regoKeyword Keyword
|
||||||
|
hi link regoNull Function
|
||||||
|
hi link regoBoolean Boolean
|
||||||
|
hi link regoNumber Number
|
||||||
|
hi link regoString String
|
||||||
|
|
||||||
|
hi link regoRuleName Function
|
||||||
|
|
||||||
|
hi link regoEquality Keyword
|
||||||
|
hi link regoInequality Keyword
|
||||||
|
hi link regoArith Keyword
|
||||||
|
hi link regoBuiltin Type
|
||||||
|
|
||||||
|
hi link regoComment Comment
|
||||||
|
hi link regoTodo Todo
|
||||||
@@ -94,16 +94,21 @@ execute 'syn match rstSubstitutionDefinition contained' .
|
|||||||
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
|
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
|
||||||
|
|
||||||
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
|
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
|
||||||
|
execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.a:start.'+'.' contained'
|
||||||
|
|
||||||
execute 'syn region rst' . a:name .
|
execute 'syn region rst' . a:name .
|
||||||
\ ' start=+' . a:char_left . '\zs' . a:start .
|
\ ' start=+' . a:char_left . '\zs' . a:start .
|
||||||
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
|
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
|
||||||
\ a:middle .
|
\ a:middle .
|
||||||
\ ' end=+\S' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+'
|
\ ' end=+' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+' .
|
||||||
|
\ ' contains=rstEscape' . a:name
|
||||||
|
|
||||||
|
execute 'hi def link rstEscape'.a:name.' Special'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:DefineInlineMarkup(name, start, middle, end)
|
function! s:DefineInlineMarkup(name, start, middle, end)
|
||||||
let middle = a:middle != "" ?
|
let middle = a:middle != "" ?
|
||||||
\ (' skip=+\\\\\|\\' . a:middle . '+') :
|
\ (' skip=+\\\\\|\\' . a:middle . '\|\s' . a:middle . '+') :
|
||||||
\ ""
|
\ ""
|
||||||
|
|
||||||
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
|
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user