mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a0f2d974f | ||
|
|
15aeea662e | ||
|
|
d15651463a | ||
|
|
0c79dd3e73 | ||
|
|
4e95df7c7e | ||
|
|
31c55b85a0 | ||
|
|
199846c6d8 | ||
|
|
f95026252c | ||
|
|
4f3df59be7 | ||
|
|
26790941f6 | ||
|
|
fbc2af9e82 | ||
|
|
d4f252565a | ||
|
|
48e07bc501 | ||
|
|
c8897c9c18 | ||
|
|
34eb36e6d1 | ||
|
|
84ec4eedcd | ||
|
|
66b769328c | ||
|
|
ae18284e5a | ||
|
|
e3024f21fc | ||
|
|
31d757fc7b | ||
|
|
556c56d185 | ||
|
|
fe84062992 | ||
|
|
8742443e69 | ||
|
|
832dfece76 | ||
|
|
933e42ea1f | ||
|
|
cdd6d73e39 | ||
|
|
a48874df4c | ||
|
|
21849c2e18 | ||
|
|
664aa988f6 | ||
|
|
3ddca5da46 | ||
|
|
140430ffb7 | ||
|
|
d527002849 | ||
|
|
15727e7eb0 | ||
|
|
6b169212f8 |
31
README.md
31
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 120+ times faster** than the <!--Package Count-->143<!--/Package Count--> packages it consists of.
|
- It **installs and updates 120+ times faster** than the <!--Package Count-->146<!--/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)
|
||||||
|
- [dhall](https://github.com/vmchale/dhall-vim) (syntax, ftplugin)
|
||||||
- [dlang](https://github.com/JesseKPhillips/d.vim) (syntax, indent)
|
- [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)
|
||||||
@@ -76,7 +77,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
||||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
||||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax)
|
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax)
|
||||||
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
||||||
- [fsharp](https://github.com/fsharp/vim-fsharp) (syntax, indent)
|
- [fsharp](https://github.com/fsharp/vim-fsharp) (syntax, indent)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin)
|
||||||
@@ -85,6 +86,7 @@ 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, autoload, ftplugin, after)
|
||||||
- [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)
|
||||||
@@ -93,6 +95,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [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)
|
- [hcl](https://github.com/b4b4r07/vim-hcl) (syntax, indent, ftplugin)
|
||||||
|
- [helm](https://github.com/towolf/vim-helm) (syntax)
|
||||||
- [hive](https://github.com/zebradil/hive.vim) (syntax, 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)
|
||||||
@@ -105,7 +108,7 @@ 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/MaxMEllon/vim-jsx-pretty) (autoload, syntax, indent, ftplugin)
|
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after)
|
||||||
- [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)
|
||||||
@@ -126,7 +129,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin)
|
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin)
|
||||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||||
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (syntax, indent, compiler, ftplugin)
|
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (syntax, indent, compiler, ftplugin)
|
||||||
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
- [octave](https://github.com/McSinyx/vim-octave) (syntax, indent)
|
||||||
- [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/lifepillar/pgsql.vim) (syntax, indent)
|
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent)
|
||||||
@@ -136,21 +139,20 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin)
|
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin)
|
||||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
|
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
|
||||||
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
|
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
|
||||||
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin)
|
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, autoload, ftplugin)
|
||||||
- [purescript](https://github.com/purescript-contrib/purescript-vim) (syntax, indent, ftplugin)
|
- [purescript](https://github.com/purescript-contrib/purescript-vim) (syntax, indent, ftplugin)
|
||||||
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload)
|
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload)
|
||||||
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent) (indent)
|
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent) (indent)
|
||||||
- [python](https://github.com/vim-python/python-syntax) (syntax)
|
- [python](https://github.com/vim-python/python-syntax) (syntax)
|
||||||
- [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)
|
||||||
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, 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, indent, 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)
|
||||||
@@ -160,23 +162,23 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [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)
|
||||||
|
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent)
|
||||||
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
||||||
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
- [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, ftplugin)
|
||||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, 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/ericpruitt/tmux.vim) ()
|
- [tmux](https://github.com/ericpruitt/tmux.vim) (syntax, ftplugin)
|
||||||
- [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)
|
- [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/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin)
|
||||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||||
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
||||||
@@ -187,6 +189,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [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)
|
||||||
|
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
||||||
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
||||||
<!--/Language Packs-->
|
<!--/Language Packs-->
|
||||||
|
|
||||||
@@ -201,7 +204,7 @@ Please make sure you have `syntax on` in your `.vimrc`, otherwise syntax files a
|
|||||||
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
" ~/.vimrc
|
" ~/.vimrc, declare this variable before polyglot is loaded
|
||||||
let g:polyglot_disabled = ['css']
|
let g:polyglot_disabled = ['css']
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rspec') == -1
|
|
||||||
|
|
||||||
autocmd BufReadPost,BufNewFile *_spec.rb set syntax=rspec
|
|
||||||
autocmd BufReadPost,BufNewFile *_spec.rb setlocal commentstring=#\ %s
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'haskell') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
||||||
setlocal iskeyword+=-,.,*
|
setlocal iskeyword+=-,.,*
|
||||||
setlocal commentstring=--\ %s
|
setlocal commentstring=--\ %s
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'cjsx') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists("loaded_matchit")
|
if exists("loaded_matchit")
|
||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'haskell') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
|
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
|
||||||
setlocal iskeyword+='
|
setlocal iskeyword+='
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'idris') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal iskeyword+='
|
setlocal iskeyword+='
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'javascript') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: JavaScript
|
" Language: JavaScript
|
||||||
@@ -14,9 +12,9 @@ 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
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Vim ftplugin file
|
" Vim ftplugin file
|
||||||
@@ -49,40 +47,5 @@ augroup jsx_comment
|
|||||||
augroup end
|
augroup end
|
||||||
|
|
||||||
setlocal suffixesadd+=.jsx
|
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
|
endif
|
||||||
|
|||||||
5
after/ftplugin/javascriptreact.vim
Normal file
5
after/ftplugin/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/javascript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'llvm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Copyright (c) 2018 rhysd
|
" Copyright (c) 2018 rhysd
|
||||||
"
|
"
|
||||||
@@ -475,3 +473,5 @@ endfunction
|
|||||||
if !exists(':LLI')
|
if !exists(':LLI')
|
||||||
command! -buffer -nargs=? -bar -complete=file LLI call <SID>run_lli(<f-args>)
|
command! -buffer -nargs=? -bar -complete=file LLI call <SID>run_lli(<f-args>)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,20 +1,11 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'puppet') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:puppet_align_hashes')
|
if !exists('g:puppet_align_hashes')
|
||||||
let g:puppet_align_hashes = 1
|
let g:puppet_align_hashes = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:puppet_align_hashes && exists(':Tabularize')
|
if g:puppet_align_hashes
|
||||||
inoremap <buffer> <silent> > ><Esc>:call <SID>puppetalign()<CR>a
|
inoremap <buffer> <silent> => =><Esc>:call puppet#align#AlignHashrockets()<CR>$a
|
||||||
function! s:puppetalign()
|
endif
|
||||||
let p = '^\s*\w+\s*[=+]>.*$'
|
|
||||||
let column = strlen(substitute(getline('.')[0:col('.')],'\([^=]\|=[^>]\)','','g'))
|
|
||||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=>\s*\zs.*'))
|
|
||||||
Tabularize /=>/l1
|
|
||||||
normal! 0
|
|
||||||
echo repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position)
|
|
||||||
call search(repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
|
||||||
endfunction
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" modified from html.vim
|
" modified from html.vim
|
||||||
" For matchit plugin
|
" For matchit plugin
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
if exists("loaded_matchit")
|
if exists("loaded_matchit")
|
||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
@@ -25,3 +28,5 @@ augroup jsx_comment
|
|||||||
augroup end
|
augroup end
|
||||||
|
|
||||||
setlocal suffixesadd+=.tsx
|
setlocal suffixesadd+=.tsx
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
5
after/ftplugin/typescriptreact.vim
Normal file
5
after/ftplugin/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/typescript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'yaml') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Yaml
|
" Language: Yaml
|
||||||
@@ -9,3 +7,5 @@ endif
|
|||||||
" URL: https://github.com/hjpbarcelos
|
" URL: https://github.com/hjpbarcelos
|
||||||
setlocal autoindent sw=2 ts=2 expandtab
|
setlocal autoindent sw=2 ts=2 expandtab
|
||||||
" vim:set sw=2:
|
" vim:set sw=2:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
@@ -23,7 +21,7 @@ if exists('s:did_indent')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal indentexpr=GetJsxIndent()
|
setlocal indentexpr=GetJsxIndent()
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||||
|
|
||||||
function! GetJsxIndent()
|
function! GetJsxIndent()
|
||||||
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||||
@@ -31,176 +29,5 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:keepcpo
|
let &cpo = s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
|
||||||
finish
|
|
||||||
endif
|
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
|
|
||||||
|
|||||||
5
after/indent/javascriptreact.vim
Normal file
5
after/indent/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/javascript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
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,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'objc') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Objective-C
|
" Language: Objective-C
|
||||||
@@ -95,3 +93,5 @@ endfunction
|
|||||||
" Restore 'cpo' options
|
" Restore 'cpo' options
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
@@ -11,6 +9,10 @@ endif
|
|||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
if exists('b:did_indent')
|
if exists('b:did_indent')
|
||||||
let s:did_indent = b:did_indent
|
let s:did_indent = b:did_indent
|
||||||
unlet b:did_indent
|
unlet b:did_indent
|
||||||
@@ -24,7 +26,7 @@ if exists('s:did_indent')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal indentexpr=GetJsxIndent()
|
setlocal indentexpr=GetJsxIndent()
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||||
|
|
||||||
function! GetJsxIndent()
|
function! GetJsxIndent()
|
||||||
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
||||||
@@ -32,176 +34,5 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:keepcpo
|
let &cpo = s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
|
|
||||||
finish
|
|
||||||
endif
|
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
|
|
||||||
|
|||||||
5
after/indent/typescriptreact.vim
Normal file
5
after/indent/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/typescript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'c++11') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C Additions
|
" Language: C Additions
|
||||||
@@ -38,6 +36,19 @@ if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
|
|||||||
hi def link cCustomMemVar Function
|
hi def link cCustomMemVar Function
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
" Highlight POSIX functions.
|
||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
if exists('g:cpp_posix_standard') && g:cpp_posix_standard
|
||||||
|
syn keyword cPOSIXFunction socket accept bind connect getsockname
|
||||||
|
syn keyword cPOSIXFunction listen recv recvfrom recvmsg
|
||||||
|
syn keyword cPOSIXFunction send sendto sendmsg setsockopt socketpair
|
||||||
|
syn keyword cPOSIXFunction htonl htons ntohl ntohs
|
||||||
|
syn keyword cPOSIXFunction inet_ntop inet_pton getaddrinfo
|
||||||
|
syn keyword cPOSIXFunction poll select pselect
|
||||||
|
hi def link cPOSIXFunction Function
|
||||||
|
endif
|
||||||
|
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
" Source: aftersyntaxc.vim
|
" Source: aftersyntaxc.vim
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
@@ -306,3 +317,5 @@ hi def link cBoolean Boolean
|
|||||||
"hi def link cDelimiter Delimiter
|
"hi def link cDelimiter Delimiter
|
||||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||||
"hi def link cBraces Delimiter
|
"hi def link cBraces Delimiter
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'cjsx') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
if exists('b:current_syntax')
|
||||||
let s:current_syntax=b:current_syntax
|
let s:current_syntax=b:current_syntax
|
||||||
@@ -29,3 +27,5 @@ hi def link cjsxTagName Function
|
|||||||
hi def link cjsxEntity Statement
|
hi def link cjsxEntity Statement
|
||||||
hi def link cjsxEntityPunct Type
|
hi def link cjsxEntityPunct Type
|
||||||
hi def link cjsxAttribProperty Type
|
hi def link cjsxAttribProperty Type
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'c++11') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C++ Additions
|
" Language: C++ Additions
|
||||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||||
" URL: http://www.haeggblad.com
|
" URL: http://www.haeggblad.com
|
||||||
" Last Change: 1 Feb 2018
|
" Last Change: 29 Jun 2019
|
||||||
" Version: 0.6
|
" Version: 0.6
|
||||||
" Changelog:
|
" Changelog:
|
||||||
" 0.1 - initial version.
|
" 0.1 - initial version.
|
||||||
@@ -635,21 +633,19 @@ syntax keyword cppSTLios unitbuf
|
|||||||
syntax keyword cppSTLios uppercase
|
syntax keyword cppSTLios uppercase
|
||||||
"syntax keyword cppSTLios ws
|
"syntax keyword cppSTLios ws
|
||||||
syntax keyword cppSTLiterator back_insert_iterator
|
syntax keyword cppSTLiterator back_insert_iterator
|
||||||
syntax keyword cppSTLiterator bidirectional_iterator
|
|
||||||
syntax keyword cppSTLiterator const_iterator
|
syntax keyword cppSTLiterator const_iterator
|
||||||
syntax keyword cppSTLiterator const_reverse_iterator
|
syntax keyword cppSTLiterator const_reverse_iterator
|
||||||
syntax keyword cppSTLiterator forward_iterator
|
|
||||||
syntax keyword cppSTLiterator front_insert_iterator
|
syntax keyword cppSTLiterator front_insert_iterator
|
||||||
syntax keyword cppSTLiterator input_iterator
|
|
||||||
syntax keyword cppSTLiterator insert_iterator
|
syntax keyword cppSTLiterator insert_iterator
|
||||||
syntax keyword cppSTLiterator istreambuf_iterator
|
syntax keyword cppSTLiterator istreambuf_iterator
|
||||||
syntax keyword cppSTLiterator istream_iterator
|
syntax keyword cppSTLiterator istream_iterator
|
||||||
|
syntax keyword cppSTLiterator ostreambuf_iterator
|
||||||
|
syntax keyword cppSTLiterator ostream_iterator
|
||||||
syntax keyword cppSTLiterator iterator
|
syntax keyword cppSTLiterator iterator
|
||||||
syntax keyword cppSTLiterator ostream_iterator
|
syntax keyword cppSTLiterator ostream_iterator
|
||||||
syntax keyword cppSTLiterator output_iterator
|
syntax keyword cppSTLiterator output_iterator
|
||||||
syntax keyword cppSTLiterator random_access_iterator
|
|
||||||
syntax keyword cppSTLiterator raw_storage_iterator
|
syntax keyword cppSTLiterator raw_storage_iterator
|
||||||
syntax keyword cppSTLiterator reverse_bidirectional_iterator
|
syntax keyword cppSTLiterator move_iterator
|
||||||
syntax keyword cppSTLiterator reverse_iterator
|
syntax keyword cppSTLiterator reverse_iterator
|
||||||
syntax keyword cppSTLiterator_tag bidirectional_iterator_tag
|
syntax keyword cppSTLiterator_tag bidirectional_iterator_tag
|
||||||
syntax keyword cppSTLiterator_tag forward_iterator_tag
|
syntax keyword cppSTLiterator_tag forward_iterator_tag
|
||||||
@@ -964,6 +960,12 @@ if !exists("cpp_no_cpp11")
|
|||||||
syntax keyword cppSTLtype atomic_uintmax_t
|
syntax keyword cppSTLtype atomic_uintmax_t
|
||||||
syntax keyword cppSTLconstant ATOMIC_FLAG_INIT
|
syntax keyword cppSTLconstant ATOMIC_FLAG_INIT
|
||||||
syntax keyword cppSTLenum memory_order
|
syntax keyword cppSTLenum memory_order
|
||||||
|
syntax keyword cppSTLtype memory_order_relaxed
|
||||||
|
syntax keyword cppSTLtype memory_order_consume
|
||||||
|
syntax keyword cppSTLtype memory_order_acquire
|
||||||
|
syntax keyword cppSTLtype memory_order_release
|
||||||
|
syntax keyword cppSTLtype memory_order_acq_rel
|
||||||
|
syntax keyword cppSTLtype memory_order_seq_cst
|
||||||
syntax keyword cppSTLfunction is_lock_free
|
syntax keyword cppSTLfunction is_lock_free
|
||||||
syntax keyword cppSTLfunction compare_exchange_weak
|
syntax keyword cppSTLfunction compare_exchange_weak
|
||||||
syntax keyword cppSTLfunction compare_exchange_strong
|
syntax keyword cppSTLfunction compare_exchange_strong
|
||||||
@@ -1589,6 +1591,8 @@ endif " C++14
|
|||||||
|
|
||||||
|
|
||||||
if !exists("cpp_no_cpp17")
|
if !exists("cpp_no_cpp17")
|
||||||
|
syntax keyword cppSTLnamespace pmr
|
||||||
|
|
||||||
" algorithm
|
" algorithm
|
||||||
syntax keyword cppSTLfunction clamp
|
syntax keyword cppSTLfunction clamp
|
||||||
syntax keyword cppSTLfunction for_each_n
|
syntax keyword cppSTLfunction for_each_n
|
||||||
@@ -1981,84 +1985,278 @@ endif " C++17
|
|||||||
|
|
||||||
|
|
||||||
if !exists("cpp_no_cpp20")
|
if !exists("cpp_no_cpp20")
|
||||||
|
syntax keyword cppType char8_t
|
||||||
|
syntax keyword cppStatement co_yield co_return co_await
|
||||||
|
syntax keyword cppStorageClass consteval
|
||||||
|
syntax keyword cppSTLnamespace ranges
|
||||||
|
|
||||||
|
" algorithm
|
||||||
|
syntax keyword cppSTLfunction shift_left
|
||||||
|
syntax keyword cppSTLfunction shift_right
|
||||||
|
syntax keyword cppSTLfunction lexicographical_compare_three_way
|
||||||
|
|
||||||
|
" bit
|
||||||
|
syntax keyword cppSTLcast bit_cast
|
||||||
|
syntax keyword cppSTLfunction ispow2
|
||||||
|
syntax keyword cppSTLfunction ceil2
|
||||||
|
syntax keyword cppSTLfunction floor2
|
||||||
|
syntax keyword cppSTLfunction log2p1
|
||||||
|
syntax keyword cppSTLfunction rotl
|
||||||
|
syntax keyword cppSTLfunction rotr
|
||||||
|
syntax keyword cppSTLfunction countl_zero
|
||||||
|
syntax keyword cppSTLfunction countl_one
|
||||||
|
syntax keyword cppSTLfunction countr_zero
|
||||||
|
syntax keyword cppSTLfunction countr_one
|
||||||
|
syntax keyword cppSTLfunction popcount
|
||||||
|
syntax keyword cppSTLtype endian
|
||||||
|
|
||||||
|
" compare
|
||||||
|
syntax keyword cppSTLtype weak_equality
|
||||||
|
syntax keyword cppSTLtype strong_equality
|
||||||
|
syntax keyword cppSTLtype partial_ordering
|
||||||
|
syntax keyword cppSTLtype weak_ordering
|
||||||
|
syntax keyword cppSTLtype strong_ordering
|
||||||
|
syntax keyword cppSTLtype common_comparison_category
|
||||||
|
syntax keyword cppSTLtype compare_three_way_result
|
||||||
|
syntax keyword cppSTLtype compare_three_way
|
||||||
|
syntax keyword cppSTLtype strong_order
|
||||||
|
syntax keyword cppSTLtype weak_order
|
||||||
|
syntax keyword cppSTLtype parital_order
|
||||||
|
syntax keyword cppSTLtype compare_strong_order_fallback
|
||||||
|
syntax keyword cppSTLtype compare_weak_order_fallback
|
||||||
|
syntax keyword cppSTLtype compare_parital_order_fallback
|
||||||
|
syntax keyword cppSTLfunction is_eq
|
||||||
|
syntax keyword cppSTLfunction is_neq
|
||||||
|
syntax keyword cppSTLfunction is_lt
|
||||||
|
syntax keyword cppSTLfunction is_lteq
|
||||||
|
syntax keyword cppSTLfunction is_gt
|
||||||
|
syntax keyword cppSTLfunction is_gteq
|
||||||
|
|
||||||
|
" format
|
||||||
|
syntax keyword cppSTLtype formatter
|
||||||
|
syntax keyword cppSTLtype basic_format_parse_context
|
||||||
|
syntax keyword cppSTLtype format_parse_context
|
||||||
|
syntax keyword cppSTLtype wformat_parse_context
|
||||||
|
syntax keyword cppSTLtype basic_format_context
|
||||||
|
syntax keyword cppSTLtype format_context
|
||||||
|
syntax keyword cppSTLtype wformat_context
|
||||||
|
syntax keyword cppSTLtype basic_format_arg
|
||||||
|
syntax keyword cppSTLtype basic_format_args
|
||||||
|
syntax keyword cppSTLtype format_args
|
||||||
|
syntax keyword cppSTLtype wformat_args
|
||||||
|
syntax keyword cppSTLtype format_args_t
|
||||||
|
syntax keyword cppSTLtype format_error
|
||||||
|
syntax keyword cppSTLfuntion format
|
||||||
|
syntax keyword cppSTLfuntion format_to
|
||||||
|
syntax keyword cppSTLfuntion format_to_n
|
||||||
|
syntax keyword cppSTLfuntion formatted_size
|
||||||
|
syntax keyword cppSTLfuntion vformat
|
||||||
|
syntax keyword cppSTLfuntion vformat_to
|
||||||
|
syntax keyword cppSTLfuntion visit_format_arg
|
||||||
|
syntax keyword cppSTLfuntion make_format_args
|
||||||
|
syntax keyword cppSTLfuntion make_wformat_args
|
||||||
|
|
||||||
|
" iterator
|
||||||
|
syntax keyword cppSTLtype default_sentinel_t unreachable_sentinel_t
|
||||||
|
syntax keyword cppSTLiterator common_iterator
|
||||||
|
syntax keyword cppSTLiterator counted_iterator
|
||||||
|
syntax keyword cppSTLiterator_tag contiguous_iterator_tag
|
||||||
|
|
||||||
|
" memory
|
||||||
|
syntax keyword cppSTLfunction to_address
|
||||||
|
syntax keyword cppSTLfunction assume_aligned
|
||||||
|
syntax keyword cppSTLfunction make_unique_default_init
|
||||||
|
syntax keyword cppSTLfunction allocate_shared_default_init
|
||||||
|
|
||||||
|
" source_location
|
||||||
|
syntax keyword cppSTLtype source_location
|
||||||
|
|
||||||
|
" span
|
||||||
|
syntax keyword cppSTLtype span
|
||||||
|
syntax keyword cppSTLfunction as_bytes
|
||||||
|
syntax keyword cppSTLfunction as_writable_bytes
|
||||||
|
syntax keyword cppSTLconstant dynamic_extent
|
||||||
|
|
||||||
|
" syncstream
|
||||||
|
syntax keyword cppSTLtype basic_syncbuf
|
||||||
|
syntax keyword cppSTLtype basic_osyncstream
|
||||||
|
syntax keyword cppSTLtype syncbuf
|
||||||
|
syntax keyword cppSTLtype wsyncbuf
|
||||||
|
syntax keyword cppSTLtype osyncstream
|
||||||
|
syntax keyword cppSTLtype wosyncstream
|
||||||
|
|
||||||
" type_traits
|
" type_traits
|
||||||
syntax keyword cppSTLtype remove_cvref remove_cvref_t
|
syntax keyword cppSTLtype remove_cvref remove_cvref_t
|
||||||
|
syntax keyword cppSTLtype common_reference common_reference_t
|
||||||
|
syntax keyword cppSTLfunction is_constant_evaluated
|
||||||
|
syntax keyword cppSTLfunction is_pointer_interconvertible
|
||||||
|
syntax keyword cppSTLfunction is_corresponding_member
|
||||||
|
syntax keyword cppSTLtype is_nothrow_convertible
|
||||||
|
syntax keyword cppSTLbool is_nothrow_convertible_v
|
||||||
|
syntax keyword cppSTLtype is_layout_compatible
|
||||||
|
syntax keyword cppSTLbool is_layout_compatible_v
|
||||||
|
syntax keyword cppSTLtype is_bounded_array
|
||||||
|
syntax keyword cppSTLbool is_bounded_array_v
|
||||||
|
syntax keyword cppSTLtype is_unbounded_array
|
||||||
|
syntax keyword cppSTLbool is_unbounded_array_v
|
||||||
|
syntax keyword cppSTLtype is_pointer_interconvertible_base_of
|
||||||
|
syntax keyword cppSTLbool is_pointer_interconvertible_base_of_v
|
||||||
|
syntax keyword cppSTLtype has_strong_structural_equality
|
||||||
|
syntax keyword cppSTLbool has_strong_structural_equality_v
|
||||||
|
|
||||||
|
" version
|
||||||
|
" TODO
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
if exists('g:cpp_concepts_highlight') && g:cpp_concepts_highlight
|
if exists('g:cpp_concepts_highlight')
|
||||||
syntax keyword cppStatement concept
|
syntax keyword cppStatement concept
|
||||||
syntax keyword cppStorageClass requires
|
syntax keyword cppStorageClass requires
|
||||||
syntax keyword cppSTLtype DefaultConstructible
|
|
||||||
syntax keyword cppSTLtype MoveConstructible
|
if g:cpp_concepts_highlight == 1
|
||||||
syntax keyword cppSTLtype CopyConstructible
|
syntax keyword cppSTLconcept DefaultConstructible
|
||||||
syntax keyword cppSTLtype MoveAssignable
|
syntax keyword cppSTLconcept MoveConstructible
|
||||||
syntax keyword cppSTLtype CopyAssignable
|
syntax keyword cppSTLconcept CopyConstructible
|
||||||
syntax keyword cppSTLtype Destructible
|
syntax keyword cppSTLconcept MoveAssignable
|
||||||
syntax keyword cppSTLtype TriviallyCopyable
|
syntax keyword cppSTLconcept CopyAssignable
|
||||||
syntax keyword cppSTLtype TrivialType
|
syntax keyword cppSTLconcept Destructible
|
||||||
syntax keyword cppSTLtype StandardLayoutType
|
syntax keyword cppSTLconcept TriviallyCopyable
|
||||||
syntax keyword cppSTLtype PODType
|
syntax keyword cppSTLconcept TrivialType
|
||||||
syntax keyword cppSTLtype EqualityComparable
|
syntax keyword cppSTLconcept StandardLayoutType
|
||||||
syntax keyword cppSTLtype LessThanComparable
|
syntax keyword cppSTLconcept PODType
|
||||||
syntax keyword cppSTLtype Swappable
|
syntax keyword cppSTLconcept EqualityComparable
|
||||||
syntax keyword cppSTLtype ValueSwappable
|
syntax keyword cppSTLconcept LessThanComparable
|
||||||
syntax keyword cppSTLtype NullablePointer
|
syntax keyword cppSTLconcept Swappable
|
||||||
syntax keyword cppSTLtype Hash
|
syntax keyword cppSTLconcept ValueSwappable
|
||||||
syntax keyword cppSTLtype Allocator
|
syntax keyword cppSTLconcept NullablePointer
|
||||||
syntax keyword cppSTLtype FunctionObject
|
syntax keyword cppSTLconcept Hash
|
||||||
syntax keyword cppSTLtype Callable
|
syntax keyword cppSTLconcept Allocator
|
||||||
syntax keyword cppSTLtype Predicate
|
syntax keyword cppSTLconcept FunctionObject
|
||||||
syntax keyword cppSTLtype BinaryPredicate
|
syntax keyword cppSTLconcept Callable
|
||||||
syntax keyword cppSTLtype Compare
|
syntax keyword cppSTLconcept Predicate
|
||||||
syntax keyword cppSTLtype Container
|
syntax keyword cppSTLconcept BinaryPredicate
|
||||||
syntax keyword cppSTLtype ReversibleContainer
|
syntax keyword cppSTLconcept Compare
|
||||||
syntax keyword cppSTLtype AllocatorAwareContainer
|
syntax keyword cppSTLconcept Container
|
||||||
syntax keyword cppSTLtype SequenceContainer
|
syntax keyword cppSTLconcept ReversibleContainer
|
||||||
syntax keyword cppSTLtype ContiguousContainer
|
syntax keyword cppSTLconcept AllocatorAwareContainer
|
||||||
syntax keyword cppSTLtype AssociativeContainer
|
syntax keyword cppSTLconcept SequenceContainer
|
||||||
syntax keyword cppSTLtype UnorderedAssociativeContainer
|
syntax keyword cppSTLconcept ContiguousContainer
|
||||||
syntax keyword cppSTLtype DefaultInsertable
|
syntax keyword cppSTLconcept AssociativeContainer
|
||||||
syntax keyword cppSTLtype CopyInsertable
|
syntax keyword cppSTLconcept UnorderedAssociativeContainer
|
||||||
syntax keyword cppSTLtype CopyInsertable
|
syntax keyword cppSTLconcept DefaultInsertable
|
||||||
syntax keyword cppSTLtype MoveInsertable
|
syntax keyword cppSTLconcept CopyInsertable
|
||||||
syntax keyword cppSTLtype EmplaceConstructible
|
syntax keyword cppSTLconcept CopyInsertable
|
||||||
syntax keyword cppSTLtype Erasable
|
syntax keyword cppSTLconcept MoveInsertable
|
||||||
syntax keyword cppSTLtype Iterator
|
syntax keyword cppSTLconcept EmplaceConstructible
|
||||||
syntax keyword cppSTLtype InputIterator
|
syntax keyword cppSTLconcept Erasable
|
||||||
syntax keyword cppSTLtype OutputIterator
|
syntax keyword cppSTLconcept Iterator
|
||||||
syntax keyword cppSTLtype ForwardIterator
|
syntax keyword cppSTLconcept InputIterator
|
||||||
syntax keyword cppSTLtype BidirectionalIterator
|
syntax keyword cppSTLconcept OutputIterator
|
||||||
syntax keyword cppSTLtype RandomAccessIterator
|
syntax keyword cppSTLconcept ForwardIterator
|
||||||
syntax keyword cppSTLtype ContiguousIterator
|
syntax keyword cppSTLconcept BidirectionalIterator
|
||||||
syntax keyword cppSTLtype UnformattedInputFunction
|
syntax keyword cppSTLconcept RandomAccessIterator
|
||||||
syntax keyword cppSTLtype FormattedInputFunction
|
syntax keyword cppSTLconcept ContiguousIterator
|
||||||
syntax keyword cppSTLtype UnformattedOutputFunction
|
syntax keyword cppSTLconcept UnformattedInputFunction
|
||||||
syntax keyword cppSTLtype FormattedOutputFunction
|
syntax keyword cppSTLconcept FormattedInputFunction
|
||||||
syntax keyword cppSTLtype SeedSequence
|
syntax keyword cppSTLconcept UnformattedOutputFunction
|
||||||
syntax keyword cppSTLtype UniformRandomBitGenerator
|
syntax keyword cppSTLconcept FormattedOutputFunction
|
||||||
syntax keyword cppSTLtype RandomNumberEngine
|
syntax keyword cppSTLconcept SeedSequence
|
||||||
syntax keyword cppSTLtype RandomNumberEngineAdaptor
|
syntax keyword cppSTLconcept UniformRandomBitGenerator
|
||||||
syntax keyword cppSTLtype RandomNumberDistribution
|
syntax keyword cppSTLconcept RandomNumberEngine
|
||||||
syntax keyword cppSTLtype BasicLockable
|
syntax keyword cppSTLconcept RandomNumberEngineAdaptor
|
||||||
syntax keyword cppSTLtype Lockable
|
syntax keyword cppSTLconcept RandomNumberDistribution
|
||||||
syntax keyword cppSTLtype TimedLockable
|
syntax keyword cppSTLconcept BasicLockable
|
||||||
syntax keyword cppSTLtype Mutex
|
syntax keyword cppSTLconcept Lockable
|
||||||
syntax keyword cppSTLtype TimedMutex
|
syntax keyword cppSTLconcept TimedLockable
|
||||||
syntax keyword cppSTLtype SharedMutex
|
syntax keyword cppSTLconcept Mutex
|
||||||
syntax keyword cppSTLtype SharedTimedMutex
|
syntax keyword cppSTLconcept TimedMutex
|
||||||
syntax keyword cppSTLtype UnaryTypeTrait
|
syntax keyword cppSTLconcept SharedMutex
|
||||||
syntax keyword cppSTLtype BinaryTypeTrait
|
syntax keyword cppSTLconcept SharedTimedMutex
|
||||||
syntax keyword cppSTLtype TransformationTrait
|
syntax keyword cppSTLconcept UnaryTypeTrait
|
||||||
syntax keyword cppSTLtype Clock
|
syntax keyword cppSTLconcept BinaryTypeTrait
|
||||||
syntax keyword cppSTLtype TrivialClock
|
syntax keyword cppSTLconcept TransformationTrait
|
||||||
syntax keyword cppSTLtype CharTraits
|
syntax keyword cppSTLconcept Clock
|
||||||
syntax keyword cppSTLtype pos_type
|
syntax keyword cppSTLconcept TrivialClock
|
||||||
syntax keyword cppSTLtype off_type
|
syntax keyword cppSTLconcept CharTraits
|
||||||
syntax keyword cppSTLtype BitmaskType
|
syntax keyword cppSTLconcept pos_type
|
||||||
syntax keyword cppSTLtype NumericType
|
syntax keyword cppSTLconcept off_type
|
||||||
syntax keyword cppSTLtype RegexTraits
|
syntax keyword cppSTLconcept BitmaskType
|
||||||
syntax keyword cppSTLtype LiteralType
|
syntax keyword cppSTLconcept NumericType
|
||||||
|
syntax keyword cppSTLconcept RegexTraits
|
||||||
|
syntax keyword cppSTLconcept LiteralType
|
||||||
|
elseif g:cpp_concepts_highlight == 2
|
||||||
|
syntax keyword cppSTLconcept same_as
|
||||||
|
syntax keyword cppSTLconcept derived_from
|
||||||
|
syntax keyword cppSTLconcept convertible_to
|
||||||
|
syntax keyword cppSTLconcept common_reference_with
|
||||||
|
syntax keyword cppSTLconcept common_with
|
||||||
|
syntax keyword cppSTLconcept integral
|
||||||
|
syntax keyword cppSTLconcept signed_integral
|
||||||
|
syntax keyword cppSTLconcept unsigned_integral
|
||||||
|
syntax keyword cppSTLconcept assignable_from
|
||||||
|
syntax keyword cppSTLconcept swappable
|
||||||
|
syntax keyword cppSTLconcept swappable_with
|
||||||
|
syntax keyword cppSTLconcept destructible
|
||||||
|
syntax keyword cppSTLconcept constructible_from
|
||||||
|
syntax keyword cppSTLconcept default_constructible
|
||||||
|
syntax keyword cppSTLconcept move_constructible
|
||||||
|
syntax keyword cppSTLconcept copy_constructible
|
||||||
|
syntax keyword cppSTLconcept boolean
|
||||||
|
syntax keyword cppSTLconcept equality_comparable
|
||||||
|
syntax keyword cppSTLconcept equality_comparable_with
|
||||||
|
syntax keyword cppSTLconcept totally_ordered
|
||||||
|
syntax keyword cppSTLconcept totally_ordered_with
|
||||||
|
syntax keyword cppSTLconcept movable
|
||||||
|
syntax keyword cppSTLconcept copyable
|
||||||
|
syntax keyword cppSTLconcept semiregular
|
||||||
|
syntax keyword cppSTLconcept regular
|
||||||
|
syntax keyword cppSTLconcept invocable
|
||||||
|
syntax keyword cppSTLconcept regular_invocable
|
||||||
|
syntax keyword cppSTLconcept predicate
|
||||||
|
syntax keyword cppSTLconcept relation
|
||||||
|
syntax keyword cppSTLconcept strict_weak_order
|
||||||
|
syntax keyword cppSTLconcept readable
|
||||||
|
syntax keyword cppSTLconcept writable
|
||||||
|
syntax keyword cppSTLconcept weakly_incrementable
|
||||||
|
syntax keyword cppSTLconcept incrementable
|
||||||
|
syntax keyword cppSTLconcept input_or_output_iterator
|
||||||
|
syntax keyword cppSTLconcept sentinal_for
|
||||||
|
syntax keyword cppSTLconcept sized_sentinal_for
|
||||||
|
syntax keyword cppSTLconcept input_iterator
|
||||||
|
syntax keyword cppSTLconcept output_iterator
|
||||||
|
syntax keyword cppSTLconcept forward_iterator
|
||||||
|
syntax keyword cppSTLconcept bidirectional_iterator
|
||||||
|
syntax keyword cppSTLconcept random_access_iterator
|
||||||
|
syntax keyword cppSTLconcept input_iterator
|
||||||
|
syntax keyword cppSTLconcept output_iterator
|
||||||
|
syntax keyword cppSTLconcept bidirectional_iterator
|
||||||
|
syntax keyword cppSTLconcept random_access_iterator
|
||||||
|
syntax keyword cppSTLconcept contiguous_iterator
|
||||||
|
syntax keyword cppSTLconcept indirectly_unary_invocable
|
||||||
|
syntax keyword cppSTLconcept indirectly_regular_unary_invocable
|
||||||
|
syntax keyword cppSTLconcept indirect_unary_predicate
|
||||||
|
syntax keyword cppSTLconcept indirect_relation
|
||||||
|
syntax keyword cppSTLconcept indirect_strict_weak_order
|
||||||
|
syntax keyword cppSTLconcept indirectly_movable
|
||||||
|
syntax keyword cppSTLconcept indirectly_movable_storable
|
||||||
|
syntax keyword cppSTLconcept indirectly_copyable
|
||||||
|
syntax keyword cppSTLconcept indirectly_copyable_storable
|
||||||
|
syntax keyword cppSTLconcept indirectly_swappable
|
||||||
|
syntax keyword cppSTLconcept indirectly_comparable
|
||||||
|
syntax keyword cppSTLconcept permutable
|
||||||
|
syntax keyword cppSTLconcept mergeable
|
||||||
|
syntax keyword cppSTLconcept sortable
|
||||||
|
syntax keyword cppSTLconcept range
|
||||||
|
syntax keyword cppSTLconcept sized_range
|
||||||
|
syntax keyword cppSTLconcept output_range
|
||||||
|
syntax keyword cppSTLconcept input_range
|
||||||
|
syntax keyword cppSTLconcept bidirectional_range
|
||||||
|
syntax keyword cppSTLconcept random_access_range
|
||||||
|
syntax keyword cppSTLconcept contiguous_range
|
||||||
|
syntax keyword cppSTLconcept common_range
|
||||||
|
syntax keyword cppSTLconcept viewable_range
|
||||||
|
syntax keyword cppSTLconcept uniform_random_bit_generator
|
||||||
|
endif
|
||||||
endif " C++ concepts
|
endif " C++ concepts
|
||||||
|
|
||||||
|
|
||||||
@@ -2088,9 +2286,12 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
|||||||
HiLink cppSTLiterator Typedef
|
HiLink cppSTLiterator Typedef
|
||||||
HiLink cppSTLiterator_tag Typedef
|
HiLink cppSTLiterator_tag Typedef
|
||||||
HiLink cppSTLenum Typedef
|
HiLink cppSTLenum Typedef
|
||||||
|
HiLink cppSTLconcept Typedef
|
||||||
HiLink cppSTLios Function
|
HiLink cppSTLios Function
|
||||||
HiLink cppSTLcast Statement " be consistent with official syntax
|
HiLink cppSTLcast Statement " be consistent with official syntax
|
||||||
HiLink cppRawString String
|
HiLink cppRawString String
|
||||||
HiLink cppRawDelimiter Delimiter
|
HiLink cppRawDelimiter Delimiter
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
17
after/syntax/haskell.vim
Normal file
17
after/syntax/haskell.vim
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dhall') == -1
|
||||||
|
|
||||||
|
" store and remove current syntax value
|
||||||
|
let old_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn include @dhall syntax/dhall.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn region dhallBlock matchgroup=quasiQuote start=/\[\$\?staticDhallExpression|/ end=/|\]/ contains=@dhall
|
||||||
|
|
||||||
|
hi def link quasiQuote Underlined
|
||||||
|
|
||||||
|
" restore current syntax value
|
||||||
|
let b:current_syntax = old_syntax
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scala') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Extends standard help syntax with highlighting of Scala code.
|
" Extends standard help syntax with highlighting of Scala code.
|
||||||
"
|
"
|
||||||
@@ -16,3 +14,5 @@ if has('conceal')
|
|||||||
else
|
else
|
||||||
syntax region rgnScala matchgroup=Ignore start='!sc!' end='!/sc!' contains=@ScalaCode
|
syntax region rgnScala matchgroup=Ignore start='!sc!' end='!/sc!' contains=@ScalaCode
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: HTML (version 5.1)
|
" Language: HTML (version 5.1)
|
||||||
@@ -14,3 +12,5 @@ endif
|
|||||||
" https://github.com/w3c/html/issues/694
|
" https://github.com/w3c/html/issues/694
|
||||||
syntax region htmlComment start=+<!--+ end=+-->+ contains=@Spell
|
syntax region htmlComment start=+<!--+ end=+-->+ contains=@Spell
|
||||||
syntax region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
syntax region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'idris') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" This script allows for unicode concealing of certain characters
|
" This script allows for unicode concealing of certain characters
|
||||||
" For instance -> goes to →
|
" For instance -> goes to →
|
||||||
@@ -80,3 +78,5 @@ hi link idrNiceOperator Operator
|
|||||||
hi! link Conceal Operator
|
hi! link Conceal Operator
|
||||||
setlocal conceallevel=2
|
setlocal conceallevel=2
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
@@ -24,294 +22,38 @@ if exists('s:current_syntax')
|
|||||||
let b:current_syntax = s:current_syntax
|
let b:current_syntax = s:current_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if hlexists("jsNoise") " pangloss/vim-javascript
|
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
|
||||||
syntax cluster jsExpression add=jsxRegion
|
syntax cluster jsExpression add=jsxRegion
|
||||||
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||||
" refine the javascript line comment
|
" refine the javascript line comment
|
||||||
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||||
syntax cluster javascriptValue add=jsxRegion
|
syntax cluster javascriptValue add=jsxRegion
|
||||||
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
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
|
else " build-in javascript syntax
|
||||||
" refine the javascript line comment
|
" refine the javascript line comment
|
||||||
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||||
|
|
||||||
|
" refine the template string syntax
|
||||||
|
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
|
||||||
|
|
||||||
" add a javaScriptBlock group for build-in syntax
|
" add a javaScriptBlock group for build-in syntax
|
||||||
syntax region javaScriptBlockBuildIn
|
syntax region javaScriptBlock
|
||||||
\ contained
|
|
||||||
\ matchgroup=javaScriptBraces
|
\ matchgroup=javaScriptBraces
|
||||||
\ start="{"
|
\ start="{"
|
||||||
\ end="}"
|
\ end="}"
|
||||||
|
\ contained
|
||||||
\ extend
|
\ extend
|
||||||
\ contains=javaScriptBlockBuildIn,@javaScriptEmbededExpr,javaScript.*
|
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
|
||||||
\ fold
|
\ fold
|
||||||
syntax cluster javaScriptEmbededExpr add=jsxRegion
|
|
||||||
|
|
||||||
" refine the template string syntax
|
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
|
||||||
syntax region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend
|
|
||||||
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr,javaScript.*
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" because this is autoloaded, when developing you're going to need to source
|
runtime syntax/jsx_pretty.vim
|
||||||
" the autoload/jsx_pretty/*.vim file manually, or restart vim
|
|
||||||
call jsx_pretty#syntax#highlight()
|
|
||||||
|
|
||||||
let b:current_syntax = 'javascript.jsx'
|
let b:current_syntax = 'javascript.jsx'
|
||||||
|
|
||||||
let &cpo = s:jsx_cpo
|
let &cpo = s:jsx_cpo
|
||||||
unlet 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
|
endif
|
||||||
|
|||||||
27
after/syntax/javascript/graphql.vim
Normal file
27
after/syntax/javascript/graphql.vim
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||||
|
|
||||||
|
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(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
|
||||||
|
|
||||||
|
endif
|
||||||
5
after/syntax/javascriptreact.vim
Normal file
5
after/syntax/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/javascript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
225
after/syntax/jsx_pretty.vim
Normal file
225
after/syntax/jsx_pretty.vim
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
||||||
|
|
||||||
|
" detect jsx region
|
||||||
|
syntax region jsxRegion
|
||||||
|
\ start=+\%(\%(\_[([,?:=+\-*/>{}]\|<\s\+\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\%(>\|\z(\%(script\|T\s*>\s*(\)\@!\<[_$A-Za-z][-:._$A-Za-z0-9]*\>\)\%(\_s*\%([-+*)\]}&|?,]\|/\%([/*]\|\_s*>\)\@!\)\)\@!\)+
|
||||||
|
\ end=++
|
||||||
|
\ contains=jsxElement
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~~~~~~~~~~~~~~~~~
|
||||||
|
" and self close tag
|
||||||
|
" <tag id="sample" />
|
||||||
|
" ~~~~~~~~~~~~~~~~~~~
|
||||||
|
syntax region jsxTag
|
||||||
|
\ start=+<+
|
||||||
|
\ matchgroup=jsxOpenPunct
|
||||||
|
\ end=+>+
|
||||||
|
\ matchgroup=NONE
|
||||||
|
\ end=+\%(/\_s*>\)\@=+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxOpenTag,jsxAttrib,jsxEscapeJs,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
|
||||||
|
\ keepend
|
||||||
|
\ extend
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty
|
||||||
|
\ nextgroup=jsxCloseString
|
||||||
|
|
||||||
|
" <tag></tag>
|
||||||
|
" ~~~~~~~~~~~
|
||||||
|
" and fragment
|
||||||
|
" <></>
|
||||||
|
" ~~~~~
|
||||||
|
" and self close tag
|
||||||
|
" <tag />
|
||||||
|
" ~~~~~~~
|
||||||
|
syntax region jsxElement
|
||||||
|
\ start=+<\_s*\%(>\|\${\|\z(\<[-:._$A-Za-z0-9]\+\>\)\)+
|
||||||
|
\ end=+/\_s*>+
|
||||||
|
\ end=+<\_s*/\_s*\z1\_s*>+
|
||||||
|
\ contains=jsxElement,jsxTag,jsxEscapeJs,jsxComment,jsxCloseTag,@Spell
|
||||||
|
\ keepend
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ fold
|
||||||
|
|
||||||
|
" <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' : '')
|
||||||
|
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~~~~~~~~~~~~~~
|
||||||
|
syntax region jsxEscapeJs
|
||||||
|
\ matchgroup=jsxBraces
|
||||||
|
\ start=+{+
|
||||||
|
\ end=+}+
|
||||||
|
\ contained
|
||||||
|
\ extend
|
||||||
|
\ contains=@jsExpression,jsSpreadExpression,@javascriptExpression,javascriptSpreadOp,@javaScriptEmbededExpr,@typescriptExpression,typescriptObjectSpread
|
||||||
|
|
||||||
|
" <foo.bar>
|
||||||
|
" ~
|
||||||
|
syntax match jsxDot +\.+ contained
|
||||||
|
|
||||||
|
" <foo:bar>
|
||||||
|
" ~
|
||||||
|
syntax match jsxNamespace +:+ contained
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~
|
||||||
|
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxEscapeJs,jsxRegion
|
||||||
|
|
||||||
|
" <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][-:_$A-Za-z0-9]*\>+
|
||||||
|
\ contained
|
||||||
|
\ nextgroup=jsxEqual
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty
|
||||||
|
\ contains=jsxAttribKeyword,jsxNamespace
|
||||||
|
|
||||||
|
" <MyComponent ...>
|
||||||
|
" ~~~~~~~~~~~
|
||||||
|
" NOT
|
||||||
|
" <someCamel ...>
|
||||||
|
" ~~~~~
|
||||||
|
exe 'syntax match jsxComponentName
|
||||||
|
\ +\<[_$]\?[A-Z][-_$A-Za-z0-9]*\>+
|
||||||
|
\ contained
|
||||||
|
\ ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||||
|
|
||||||
|
" <tag key={this.props.key}>
|
||||||
|
" ~~~
|
||||||
|
exe 'syntax match jsxTagName
|
||||||
|
\ +\<[-:._$A-Za-z0-9]\+\>+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxComponentName,jsxDot,jsxNamespace
|
||||||
|
\ nextgroup=jsxAttrib
|
||||||
|
\ skipempty
|
||||||
|
\ skipwhite
|
||||||
|
\ ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||||
|
|
||||||
|
" <tag id="sample">
|
||||||
|
" ~~~~~~~~
|
||||||
|
" and
|
||||||
|
" <tag id='sample'>
|
||||||
|
" ~~~~~~~~
|
||||||
|
syntax region jsxString start=+\z(["']\)+ skip=+\\\\\|\\\z1\|\\\n+ end=+\z1+ contained contains=@Spell
|
||||||
|
|
||||||
|
let s:tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'jsx'])
|
||||||
|
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 match jsxRegion +\%(' . join(s:tags, '\|') . '\)\%(\_s*`\)\@=+ contains=jsTemplateStringTag,jsTaggedTemplate,javascriptTagRef skipwhite skipempty nextgroup=jsxTaggedRegion'
|
||||||
|
|
||||||
|
syntax region jsxTaggedRegion
|
||||||
|
\ matchgroup=jsxBackticks
|
||||||
|
\ start=+`+
|
||||||
|
\ end=+`+
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxElement,jsxEscapeJs
|
||||||
|
\ transparent
|
||||||
|
|
||||||
|
syntax region jsxEscapeJs
|
||||||
|
\ matchgroup=jsxBraces
|
||||||
|
\ start=+\${+
|
||||||
|
\ end=+}+
|
||||||
|
\ extend
|
||||||
|
\ contained
|
||||||
|
\ contains=@jsExpression,jsSpreadExpression,@javascriptExpression,javascriptSpreadOp,@javaScriptEmbededExpr,@typescriptExpression,typescriptObjectSpread
|
||||||
|
|
||||||
|
syntax region jsxOpenTag
|
||||||
|
\ matchgroup=jsxOpenPunct
|
||||||
|
\ start=+<\%(\${\)\@=+
|
||||||
|
\ matchgroup=NONE
|
||||||
|
\ end=+}\@1<=+
|
||||||
|
\ contained
|
||||||
|
\ contains=jsxEscapeJs
|
||||||
|
\ skipwhite
|
||||||
|
\ skipempty
|
||||||
|
\ nextgroup=jsxAttrib,jsxSpreadOperator
|
||||||
|
|
||||||
|
syntax keyword jsxAttribKeyword class contained
|
||||||
|
|
||||||
|
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxEscapeJs skipwhite
|
||||||
|
|
||||||
|
syntax match jsxCloseTag +<//>+ contained
|
||||||
|
|
||||||
|
syntax match jsxComment +<!--\_.\{-}-->+
|
||||||
|
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 jsxString String
|
||||||
|
highlight def link jsxComment Comment
|
||||||
|
|
||||||
|
highlight def link jsxDot Operator
|
||||||
|
highlight def link jsxNamespace Operator
|
||||||
|
highlight def link jsxEqual Operator
|
||||||
|
highlight def link jsxSpreadOperator Operator
|
||||||
|
highlight def link jsxBraces Special
|
||||||
|
|
||||||
|
if s:highlight_close_tag
|
||||||
|
highlight def link jsxCloseString Identifier
|
||||||
|
highlight def link jsxOpenPunct jsxTag
|
||||||
|
else
|
||||||
|
" Highlight the jsxCloseString (i.e. />), jsxPunct (i.e. <,>) and jsxCloseTag (i.e. <//>)
|
||||||
|
highlight def link jsxCloseString Comment
|
||||||
|
highlight def link jsxOpenPunct jsxPunct
|
||||||
|
endif
|
||||||
|
|
||||||
|
highlight def link jsxPunct jsxCloseString
|
||||||
|
highlight def link jsxClosePunct jsxPunct
|
||||||
|
highlight def link jsxCloseTag jsxCloseString
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'llvm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Copyright (c) 2018 rhysd
|
" Copyright (c) 2018 rhysd
|
||||||
"
|
"
|
||||||
@@ -24,3 +22,5 @@ endif
|
|||||||
|
|
||||||
syn keyword llvmKeyword attributes
|
syn keyword llvmKeyword attributes
|
||||||
syn match llvmNoName /#\d\+\>/
|
syn match llvmNoName /#\d\+\>/
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'mdx') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mdx') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" based on mxw/vim-jsx
|
" based on mxw/vim-jsx
|
||||||
@@ -43,3 +41,5 @@ syn cluster jsExpression add=jsxRegion
|
|||||||
|
|
||||||
" Allow jsxRegion to contain reserved words.
|
" Allow jsxRegion to contain reserved words.
|
||||||
syn cluster javascriptNoReserved add=jsxRegion
|
syn cluster javascriptNoReserved add=jsxRegion
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'mathematica') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"Vim conceal file
|
"Vim conceal file
|
||||||
" Language: Mathematica
|
" Language: Mathematica
|
||||||
@@ -1448,3 +1446,5 @@ endif
|
|||||||
hi! link Conceal Normal
|
hi! link Conceal Normal
|
||||||
setlocal conceallevel=2
|
setlocal conceallevel=2
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'objc') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ARC type modifiers
|
" ARC type modifiers
|
||||||
syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained
|
syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained
|
||||||
@@ -21,3 +19,5 @@ syn match objcDirective "@property\|@synthesize\|@dynamic\|@package"
|
|||||||
|
|
||||||
" Highlight property attributes as if they were type modifiers
|
" Highlight property attributes as if they were type modifiers
|
||||||
hi def link objcPropertyAttribute objcTypeModifier
|
hi def link objcPropertyAttribute objcTypeModifier
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'reason') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'reason') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rspec') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rspec') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"
|
"
|
||||||
" An rspec syntax file
|
" An rspec syntax file
|
||||||
@@ -34,3 +32,5 @@ syntax keyword rspecMessageExpectation advise any_args any_number_of_times anyth
|
|||||||
highlight link rspecMessageExpectation Function
|
highlight link rspecMessageExpectation Function
|
||||||
|
|
||||||
let b:current_syntax = 'rspec'
|
let b:current_syntax = 'rspec'
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'yard') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yard') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Ruby syntax extensions for highlighting YARD documentation.
|
" Ruby syntax extensions for highlighting YARD documentation.
|
||||||
"
|
"
|
||||||
@@ -128,3 +126,5 @@ hi def link yardParametricType yardComment
|
|||||||
hi def link yardArrow yardComment
|
hi def link yardArrow yardComment
|
||||||
hi def link yardHashAngle yardComment
|
hi def link yardHashAngle yardComment
|
||||||
hi def link yardHashCurly yardComment
|
hi def link yardHashCurly yardComment
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
@@ -43,3 +41,5 @@ if !get(g:, 'rust_conceal_mod_path', 0)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'latex') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" adds support for cleverref package
|
" adds support for cleverref package
|
||||||
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
|
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
|
||||||
@@ -11,3 +9,5 @@ syn region texRefZone matchgroup=texStatement start="\\\(label\|\)c\(page\|\)re
|
|||||||
syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>"
|
syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>"
|
||||||
syn match texInputFile "\\lstinputlisting\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
|
syn match texInputFile "\\lstinputlisting\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
|
||||||
syn match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"
|
syn match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
28
after/syntax/tsx.vim
Normal file
28
after/syntax/tsx.vim
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||||
|
|
||||||
|
" GraphQL Support
|
||||||
|
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(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
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
@@ -11,6 +9,10 @@ endif
|
|||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
let s:jsx_cpo = &cpo
|
let s:jsx_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
@@ -28,276 +30,31 @@ endif
|
|||||||
" refine the typescript line comment
|
" refine the typescript line comment
|
||||||
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
||||||
|
|
||||||
|
for syntax_name in ['tsxRegion', 'tsxFragment']
|
||||||
|
if hlexists(syntax_name)
|
||||||
|
exe 'syntax clear ' . syntax_name
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
if !hlexists('typescriptTypeCast')
|
||||||
" add a typescriptBlock group for typescript
|
" add a typescriptBlock group for typescript
|
||||||
syntax region typescriptBlock
|
syntax region typescriptBlock
|
||||||
\ contained
|
|
||||||
\ matchgroup=typescriptBraces
|
\ matchgroup=typescriptBraces
|
||||||
\ start="{"
|
\ start="{"
|
||||||
\ end="}"
|
\ end="}"
|
||||||
|
\ contained
|
||||||
\ extend
|
\ extend
|
||||||
\ contains=@typescriptAll,@typescriptExpression,typescriptBlock
|
\ contains=@typescriptExpression,typescriptBlock
|
||||||
\ fold
|
\ fold
|
||||||
|
endif
|
||||||
|
|
||||||
" because this is autoloaded, when developing you're going to need to source
|
syntax cluster typescriptExpression add=jsxRegion,typescriptParens
|
||||||
" the autoload/jsx_pretty/*.vim file manually, or restart vim
|
|
||||||
call jsx_pretty#syntax#highlight()
|
|
||||||
|
|
||||||
syntax cluster typescriptExpression add=jsxRegion
|
runtime syntax/jsx_pretty.vim
|
||||||
|
|
||||||
let b:current_syntax = 'typescript.tsx'
|
let b:current_syntax = 'typescript.tsx'
|
||||||
|
|
||||||
let &cpo = s:jsx_cpo
|
let &cpo = s:jsx_cpo
|
||||||
unlet 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
|
endif
|
||||||
|
|||||||
26
after/syntax/typescript/graphql.vim
Normal file
26
after/syntax/typescript/graphql.vim
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||||
|
|
||||||
|
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(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
|
||||||
|
|
||||||
|
endif
|
||||||
5
after/syntax/typescriptreact.vim
Normal file
5
after/syntax/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
source <sfile>:h/typescript.vim
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'yaml') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" To make this file do stuff, add something like the following (without the
|
" To make this file do stuff, add something like the following (without the
|
||||||
" leading ") to your ~/.vimrc:
|
" leading ") to your ~/.vimrc:
|
||||||
@@ -63,3 +61,5 @@ hi link yamlInline Operator
|
|||||||
hi link yamlBlock Operator
|
hi link yamlBlock Operator
|
||||||
hi link yamlString String
|
hi link yamlString String
|
||||||
hi link yamlEscape Special
|
hi link yamlEscape Special
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Support for LaTex-to-Unicode conversion as in the Julia REPL "
|
" Support for LaTex-to-Unicode conversion as in the Julia REPL "
|
||||||
@@ -652,3 +650,5 @@ function! LaTeXtoUnicode#Toggle()
|
|||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rst') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Author: Antony Lee <anntzer.lee@gmail.com>
|
" Author: Antony Lee <anntzer.lee@gmail.com>
|
||||||
" Description: Helper functions for reStructuredText syntax folding
|
" Description: Helper functions for reStructuredText syntax folding
|
||||||
@@ -64,3 +62,5 @@ function RstFold#GetRstFoldText()
|
|||||||
let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
|
let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
|
||||||
return indent . text
|
return indent . text
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! cargo#Load()
|
function! cargo#Load()
|
||||||
" Utility call to get this script loaded, for debugging
|
" Utility call to get this script loaded, for debugging
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! cargo#cmd(args)
|
function! cargo#cmd(args)
|
||||||
execute "! cargo" a:args
|
" Trim trailing spaces. This is necessary since :terminal command parses
|
||||||
|
" trailing spaces as an empty argument.
|
||||||
|
let args = substitute(a:args, '\s\+$', '', '')
|
||||||
|
if has('terminal')
|
||||||
|
let cmd = 'terminal'
|
||||||
|
elseif has('nvim')
|
||||||
|
let cmd = 'noautocmd new | terminal'
|
||||||
|
else
|
||||||
|
let cmd = '!'
|
||||||
|
endif
|
||||||
|
execute cmd 'cargo' args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:nearest_cargo(...) abort
|
function! s:nearest_cargo(...) abort
|
||||||
@@ -117,3 +125,5 @@ function! cargo#runtarget(args)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! cargo#quickfix#CmdPre() abort
|
function! cargo#quickfix#CmdPre() abort
|
||||||
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo'
|
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo'
|
||||||
@@ -28,3 +26,5 @@ function! cargo#quickfix#CmdPost() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'clojure') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: Clojure
|
" Language: Clojure
|
||||||
@@ -24,3 +22,5 @@ function! clojurecomplete#Complete(findstart, base)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim:sts=8:sw=8:ts=8:noet
|
" vim:sts=8:sw=8:ts=8:noet
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'coffee-script') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <mick@kochm.co>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
@@ -56,3 +54,5 @@ function! coffee#CoffeeSetUpErrorFormat()
|
|||||||
\%f:%l:%c:\ error:\ %m,
|
\%f:%l:%c:\ error:\ %m,
|
||||||
\%-G%.%#
|
\%-G%.%#
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -79,10 +77,17 @@ function! crystal_lang#entrypoint_for(file_path) abort
|
|||||||
return a:file_path
|
return a:file_path
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let required_spec_path = get(b:, 'crystal_required_spec_path', get(g:, 'crystal_required_spec_path', ''))
|
||||||
|
if required_spec_path !=# ''
|
||||||
|
let require_spec_str = './' . required_spec_path
|
||||||
|
else
|
||||||
|
let require_spec_str = './spec/**'
|
||||||
|
endif
|
||||||
|
|
||||||
let temp_name = root_dir . '/__vim-crystal-temporary-entrypoint-' . fnamemodify(a:file_path, ':t')
|
let temp_name = root_dir . '/__vim-crystal-temporary-entrypoint-' . fnamemodify(a:file_path, ':t')
|
||||||
let contents = [
|
let contents = [
|
||||||
\ 'require "spec"',
|
\ 'require "spec"',
|
||||||
\ 'require "./spec/**"',
|
\ 'require "' . require_spec_str . '"',
|
||||||
\ printf('require "./%s"', fnamemodify(a:file_path, ':p')[strlen(root_dir)+1 : ])
|
\ printf('require "./%s"', fnamemodify(a:file_path, ':p')[strlen(root_dir)+1 : ])
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
@@ -342,3 +347,5 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'csv') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'csv') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Filetype plugin for editing CSV files. "{{{1
|
" Filetype plugin for editing CSV files. "{{{1
|
||||||
" Author: Christian Brabandt <cb@256bit.org>
|
" Author: Christian Brabandt <cb@256bit.org>
|
||||||
@@ -3189,3 +3187,5 @@ endfun
|
|||||||
|
|
||||||
" Vim Modeline " {{{2
|
" Vim Modeline " {{{2
|
||||||
" vim: set foldmethod=marker et sw=0 sts=-1 ts=4:
|
" vim: set foldmethod=marker et sw=0 sts=-1 ts=4:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dart') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
function! s:error(text) abort
|
function! s:error(text) abort
|
||||||
@@ -30,17 +28,22 @@ function! s:clearQfList(reason) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#fmt(q_args) abort
|
function! dart#fmt(q_args) abort
|
||||||
if executable('dartfmt')
|
let cmd = s:FindDartFmt()
|
||||||
let buffer_content = join(getline(1, '$'), "\n")
|
if type(cmd) != type('') | return | endif
|
||||||
|
let buffer_content = getline(1, '$')
|
||||||
let args = '--stdin-name '.expand('%').' '.a:q_args
|
let args = '--stdin-name '.expand('%').' '.a:q_args
|
||||||
let joined_lines = system(printf('dartfmt %s', args), buffer_content)
|
let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n"))
|
||||||
if buffer_content ==# joined_lines[:-2]
|
" TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the
|
||||||
|
" tool no longer emits this line on SDK upgrades.
|
||||||
|
if lines[-1] ==# 'Isolate creation failed'
|
||||||
|
let lines = lines[:-2]
|
||||||
|
endif
|
||||||
|
if buffer_content == lines
|
||||||
call s:clearQfList('dartfmt')
|
call s:clearQfList('dartfmt')
|
||||||
return
|
return
|
||||||
endif
|
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")
|
|
||||||
silent keepjumps call setline(1, lines)
|
silent keepjumps call setline(1, lines)
|
||||||
if line('$') > len(lines)
|
if line('$') > len(lines)
|
||||||
silent keepjumps execute string(len(lines)+1).',$ delete'
|
silent keepjumps execute string(len(lines)+1).',$ delete'
|
||||||
@@ -48,43 +51,33 @@ function! dart#fmt(q_args) abort
|
|||||||
call winrestview(win_view)
|
call winrestview(win_view)
|
||||||
call s:clearQfList('dartfmt')
|
call s:clearQfList('dartfmt')
|
||||||
else
|
else
|
||||||
let errors = split(joined_lines, "\n")[2:]
|
let errors = lines[2:]
|
||||||
let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
|
let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
|
||||||
call s:cexpr(error_format, errors, 'dartfmt')
|
call s:cexpr(error_format, errors, 'dartfmt')
|
||||||
endif
|
endif
|
||||||
else
|
endfunction
|
||||||
call s:error('cannot execute binary file: dartfmt')
|
|
||||||
|
function! s:FindDartFmt() abort
|
||||||
|
if executable('dartfmt') | return 'dartfmt' | endif
|
||||||
|
if executable('flutter')
|
||||||
|
let l:flutter_cmd = resolve(exepath('flutter'))
|
||||||
|
let l:bin = fnamemodify(l:flutter_cmd, ':h')
|
||||||
|
let l:dartfmt = l:bin.'/cache/dart-sdk/bin/dartfmt'
|
||||||
|
if executable(l:dartfmt) | return l:dartfmt | endif
|
||||||
endif
|
endif
|
||||||
|
call s:error('Cannot find a `dartfmt` command')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#analyzer(q_args) abort
|
function! dart#analyzer(q_args) abort
|
||||||
if executable('dartanalyzer')
|
call s:error('DartAnalyzer support has been removed. '.
|
||||||
let path = expand('%:p:gs:\:/:')
|
\'If this broke your workflow please comment on '.
|
||||||
if filereadable(path)
|
\'https://github.com/dart-lang/dart-vim-plugin/issues/89')
|
||||||
let command = printf('dartanalyzer %s %s', a:q_args, shellescape(path))
|
|
||||||
let lines = systemlist(command)
|
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dartanalyzer')
|
|
||||||
else
|
|
||||||
call s:error(printf('cannot read a file: "%s"', path))
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
call s:error('cannot execute binary file: dartanalyzer')
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#tojs(q_args) abort
|
function! dart#tojs(q_args) abort
|
||||||
if executable('dart2js')
|
call s:error('Dart2JS support has been removed. '.
|
||||||
let path = expand('%:p:gs:\:/:')
|
\'If this broke your workflow please comment on '.
|
||||||
if filereadable(path)
|
\'https://github.com/dart-lang/dart-vim-plugin/issues/89')
|
||||||
let command = printf('dart2js %s %s', a:q_args, shellescape(path))
|
|
||||||
let lines = systemlist(command)
|
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dart2js')
|
|
||||||
else
|
|
||||||
call s:error(printf('cannot read a file: "%s"', path))
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
call s:error('cannot execute binary file: dartanalyzer')
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Finds the path to `uri`.
|
" Finds the path to `uri`.
|
||||||
@@ -186,3 +179,5 @@ function! dart#setModifiable() abort
|
|||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elixir') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:path = expand('<sfile>:h')
|
let s:path = expand('<sfile>:h')
|
||||||
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
|
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
|
||||||
@@ -22,3 +20,5 @@ endfunction
|
|||||||
function! db#adapter#ecto#complete_opaque(url) abort
|
function! db#adapter#ecto#complete_opaque(url) abort
|
||||||
return map(s:repo_list(), 'v:val[0]')
|
return map(s:repo_list(), 'v:val[0]')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elixir') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:elixir_indent_max_lookbehind")
|
if !exists("g:elixir_indent_max_lookbehind")
|
||||||
let g:elixir_indent_max_lookbehind = 30
|
let g:elixir_indent_max_lookbehind = 30
|
||||||
@@ -25,6 +23,7 @@ function! elixir#indent#indent(lnum)
|
|||||||
|
|
||||||
let handlers = [
|
let handlers = [
|
||||||
\'top_of_file',
|
\'top_of_file',
|
||||||
|
\'starts_with_string_continuation',
|
||||||
\'following_trailing_binary_operator',
|
\'following_trailing_binary_operator',
|
||||||
\'starts_with_pipe',
|
\'starts_with_pipe',
|
||||||
\'starts_with_binary_operator',
|
\'starts_with_binary_operator',
|
||||||
@@ -35,9 +34,14 @@ function! elixir#indent#indent(lnum)
|
|||||||
\]
|
\]
|
||||||
for handler in handlers
|
for handler in handlers
|
||||||
call s:debug('testing handler elixir#indent#handle_'.handler)
|
call s:debug('testing handler elixir#indent#handle_'.handler)
|
||||||
let context = {'lnum': lnum, 'text': text, 'prev_nb_lnum': prev_nb_lnum, 'prev_nb_text': prev_nb_text}
|
let context = {'lnum': lnum, 'text': text, 'first_nb_char_idx': match(text, '\w'), 'prev_nb_lnum': prev_nb_lnum, 'prev_nb_text': prev_nb_text}
|
||||||
let indent = function('elixir#indent#handle_'.handler)(context)
|
let indent = function('elixir#indent#handle_'.handler)(context)
|
||||||
if indent != -1
|
if indent == -2
|
||||||
|
" Keep indent the same
|
||||||
|
call s:debug('line '.lnum.': elixir#indent#handle_'.handler.' returned -2; returning indent of -1')
|
||||||
|
call cursor(curs_lnum, curs_col)
|
||||||
|
return -1
|
||||||
|
elseif indent != -1
|
||||||
call s:debug('line '.lnum.': elixir#indent#handle_'.handler.' returned '.indent)
|
call s:debug('line '.lnum.': elixir#indent#handle_'.handler.' returned '.indent)
|
||||||
call cursor(curs_lnum, curs_col)
|
call cursor(curs_lnum, curs_col)
|
||||||
return indent
|
return indent
|
||||||
@@ -102,7 +106,11 @@ endfunction
|
|||||||
" Returns 0 or 1 based on whether or not the given line number and column
|
" Returns 0 or 1 based on whether or not the given line number and column
|
||||||
" number pair is a string or comment
|
" number pair is a string or comment
|
||||||
function! s:is_string_or_comment(line, col)
|
function! s:is_string_or_comment(line, col)
|
||||||
return synIDattr(synID(a:line, a:col, 1), "name") =~ '\%(String\|Comment\)'
|
return s:syntax_name(a:line, a:col) =~ '\%(String\|Comment\)'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syntax_name(line, col)
|
||||||
|
return synIDattr(synID(a:line, a:col, 1), "name")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Skip expression for searchpair. Returns 0 or 1 based on whether the value
|
" Skip expression for searchpair. Returns 0 or 1 based on whether the value
|
||||||
@@ -158,6 +166,14 @@ function! elixir#indent#handle_top_of_file(context)
|
|||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! elixir#indent#handle_starts_with_string_continuation(context)
|
||||||
|
if s:syntax_name(a:context.lnum, a:context.first_nb_char_idx) =~ '\(String\|Comment\)$'
|
||||||
|
return -2
|
||||||
|
else
|
||||||
|
return -1
|
||||||
|
end
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! elixir#indent#handle_follow_prev_nb(context)
|
function! elixir#indent#handle_follow_prev_nb(context)
|
||||||
return s:get_base_indent(a:context.prev_nb_lnum, a:context.prev_nb_text)
|
return s:get_base_indent(a:context.prev_nb_lnum, a:context.prev_nb_text)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -345,3 +361,5 @@ function! elixir#indent#handle_inside_generic_block(context)
|
|||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elixir') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! elixir#util#get_filename(word) abort
|
function! elixir#util#get_filename(word) abort
|
||||||
let word = a:word
|
let word = a:word
|
||||||
@@ -26,3 +24,5 @@ function! elixir#util#get_filename(word) abort
|
|||||||
|
|
||||||
return word
|
return word
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:errors = []
|
let s:errors = []
|
||||||
|
|
||||||
@@ -383,3 +381,5 @@ function! s:ExecuteInRoot(cmd) abort
|
|||||||
|
|
||||||
return l:out
|
return l:out
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
||||||
fun! elm#util#IsWin() abort
|
fun! elm#util#IsWin() abort
|
||||||
@@ -182,3 +180,5 @@ function! s:error(msg)
|
|||||||
echohl NONE
|
echohl NONE
|
||||||
let v:errmsg = a:msg
|
let v:errmsg = a:msg
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'fish') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! fish#Indent()
|
function! fish#Indent()
|
||||||
let l:shiftwidth = shiftwidth()
|
let l:shiftwidth = shiftwidth()
|
||||||
@@ -11,15 +9,15 @@ function! fish#Indent()
|
|||||||
let l:indent = 0
|
let l:indent = 0
|
||||||
let l:prevline = getline(l:prevlnum)
|
let l:prevline = getline(l:prevlnum)
|
||||||
if l:prevline =~# '\v^\s*switch>'
|
if l:prevline =~# '\v^\s*switch>'
|
||||||
let l:indent = l:shiftwidth * 2
|
return indent(l:prevlnum) + l:shiftwidth
|
||||||
elseif l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case)>'
|
elseif l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case)>'
|
||||||
let l:indent = l:shiftwidth
|
let l:indent = l:shiftwidth
|
||||||
endif
|
endif
|
||||||
let l:line = getline(v:lnum)
|
let l:line = getline(v:lnum)
|
||||||
if l:line =~# '\v^\s*end>'
|
if l:line =~# '\v^\s*end>'
|
||||||
return indent(v:lnum) - (l:indent ==# 0 ? l:shiftwidth : l:indent)
|
return indent(l:prevlnum) - (l:indent ==# 0 ? l:shiftwidth : l:indent)
|
||||||
elseif l:line =~# '\v^\s*%(case|else)>'
|
elseif l:line =~# '\v^\s*%(case|else)>'
|
||||||
return indent(v:lnum) - l:shiftwidth
|
return indent(l:prevlnum) - l:shiftwidth
|
||||||
endif
|
endif
|
||||||
return indent(l:prevlnum) + l:indent
|
return indent(l:prevlnum) + l:indent
|
||||||
endfunction
|
endfunction
|
||||||
@@ -69,3 +67,5 @@ endfunction
|
|||||||
function! fish#errorformat()
|
function! fish#errorformat()
|
||||||
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'go') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" don't spam the user when Vim is started in Vi compatibility mode
|
" don't spam the user when Vim is started in Vi compatibility mode
|
||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
@@ -18,10 +16,6 @@ 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
|
||||||
@@ -29,10 +23,12 @@ endfunction
|
|||||||
function! go#config#SetBuildTags(value) abort
|
function! go#config#SetBuildTags(value) abort
|
||||||
if a:value is ''
|
if a:value is ''
|
||||||
silent! unlet g:go_build_tags
|
silent! unlet g:go_build_tags
|
||||||
|
call go#lsp#ResetWorkspaceDirectories()
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:go_build_tags = a:value
|
let g:go_build_tags = a:value
|
||||||
|
call go#lsp#ResetWorkspaceDirectories()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#TestTimeout() abort
|
function! go#config#TestTimeout() abort
|
||||||
@@ -55,6 +51,14 @@ function! go#config#TermMode() abort
|
|||||||
return get(g:, 'go_term_mode', 'vsplit')
|
return get(g:, 'go_term_mode', 'vsplit')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#TermCloseOnExit() abort
|
||||||
|
return get(g:, 'go_term_close_on_exit', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#SetTermCloseOnExit(value) abort
|
||||||
|
let g:go_term_close_on_exit = a:value
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#TermEnabled() abort
|
function! go#config#TermEnabled() abort
|
||||||
return has('nvim') && get(g:, 'go_term_enabled', 0)
|
return has('nvim') && get(g:, 'go_term_enabled', 0)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -182,6 +186,9 @@ function! go#config#DocUrl() abort
|
|||||||
return godoc_url
|
return godoc_url
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#DocPopupWindow() abort
|
||||||
|
return get(g:, 'go_doc_popup_window', 0)
|
||||||
|
endfunction
|
||||||
function! go#config#DefReuseBuffer() abort
|
function! go#config#DefReuseBuffer() abort
|
||||||
return get(g:, 'go_def_reuse_buffer', 0)
|
return get(g:, 'go_def_reuse_buffer', 0)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -200,9 +207,10 @@ endfunction
|
|||||||
|
|
||||||
function! go#config#DebugWindows() abort
|
function! go#config#DebugWindows() abort
|
||||||
return get(g:, 'go_debug_windows', {
|
return get(g:, 'go_debug_windows', {
|
||||||
\ 'stack': 'leftabove 20vnew',
|
|
||||||
\ 'out': 'botright 10new',
|
|
||||||
\ 'vars': 'leftabove 30vnew',
|
\ 'vars': 'leftabove 30vnew',
|
||||||
|
\ 'stack': 'leftabove 20new',
|
||||||
|
\ 'goroutines': 'botright 10new',
|
||||||
|
\ 'out': 'botright 5new',
|
||||||
\ }
|
\ }
|
||||||
\ )
|
\ )
|
||||||
|
|
||||||
@@ -253,7 +261,7 @@ function! go#config#SetTemplateAutocreate(value) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterCommand() abort
|
function! go#config#MetalinterCommand() abort
|
||||||
return get(g:, "go_metalinter_command", "gometalinter")
|
return get(g:, "go_metalinter_command", "golangci-lint")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterAutosaveEnabled() abort
|
function! go#config#MetalinterAutosaveEnabled() abort
|
||||||
@@ -276,10 +284,6 @@ function! go#config#MetalinterEnabled() abort
|
|||||||
return get(g:, "go_metalinter_enabled", default_enabled)
|
return get(g:, "go_metalinter_enabled", default_enabled)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterDisabled() abort
|
|
||||||
return get(g:, "go_metalinter_disabled", [])
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! go#config#GolintBin() abort
|
function! go#config#GolintBin() abort
|
||||||
return get(g:, "go_golint_bin", "golint")
|
return get(g:, "go_golint_bin", "golint")
|
||||||
endfunction
|
endfunction
|
||||||
@@ -364,6 +368,11 @@ function! go#config#PlayOpenBrowser() abort
|
|||||||
return get(g:, "go_play_open_browser", 1)
|
return get(g:, "go_play_open_browser", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GorenameCommand() abort
|
||||||
|
" delegate to go#config#GorenameBin for backwards compatability.
|
||||||
|
return get(g:, "go_gorename_command", go#config#GorenameBin())
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#GorenameBin() abort
|
function! go#config#GorenameBin() abort
|
||||||
return get(g:, "go_gorename_bin", "gorename")
|
return get(g:, "go_gorename_bin", "gorename")
|
||||||
endfunction
|
endfunction
|
||||||
@@ -459,6 +468,14 @@ function! go#config#HighlightVariableDeclarations() abort
|
|||||||
return get(g:, 'go_highlight_variable_declarations', 0)
|
return get(g:, 'go_highlight_variable_declarations', 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#HighlightDiagnosticErrors() abort
|
||||||
|
return get(g:, 'go_highlight_diagnostic_errors', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#HighlightDiagnosticWarnings() abort
|
||||||
|
return get(g:, 'go_highlight_diagnostic_warnings', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#HighlightDebug() abort
|
function! go#config#HighlightDebug() abort
|
||||||
return get(g:, 'go_highlight_debug', 1)
|
return get(g:, 'go_highlight_debug', 1)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -478,6 +495,35 @@ function! go#config#CodeCompletionEnabled() abort
|
|||||||
return get(g:, "go_code_completion_enabled", 1)
|
return get(g:, "go_code_completion_enabled", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#Updatetime() abort
|
||||||
|
let go_updatetime = get(g:, 'go_updatetime', 800)
|
||||||
|
return go_updatetime == 0 ? &updatetime : go_updatetime
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#ReferrersMode() abort
|
||||||
|
return get(g:, 'go_referrers_mode', 'gopls')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GoplsCompleteUnimported() abort
|
||||||
|
return get(g:, 'go_gopls_complete_unimported', 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GoplsDeepCompletion() abort
|
||||||
|
return get(g:, 'go_gopls_deep_completion', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GoplsFuzzyMatching() abort
|
||||||
|
return get(g:, 'go_gopls_fuzzy_matching', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GoplsUsePlaceholders() abort
|
||||||
|
return get(g:, 'go_gopls_use_placeholders', 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#GoplsEnabled() abort
|
||||||
|
return get(g:, 'go_gopls_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.
|
||||||
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
||||||
@@ -489,3 +535,5 @@ let &cpo = s:cpo_save
|
|||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
" vim: sw=2 ts=2 et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
16
autoload/graphql.vim
Normal file
16
autoload/graphql.vim
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||||
|
|
||||||
|
" Vim plugin
|
||||||
|
" Language: GraphQL
|
||||||
|
" Maintainer: Jon Parise <jon@indelible.org>
|
||||||
|
|
||||||
|
if exists('g:autoloaded_graphql')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:autoloaded_graphql = 1
|
||||||
|
|
||||||
|
function! graphql#javascript_tags() abort
|
||||||
|
return get(g:, 'graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: HTML and XHTML
|
" Language: HTML and XHTML
|
||||||
@@ -843,3 +841,5 @@ function! htmlcomplete#CheckDoctype() " {{{
|
|||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
" vim:set foldmethod=marker:
|
" vim:set foldmethod=marker:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! jsx_pretty#comment#update_commentstring(original)
|
function! jsx_pretty#comment#update_commentstring(original)
|
||||||
let syn_current = s:syn_name(line('.'), col('.'))
|
let syn_current = s:syn_name(line('.'), col('.'))
|
||||||
let syn_start = s:syn_name(line('.'), 1)
|
let syn_start = s:syn_name(line('.'), 1)
|
||||||
let save_cursor = getcurpos()
|
let save_cursor = getcurpos()
|
||||||
|
|
||||||
if syn_start =~ '^jsx'
|
if syn_start =~? '^jsx'
|
||||||
let line = getline(".")
|
let line = getline(".")
|
||||||
let start = len(matchstr(line, '^\s*'))
|
let start = len(matchstr(line, '^\s*'))
|
||||||
let syn_name = s:syn_name(line('.'), start + 1)
|
let syn_name = s:syn_name(line('.'), start + 1)
|
||||||
@@ -16,7 +14,7 @@ function! jsx_pretty#comment#update_commentstring(original)
|
|||||||
let &l:commentstring = '// %s'
|
let &l:commentstring = '// %s'
|
||||||
elseif s:syn_contains(line('.'), col('.'), 'jsxTaggedRegion')
|
elseif s:syn_contains(line('.'), col('.'), 'jsxTaggedRegion')
|
||||||
let &l:commentstring = '<!-- %s -->'
|
let &l:commentstring = '<!-- %s -->'
|
||||||
elseif syn_name =~ '^jsxAttrib'
|
elseif syn_name =~? '^jsxAttrib'
|
||||||
let &l:commentstring = '// %s'
|
let &l:commentstring = '// %s'
|
||||||
else
|
else
|
||||||
let &l:commentstring = '{/* %s */}'
|
let &l:commentstring = '{/* %s */}'
|
||||||
@@ -39,3 +37,5 @@ function! s:syn_contains(lnum, cnum, syn_name)
|
|||||||
let syn_names = map(stack, 'synIDattr(v:val, "name")')
|
let syn_names = map(stack, 'synIDattr(v:val, "name")')
|
||||||
return index(syn_names, a:syn_name) >= 0
|
return index(syn_names, a:syn_name) >= 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if exists('*shiftwidth')
|
if exists('*shiftwidth')
|
||||||
function! s:sw()
|
function! s:sw()
|
||||||
@@ -12,193 +10,297 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Get the syntax group of start of line
|
" Regexp for the start tag
|
||||||
function! s:syn_sol(lnum)
|
let s:start_tag = '<\_s*\%(>\|\${\|\%(\<[-:._$A-Za-z0-9]\+\>\)\)'
|
||||||
let line = getline(a:lnum)
|
" Regexp for the end tag
|
||||||
let sol = matchstr(line, '^\s*')
|
let s:end_tag = '\%(<\_s*/\_s*\%(\<[-:._$A-Za-z0-9]\+\>\)\_s*>\|/\_s*>\)'
|
||||||
return map(synstack(a:lnum, len(sol) + 1), 'synIDattr(v:val, "name")')
|
|
||||||
|
function s:trim(line)
|
||||||
|
return substitute(a:line, '^\s*\|\s*$', '', 'g')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Get the syntax group of end of line
|
" Get the syntax stack at the given position
|
||||||
function! s:syn_eol(lnum)
|
function s:syntax_stack_at(lnum, col)
|
||||||
let lnum = prevnonblank(a:lnum)
|
return map(synstack(a:lnum, a:col), 'synIDattr(v:val, "name")')
|
||||||
let col = strlen(getline(lnum))
|
|
||||||
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:prev_indent(lnum)
|
" Get the syntax at the given position
|
||||||
let lnum = prevnonblank(a:lnum - 1)
|
function s:syntax_at(lnum, col)
|
||||||
return indent(lnum)
|
return synIDattr(synID(a:lnum, a:col, 1), 'name')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:prev_line(lnum)
|
" Get the start col of the non-space charactor
|
||||||
let lnum = prevnonblank(a:lnum - 1)
|
function s:start_col(lnum)
|
||||||
return substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
return len(matchstr(getline(a:lnum), '^\s*')) + 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_attr_jsx(synattr)
|
" Get the start syntax of a given line number
|
||||||
return a:synattr =~ "^jsx"
|
function s:start_syntax(lnum)
|
||||||
|
return s:syntax_at(a:lnum, s:start_col(a:lnum))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_xmlish(syns)
|
" The skip function for searchpair
|
||||||
return s:syn_attr_jsx(get(a:syns, -1))
|
function s:skip_if_not(current_lnum, ...)
|
||||||
|
" Skip the match in current line
|
||||||
|
if line('.') == a:current_lnum
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let syntax = s:syntax_at(line('.'), col('.'))
|
||||||
|
return syntax !~? join(a:000, '\|')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_jsx_element(syns)
|
" Whether the specified stytax group is the opening tag
|
||||||
return get(a:syns, -1) =~ 'jsxElement'
|
function s:is_opening_tag(syntax)
|
||||||
|
return a:syntax =~? 'jsxOpenPunct'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_js_comment(syns)
|
" Whether the specified stytax group is the closing tag
|
||||||
return get(a:syns, -1) =~ 'Comment$'
|
function s:is_closing_tag(syntax)
|
||||||
|
return a:syntax =~? 'jsxClose'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_jsx_escapejs(syns)
|
" Whether the specified syntax group is the jsxRegion
|
||||||
return get(a:syns, -1) =~ '\(\(js\(Template\)\?\|javaScript\(Embed\)\?\|typescript\)Braces\|javascriptTemplateSB\|typescriptInterpolationDelimiter\)' &&
|
function s:is_jsx_region(syntax)
|
||||||
\ (get(a:syns, -2) =~ 'jsxEscapeJs' ||
|
return a:syntax =~? 'jsxRegion'
|
||||||
\ get(a:syns, -3) =~ 'jsxEscapeJs')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syn_jsx_attrib(syns)
|
" Whether the specified syntax group is the jsxElement
|
||||||
return len(filter(copy(a:syns), 'v:val =~ "jsxAttrib"'))
|
function s:is_jsx_element(syntax)
|
||||||
|
return a:syntax =~? 'jsxElement'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxEscapeJs
|
||||||
|
function s:is_jsx_escape(syntax)
|
||||||
|
return a:syntax =~? 'jsxEscapeJs'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxBraces
|
||||||
|
function s:is_jsx_brace(syntax)
|
||||||
|
return a:syntax =~? 'jsxBraces'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxComment
|
||||||
|
function s:is_jsx_comment(syntax)
|
||||||
|
return a:syntax =~? 'jsxComment'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified line is comment related syntax
|
||||||
|
function s:is_comment(syntax)
|
||||||
|
return a:syntax =~? 'comment'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxComment
|
||||||
|
function s:is_jsx_backticks(syntax)
|
||||||
|
return a:syntax =~? 'jsxBackticks'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the prvious line number
|
||||||
|
function s:prev_lnum(lnum)
|
||||||
|
return prevnonblank(a:lnum - 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the given pos is the parent of the given element who has
|
||||||
|
" element_count jsxElement syntax
|
||||||
|
function s:is_parent_element(pos, element_count)
|
||||||
|
let syntax_stack = s:syntax_stack_at(a:pos[0], a:pos[1])
|
||||||
|
return s:is_opening_tag(syntax_stack[-1]) &&
|
||||||
|
\ count(syntax_stack, 'jsxElement') <= a:element_count
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Compute the indention of the trail punct
|
||||||
|
function s:jsx_indent_trail_punct(lnum)
|
||||||
|
let pair_line = searchpair('<', '', '>', 'bW', 's:skip_if_not(a:lnum, "jsxOpenPunct", "jsxClose")')
|
||||||
|
return indent(pair_line)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Compute the indention of the closing tag
|
||||||
|
function s:jsx_indent_closing_tag(lnum)
|
||||||
|
let pair_line = searchpair(s:start_tag, '', s:end_tag, 'bW', 's:skip_if_not(a:lnum, "jsxOpenPunct", "jsxClose")')
|
||||||
|
return pair_line ? indent(pair_line) : indent(a:lnum)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Compute the indentation of the jsxElement
|
||||||
|
function s:jsx_indent_element(lnum)
|
||||||
|
let syntax_stack = s:syntax_stack_at(a:lnum, s:start_col(a:lnum))
|
||||||
|
let syntax_name = syntax_stack[-1]
|
||||||
|
let element_count = count(syntax_stack, 'jsxElement')
|
||||||
|
|
||||||
|
if s:trim(getline(a:lnum)) =~ '^>'
|
||||||
|
return s:jsx_indent_trail_punct(a:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If current tag is closing tag
|
||||||
|
if s:is_closing_tag(syntax_name)
|
||||||
|
return s:jsx_indent_closing_tag(a:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Normalize the jsxElement count for opening tag
|
||||||
|
if s:is_opening_tag(syntax_name)
|
||||||
|
" <div>
|
||||||
|
" <div></div> <-- jsxRegion->jsxElement->jsxElement->jsxTag->jsxOpenTag->jsxOpenPunct
|
||||||
|
" </div>
|
||||||
|
if s:is_jsx_element(syntax_stack[-4]) && s:is_jsx_element(syntax_stack[-5])
|
||||||
|
let element_count = element_count - 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let start_time = localtime()
|
||||||
|
let pos = searchpos(s:start_tag, 'bW')
|
||||||
|
|
||||||
|
while !s:is_parent_element(pos, element_count)
|
||||||
|
if localtime() - start_time >= 0.5
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
let pos = searchpos(s:start_tag, 'bW')
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return indent(pos[0]) + s:sw()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Compute the indentation of the comment
|
||||||
|
function s:jsx_indent_comment(lnum)
|
||||||
|
let line = s:trim(getline(a:lnum))
|
||||||
|
|
||||||
|
if s:is_jsx_comment(s:start_syntax(a:lnum))
|
||||||
|
if line =~ '^<!--' || line =~ '^-->'
|
||||||
|
return s:jsx_indent_element(a:lnum)
|
||||||
|
else
|
||||||
|
return s:jsx_indent_element(a:lnum) + s:sw()
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if line =~ '^/\*' || line =~ '^//'
|
||||||
|
return s:jsx_indent_element(a:lnum)
|
||||||
|
else
|
||||||
|
return s:jsx_indent_element(a:lnum) + 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Compute the indentation of jsxBackticks
|
||||||
|
function s:jsx_indent_backticks(lnum)
|
||||||
|
let tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'jsx'])
|
||||||
|
let start_tag = '\%(' . join(tags, '\|') . '\)`'
|
||||||
|
let end_tag = '\%(' . join(tags, '\|') . '\)\@<!`'
|
||||||
|
let pair_line = searchpair(start_tag, '', end_tag, 'bW', 's:skip_if_not(a:lnum)')
|
||||||
|
|
||||||
|
return indent(pair_line)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Syntax context types:
|
||||||
|
" - jsxRegion
|
||||||
|
" - jsxTaggedRegion
|
||||||
|
" - jsxElement
|
||||||
|
" - jsxEscapeJs
|
||||||
|
" - Other
|
||||||
|
function s:syntax_context(lnum)
|
||||||
|
let start_col = s:start_col(a:lnum)
|
||||||
|
let syntax_stack = s:syntax_stack_at(a:lnum, start_col)
|
||||||
|
let start_syntax = syntax_stack[-1]
|
||||||
|
let reversed = reverse(syntax_stack)
|
||||||
|
let i = 0
|
||||||
|
|
||||||
|
for syntax_name in reversed
|
||||||
|
" If the current line is jsxEscapeJs and not starts with jsxBraces
|
||||||
|
if s:is_jsx_escape(syntax_name)
|
||||||
|
return 'jsxEscapeJs'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:is_jsx_region(syntax_name)
|
||||||
|
return 'jsxRegion'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:is_jsx_element(syntax_name)
|
||||||
|
" If current line starts with the opening tag
|
||||||
|
if s:is_opening_tag(start_syntax) || s:is_closing_tag(start_syntax)
|
||||||
|
" And the next syntax is jsxRegion
|
||||||
|
if s:is_jsx_region(reversed[i+1])
|
||||||
|
return 'jsxRegion'
|
||||||
|
elseif reversed[i+1] =~ 'jsxTaggedRegion'
|
||||||
|
return 'jsxTaggedRegion'
|
||||||
|
else
|
||||||
|
return 'jsxElement'
|
||||||
|
endif
|
||||||
|
elseif reversed[i+1] =~ 'jsxTaggedRegion'
|
||||||
|
return 'jsxTaggedRegion'
|
||||||
|
else
|
||||||
|
return 'jsxElement'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let i = i + 1
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return 'Other'
|
||||||
endfunction
|
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)
|
function! jsx_pretty#indent#get(js_indent)
|
||||||
let lnum = v:lnum
|
let line = s:trim(getline(v:lnum))
|
||||||
let line = substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
let start_syntax = s:start_syntax(v:lnum)
|
||||||
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)
|
if s:is_jsx_backticks(start_syntax)
|
||||||
|
return s:jsx_indent_backticks(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
" {
|
if s:is_jsx_brace(start_syntax)
|
||||||
" <div></div>
|
return s:jsx_indent_element(v:lnum)
|
||||||
" ##} <--
|
endif
|
||||||
if s:syn_jsx_element(current_syn) && line =~ '}$'
|
|
||||||
let pair_line = searchpair('{', '', '}', 'b')
|
if s:is_opening_tag(start_syntax) && line =~ '^>'
|
||||||
return indent(pair_line)
|
return s:jsx_indent_trail_punct(v:lnum)
|
||||||
elseif line =~ '^-->$'
|
endif
|
||||||
if prev_line =~ '^<!--'
|
|
||||||
return prev_ind
|
let syntax_context = s:syntax_context(v:lnum)
|
||||||
|
|
||||||
|
if syntax_context == 'jsxRegion'
|
||||||
|
if s:is_closing_tag(start_syntax)
|
||||||
|
return s:jsx_indent_closing_tag(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prev_lnum = s:prev_lnum(v:lnum)
|
||||||
|
let prev_line = s:trim(getline(prev_lnum))
|
||||||
|
|
||||||
|
if prev_line =~ '[([{=?]$'
|
||||||
|
return indent(prev_lnum) + s:sw()
|
||||||
|
elseif prev_line =~ '[:|&<>]$' &&
|
||||||
|
\ s:trim(getline(s:prev_lnum(prev_lnum))) !~ '[?:|&<>]$'
|
||||||
|
return indent(prev_lnum) + s:sw()
|
||||||
else
|
else
|
||||||
return prev_ind - s:sw()
|
return indent(prev_lnum)
|
||||||
endif
|
endif
|
||||||
elseif prev_line =~ '-->$'
|
elseif syntax_context == 'jsxTaggedRegion'
|
||||||
return prev_ind
|
if s:is_closing_tag(start_syntax)
|
||||||
" close tag </tag> or /> including </>
|
return s:jsx_indent_closing_tag(v:lnum)
|
||||||
elseif prev_line =~ s:end_tag . '$'
|
elseif s:is_jsx_comment(start_syntax)
|
||||||
if line =~ '^<\s*' . s:end_tag
|
return s:jsx_indent_comment(v:lnum)
|
||||||
return prev_ind - s:sw()
|
|
||||||
elseif s:syn_jsx_attrib(prev_syn_sol)
|
|
||||||
return prev_ind - s:sw()
|
|
||||||
else
|
else
|
||||||
return prev_ind
|
return indent(s:prev_lnum(v:lnum)) + s:sw()
|
||||||
endif
|
endif
|
||||||
elseif line =~ '^\(>\|/\s*>\)'
|
elseif syntax_context == 'jsxElement'
|
||||||
if prev_line =~ '^<'
|
if s:is_jsx_comment(start_syntax)
|
||||||
return prev_ind
|
return s:jsx_indent_comment(v:lnum)
|
||||||
else
|
|
||||||
return prev_ind - s:sw()
|
|
||||||
endif
|
endif
|
||||||
elseif prev_line =~ '^\(<\|>\)' &&
|
|
||||||
\ (s:syn_xmlish(prev_syn_eol) || s:syn_js_comment(prev_syn_eol))
|
if s:is_comment(start_syntax)
|
||||||
if line =~ '^<\s*' . s:end_tag
|
return s:jsx_indent_comment(v:lnum)
|
||||||
return prev_ind
|
|
||||||
else
|
|
||||||
return prev_ind + s:sw()
|
|
||||||
endif
|
endif
|
||||||
elseif line =~ '^<\s*' . s:end_tag
|
|
||||||
if !s:syn_xmlish(prev_syn_sol)
|
return s:jsx_indent_element(v:lnum)
|
||||||
if s:syn_jsx_escapejs(prev_syn_eol)
|
elseif syntax_context == 'jsxEscapeJs'
|
||||||
\ || s:syn_jsx_escapejs(prev_syn_sol)
|
let prev_lnum = s:prev_lnum(v:lnum)
|
||||||
return prev_ind - s:sw()
|
let prev_line = s:trim(getline(prev_lnum))
|
||||||
else
|
|
||||||
return prev_ind
|
if line =~ '^?'
|
||||||
endif
|
return indent(prev_lnum) + s:sw()
|
||||||
else
|
elseif line =~ '^:'
|
||||||
return prev_ind - s:sw()
|
return indent(prev_lnum)
|
||||||
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
|
else
|
||||||
return a:js_indent()
|
return a:js_indent()
|
||||||
endif
|
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
|
endif
|
||||||
|
|
||||||
|
return a:js_indent()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,218 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! julia#set_syntax_version(jvers)
|
function! julia#set_syntax_version(jvers)
|
||||||
if &filetype != "julia"
|
if &filetype != "julia"
|
||||||
@@ -186,3 +184,5 @@ function! julia#gotodefinition()
|
|||||||
return
|
return
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" path to the julia binary to communicate with
|
" path to the julia binary to communicate with
|
||||||
if has('win32') || has('win64')
|
if has('win32') || has('win64')
|
||||||
@@ -244,3 +242,5 @@ function! s:likely(str) abort
|
|||||||
let output = systemlist(cmd)
|
let output = systemlist(cmd)
|
||||||
return split(matchstr(output[0], '\C^search: \zs.*'))
|
return split(matchstr(output[0], '\C^search: \zs.*'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Facilities for moving around Julia blocks (e.g. if/end, function/end etc.)
|
" Facilities for moving around Julia blocks (e.g. if/end, function/end etc.)
|
||||||
" (AKA a collection of horrible hacks)
|
" (AKA a collection of horrible hacks)
|
||||||
@@ -796,3 +794,5 @@ function! s:cursor_moved(...)
|
|||||||
let b:jlblk_did_select = b:jlblk_doing_select
|
let b:jlblk_did_select = b:jlblk_doing_select
|
||||||
let b:jlblk_doing_select = 0
|
let b:jlblk_doing_select = 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'julia') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
finish
|
|
||||||
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.3.0-DEV.263
|
" The symbols are based on Julia version 1.3.0-DEV.263
|
||||||
@@ -3332,3 +3330,5 @@ function! julia_latex_symbols#get_dict()
|
|||||||
\ '\:baggage_claim:': '🛄',
|
\ '\:baggage_claim:': '🛄',
|
||||||
\ '\:left_luggage:': '🛅'}
|
\ '\:left_luggage:': '🛅'}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'pony') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim plugin file
|
" Vim plugin file
|
||||||
" Language: Pony
|
" Language: Pony
|
||||||
@@ -534,3 +532,5 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
72
autoload/puppet/align.vim
Normal file
72
autoload/puppet/align.vim
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||||
|
|
||||||
|
function! puppet#align#IndentLevel(lnum)
|
||||||
|
return indent(a:lnum) / &shiftwidth
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! puppet#align#LinesInBlock(lnum)
|
||||||
|
let lines = []
|
||||||
|
let indent_level = puppet#align#IndentLevel(a:lnum)
|
||||||
|
|
||||||
|
let marker = a:lnum - 1
|
||||||
|
while marker >= 1
|
||||||
|
let line_text = getline(marker)
|
||||||
|
let line_indent = puppet#align#IndentLevel(marker)
|
||||||
|
|
||||||
|
if line_text =~? '\v\S'
|
||||||
|
if line_indent < indent_level
|
||||||
|
break
|
||||||
|
elseif line_indent == indent_level
|
||||||
|
call add(lines, marker)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let marker -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
let marker = a:lnum
|
||||||
|
while marker <= line('$')
|
||||||
|
let line_text = getline(marker)
|
||||||
|
let line_indent = puppet#align#IndentLevel(marker)
|
||||||
|
|
||||||
|
if line_text =~? '\v\S'
|
||||||
|
if line_indent < indent_level
|
||||||
|
break
|
||||||
|
elseif line_indent == indent_level
|
||||||
|
call add(lines, marker)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let marker += 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return lines
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
""
|
||||||
|
" Format lines with hashrocket (=>)
|
||||||
|
" @param a:1 a line where function should search for first hashrocket
|
||||||
|
" expression, if param is not given, line with active cursor is used
|
||||||
|
function! puppet#align#AlignHashrockets(...) abort
|
||||||
|
let l:lnum = get(a:, 1, line('.'))
|
||||||
|
let lines_in_block = puppet#align#LinesInBlock(l:lnum)
|
||||||
|
let max_left_len = 0
|
||||||
|
let indent_str = printf('%' . indent(l:lnum) . 's', '')
|
||||||
|
|
||||||
|
for line_num in lines_in_block
|
||||||
|
let data = matchlist(getline(line_num), '^\s*\(.\{-}\S\)\s*=>\s*\(.*\)$')
|
||||||
|
if !empty(data)
|
||||||
|
let max_left_len = max([max_left_len, strlen(data[1])])
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
for line_num in lines_in_block
|
||||||
|
let data = matchlist(getline(line_num), '^\s*\(.\{-}\S\)\s*=>\s*\(.*\)$')
|
||||||
|
if !empty(data)
|
||||||
|
let new_line = printf('%s%-' . max_left_len . 's => %s', indent_str, data[1], data[2])
|
||||||
|
call setline(line_num, new_line)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
40
autoload/puppet/ctags.vim
Normal file
40
autoload/puppet/ctags.vim
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||||
|
|
||||||
|
|
||||||
|
if !exists('s:ctags_type')
|
||||||
|
let s:ctags_type = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:ctags_options_dir = expand('<sfile>:p:h:h:h') . '/ctags/'
|
||||||
|
|
||||||
|
" Return full path to option file for ctags application
|
||||||
|
function! puppet#ctags#OptionFile()
|
||||||
|
|
||||||
|
if puppet#ctags#Type() == 'universal'
|
||||||
|
let l:ctags_options = 'puppet_u.ctags'
|
||||||
|
else
|
||||||
|
let l:ctags_options = 'puppet.ctags'
|
||||||
|
endif
|
||||||
|
return s:ctags_options_dir . l:ctags_options
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Return type of installed ctags application,
|
||||||
|
" can be 'universal' or 'exuberant'
|
||||||
|
function! puppet#ctags#Type()
|
||||||
|
|
||||||
|
if !s:ctags_type
|
||||||
|
let l:version = system('ctags --version')
|
||||||
|
if l:version =~ 'Universal Ctags'
|
||||||
|
let s:ctags_type = 'universal'
|
||||||
|
elseif l:version =~ 'Exuberant Ctags'
|
||||||
|
let s:ctags_type = 'exuberant'
|
||||||
|
else
|
||||||
|
echoerr 'Unknown version of Ctags'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:ctags_type
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
74
autoload/puppet/format.vim
Normal file
74
autoload/puppet/format.vim
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||||
|
|
||||||
|
"
|
||||||
|
" Simple format using puppet's l:indents and align hashrockets function
|
||||||
|
function! puppet#format#Format() abort
|
||||||
|
let l:start_lnum = v:lnum
|
||||||
|
let l:end_lnum = v:lnum + v:count - 1
|
||||||
|
" Don't modify indentation or alignment if called by textwidth. We'll only
|
||||||
|
" let the fallback function do its thing in this case so that textwidth
|
||||||
|
" still performs the expected feature.
|
||||||
|
if mode() !~# '[iR]'
|
||||||
|
call puppet#format#Indention(l:start_lnum, l:end_lnum)
|
||||||
|
call puppet#format#Hashrocket(l:start_lnum, l:end_lnum)
|
||||||
|
endif
|
||||||
|
call puppet#format#Fallback(l:start_lnum, l:end_lnum)
|
||||||
|
" explicitly avoid falling back to default formatting
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
""
|
||||||
|
" Format hashrockets expressions in every line in range start_lnum and
|
||||||
|
" end_lnum, both ends included
|
||||||
|
"
|
||||||
|
" TODO way of using AlignHashrockets function is ineffective, because it
|
||||||
|
" formats same lines again and again, find better way to do it
|
||||||
|
function! puppet#format#Hashrocket(start_lnum, end_lnum) abort
|
||||||
|
let l:lnum = a:start_lnum
|
||||||
|
while l:lnum <= a:end_lnum
|
||||||
|
call puppet#align#AlignHashrockets(l:lnum)
|
||||||
|
let l:lnum += 1
|
||||||
|
endwhile
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
""
|
||||||
|
" Format indention in every line in range start_lnum and end_lnum, both ends
|
||||||
|
" included
|
||||||
|
"
|
||||||
|
function! puppet#format#Indention(start_lnum, end_lnum) abort
|
||||||
|
execute 'normal! ' . a:start_lnum . 'gg=' . a:end_lnum . 'gg'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
""
|
||||||
|
" Use internal vim default autoformat method for every line in range, only
|
||||||
|
" lines which exeed &widthline are formated
|
||||||
|
"
|
||||||
|
function! puppet#format#Fallback(start_lnum, end_lnum) abort
|
||||||
|
" We shouldn't wrap lines based on textwidth if it is disabled
|
||||||
|
if &textwidth == 0
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" I'm using it to check if autoformat expand range
|
||||||
|
let l:eof_lnum = line('$')
|
||||||
|
let l:lnum = a:start_lnum
|
||||||
|
let l:end_lnum = a:end_lnum
|
||||||
|
|
||||||
|
while l:lnum <= l:end_lnum
|
||||||
|
if strlen(getline(l:lnum)) > &textwidth
|
||||||
|
call cursor(l:lnum)
|
||||||
|
execute 'normal! gww'
|
||||||
|
" Checking if autoformat expand number of lines if yes, I will extend
|
||||||
|
" range too
|
||||||
|
if l:eof_lnum < line('$')
|
||||||
|
let l:end_lnum += line('$') - l:eof_lnum
|
||||||
|
let l:eof_lnum = line('$')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let l:lnum += 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'python-compiler') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Sometimes Python issues debugging messages
|
" Sometimes Python issues debugging messages
|
||||||
" which don't belong to a call stack context
|
" which don't belong to a call stack context
|
||||||
@@ -19,3 +17,5 @@ function! python#utils#fix_qflist() " {{{
|
|||||||
call setqflist(l:traceback)
|
call setqflist(l:traceback)
|
||||||
endif
|
endif
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'ruby') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: Ruby
|
" Language: Ruby
|
||||||
@@ -878,3 +876,5 @@ call s:DefRuby()
|
|||||||
"}}} ruby-side code
|
"}}} ruby-side code
|
||||||
|
|
||||||
" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:
|
" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Author: Kevin Ballard
|
|
||||||
" Description: Helper functions for Rust commands/mappings
|
" Description: Helper functions for Rust commands/mappings
|
||||||
" Last Modified: May 27, 2014
|
" Last Modified: May 27, 2014
|
||||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
@@ -400,10 +397,19 @@ function! s:RmDir(path)
|
|||||||
echoerr 'Attempted to delete empty path'
|
echoerr 'Attempted to delete empty path'
|
||||||
return 0
|
return 0
|
||||||
elseif a:path ==# '/' || a:path ==# $HOME
|
elseif a:path ==# '/' || a:path ==# $HOME
|
||||||
|
let l:path = expand(a:path)
|
||||||
|
if l:path ==# '/' || l:path ==# $HOME
|
||||||
echoerr 'Attempted to delete protected path: ' . a:path
|
echoerr 'Attempted to delete protected path: ' . a:path
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
return system("rm -rf " . shellescape(a:path))
|
endif
|
||||||
|
|
||||||
|
if !isdirectory(a:path)
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" delete() returns 0 when removing file successfully
|
||||||
|
return delete(a:path, 'rf') == 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||||
@@ -503,14 +509,23 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
|||||||
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rust#Test(all, options) abort
|
function! rust#Test(mods, winsize, all, options) abort
|
||||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||||
if manifest ==# ''
|
if manifest ==# ''
|
||||||
return rust#Run(1, '--test ' . a:options)
|
return rust#Run(1, '--test ' . a:options)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists(':terminal')
|
" <count> defaults to 0, but we prefer an empty string
|
||||||
let cmd = 'terminal '
|
let winsize = a:winsize ? a:winsize : ''
|
||||||
|
|
||||||
|
if has('terminal')
|
||||||
|
if has('patch-8.0.910')
|
||||||
|
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
|
||||||
|
else
|
||||||
|
let cmd = printf('%s terminal ', a:mods)
|
||||||
|
endif
|
||||||
|
elseif has('nvim')
|
||||||
|
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
|
||||||
else
|
else
|
||||||
let cmd = '!'
|
let cmd = '!'
|
||||||
let manifest = shellescape(manifest)
|
let manifest = shellescape(manifest)
|
||||||
@@ -530,7 +545,7 @@ function! rust#Test(all, options) abort
|
|||||||
let func_name = s:SearchTestFunctionNameUnderCursor()
|
let func_name = s:SearchTestFunctionNameUnderCursor()
|
||||||
if func_name ==# ''
|
if func_name ==# ''
|
||||||
echohl ErrorMsg
|
echohl ErrorMsg
|
||||||
echo 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@@ -548,3 +563,5 @@ endfunction
|
|||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" For debugging, inspired by https://github.com/w0rp/rust/blob/master/autoload/rust/debugging.vim
|
" For debugging, inspired by https://github.com/w0rp/rust/blob/master/autoload/rust/debugging.vim
|
||||||
|
|
||||||
let s:global_variable_list = [
|
let s:global_variable_list = [
|
||||||
|
\ '_rustfmt_autosave_because_of_config',
|
||||||
\ 'ftplugin_rust_source_path',
|
\ 'ftplugin_rust_source_path',
|
||||||
\ 'loaded_syntastic_rust_cargo_checker',
|
\ 'loaded_syntastic_rust_cargo_checker',
|
||||||
\ 'loaded_syntastic_rust_filetype',
|
\ 'loaded_syntastic_rust_filetype',
|
||||||
@@ -32,7 +31,6 @@ let s:global_variable_list = [
|
|||||||
\ 'rustc_makeprg_no_percent',
|
\ 'rustc_makeprg_no_percent',
|
||||||
\ 'rustc_path',
|
\ 'rustc_path',
|
||||||
\ 'rustfmt_autosave',
|
\ 'rustfmt_autosave',
|
||||||
\ 'rustfmt_autosave_because_of_config',
|
|
||||||
\ 'rustfmt_autosave_if_config_present',
|
\ 'rustfmt_autosave_if_config_present',
|
||||||
\ 'rustfmt_command',
|
\ 'rustfmt_command',
|
||||||
\ 'rustfmt_emit_files',
|
\ 'rustfmt_emit_files',
|
||||||
@@ -48,7 +46,9 @@ endfunction
|
|||||||
|
|
||||||
function! s:EchoGlobalVariables() abort
|
function! s:EchoGlobalVariables() abort
|
||||||
for l:key in s:global_variable_list
|
for l:key in s:global_variable_list
|
||||||
|
if l:key !~# '^_'
|
||||||
call s:Echo('let g:' . l:key . ' = ' . string(get(g:, l:key, v:null)))
|
call s:Echo('let g:' . l:key . ' = ' . string(get(g:, l:key, v:null)))
|
||||||
|
endif
|
||||||
|
|
||||||
if has_key(b:, l:key)
|
if has_key(b:, l:key)
|
||||||
call s:Echo('let b:' . l:key . ' = ' . string(b:[l:key]))
|
call s:Echo('let b:' . l:key . ' = ' . string(b:[l:key]))
|
||||||
@@ -103,3 +103,5 @@ function! rust#debugging#InfoToFile(filename) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||||
|
|
||||||
@@ -46,3 +44,5 @@ endfunction
|
|||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
22
autoload/rust/tags.vim
Normal file
22
autoload/rust/tags.vim
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
|
|
||||||
|
" Tagbar support code, for the sake of not automatically overriding its
|
||||||
|
" configuration in case Universal Ctags is detected.
|
||||||
|
|
||||||
|
let s:ctags_is_uctags = 0
|
||||||
|
let s:checked_ctags = 0
|
||||||
|
|
||||||
|
function! rust#tags#IsUCtags() abort
|
||||||
|
if s:checked_ctags == 0
|
||||||
|
let l:ctags_bin = get(g:, 'tagbar_ctags_bin', 'ctags')
|
||||||
|
if system(l:ctags_bin.' --version') =~? 'universal ctags'
|
||||||
|
let s:ctags_is_uctags = 1
|
||||||
|
endif
|
||||||
|
let s:checked_ctags = 1
|
||||||
|
endif
|
||||||
|
return s:ctags_is_uctags
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Author: Stephen Sugden <stephen@stephensugden.com>
|
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||||
"
|
"
|
||||||
@@ -114,7 +112,7 @@ function! s:DeleteLines(start, end) abort
|
|||||||
silent! execute a:start . ',' . a:end . 'delete _'
|
silent! execute a:start . ',' . a:end . 'delete _'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:RunRustfmt(command, tmpname, fail_silently)
|
function! s:RunRustfmt(command, tmpname, from_writepre)
|
||||||
mkview!
|
mkview!
|
||||||
|
|
||||||
let l:stderr_tmpname = tempname()
|
let l:stderr_tmpname = tempname()
|
||||||
@@ -151,8 +149,10 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
|
|
||||||
let l:open_lwindow = 0
|
let l:open_lwindow = 0
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0
|
||||||
|
if a:from_writepre
|
||||||
" remove undo point caused via BufWritePre
|
" remove undo point caused via BufWritePre
|
||||||
try | silent undojoin | catch | endtry
|
try | silent undojoin | catch | endtry
|
||||||
|
endif
|
||||||
|
|
||||||
if a:tmpname ==# ''
|
if a:tmpname ==# ''
|
||||||
let l:content = l:out
|
let l:content = l:out
|
||||||
@@ -172,7 +172,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
call setloclist(0, [])
|
call setloclist(0, [])
|
||||||
let l:open_lwindow = 1
|
let l:open_lwindow = 1
|
||||||
endif
|
endif
|
||||||
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
|
elseif g:rustfmt_fail_silently == 0 && !a:from_writepre
|
||||||
" otherwise get the errors and put them in the location list
|
" otherwise get the errors and put them in the location list
|
||||||
let l:errors = []
|
let l:errors = []
|
||||||
|
|
||||||
@@ -226,12 +226,12 @@ function! rustfmt#FormatRange(line1, line2)
|
|||||||
let l:tmpname = tempname()
|
let l:tmpname = tempname()
|
||||||
call writefile(getline(1, '$'), l:tmpname)
|
call writefile(getline(1, '$'), l:tmpname)
|
||||||
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||||
call s:RunRustfmt(command, l:tmpname, 0)
|
call s:RunRustfmt(command, l:tmpname, v:false)
|
||||||
call delete(l:tmpname)
|
call delete(l:tmpname)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rustfmt#Format()
|
function! rustfmt#Format()
|
||||||
call s:RunRustfmt(s:RustfmtCommand(), '', 0)
|
call s:RunRustfmt(s:RustfmtCommand(), '', v:false)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rustfmt#Cmd()
|
function! rustfmt#Cmd()
|
||||||
@@ -246,7 +246,12 @@ function! rustfmt#PreWrite()
|
|||||||
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
|
||||||
let b:rustfmt_autosave_because_of_config = 1
|
let b:_rustfmt_autosave_because_of_config = 1
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if has_key(b:, '_rustfmt_autosave_because_of_config')
|
||||||
|
unlet b:_rustfmt_autosave_because_of_config
|
||||||
|
unlet b:rustfmt_autosave
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -254,8 +259,10 @@ function! rustfmt#PreWrite()
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:RunRustfmt(s:RustfmtCommand(), '', 1)
|
call s:RunRustfmt(s:RustfmtCommand(), '', v:true)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'smt2') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Invokes the solver on current file
|
" Invokes the solver on current file
|
||||||
function! smt2#RunSolver()
|
function! smt2#RunSolver()
|
||||||
@@ -32,3 +30,5 @@ function! smt2#PrintSolverVersion()
|
|||||||
silent !clear
|
silent !clear
|
||||||
execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch
|
execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,25 +1,64 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
|
||||||
finish
|
|
||||||
endif
|
" Ensure no conflict with arguments from the environment
|
||||||
|
let $TF_CLI_ARGS_fmt=''
|
||||||
|
|
||||||
" Adapted from vim-hclfmt:
|
|
||||||
" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim
|
|
||||||
function! terraform#fmt()
|
function! terraform#fmt()
|
||||||
if !filereadable(expand('%:p'))
|
if !filereadable(expand('%:p'))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let l:curw = winsaveview()
|
let l:curw = winsaveview()
|
||||||
let l:tmpfile = tempname() . '.tf'
|
" Make a fake change so that the undo point is right.
|
||||||
call writefile(getline(1, '$'), l:tmpfile)
|
normal! ix
|
||||||
let output = system('terraform fmt -write ' . l:tmpfile)
|
normal! "_x
|
||||||
if v:shell_error == 0
|
silent execute '%!terraform fmt -no-color -'
|
||||||
try | silent undojoin | catch | endtry
|
if v:shell_error != 0
|
||||||
call rename(l:tmpfile, resolve(expand('%')))
|
let output = getline(1, '$')
|
||||||
silent edit!
|
silent undo
|
||||||
let &syntax = &syntax
|
echo join(output, "\n")
|
||||||
else
|
|
||||||
echo output
|
|
||||||
call delete(l:tmpfile)
|
|
||||||
endif
|
endif
|
||||||
call winrestview(l:curw)
|
call winrestview(l:curw)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! terraform#align()
|
||||||
|
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
|
||||||
|
|
||||||
|
function! terraform#commands(ArgLead, CmdLine, CursorPos)
|
||||||
|
let l:commands = [
|
||||||
|
\ 'apply',
|
||||||
|
\ 'console',
|
||||||
|
\ 'destroy',
|
||||||
|
\ 'env',
|
||||||
|
\ 'fmt',
|
||||||
|
\ 'get',
|
||||||
|
\ 'graph',
|
||||||
|
\ 'import',
|
||||||
|
\ 'init',
|
||||||
|
\ 'output',
|
||||||
|
\ 'plan',
|
||||||
|
\ 'providers',
|
||||||
|
\ 'refresh',
|
||||||
|
\ 'show',
|
||||||
|
\ 'taint',
|
||||||
|
\ 'untaint',
|
||||||
|
\ 'validate',
|
||||||
|
\ 'version',
|
||||||
|
\ 'workspace',
|
||||||
|
\ '0.12upgrade',
|
||||||
|
\ 'debug',
|
||||||
|
\ 'force-unlock',
|
||||||
|
\ 'push',
|
||||||
|
\ 'state'
|
||||||
|
\ ]
|
||||||
|
return join(l:commands, "\n")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'vifm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" common functions for vifm command-line editing buffer filetype plugins
|
" common functions for vifm command-line editing buffer filetype plugins
|
||||||
" Maintainer: xaizek <xaizek@posteo.net>
|
" Maintainer: xaizek <xaizek@posteo.net>
|
||||||
@@ -16,3 +14,5 @@ function! vifm#edit#Init()
|
|||||||
" Start buffer editing in insert mode
|
" Start buffer editing in insert mode
|
||||||
startinsert
|
startinsert
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'vifm') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" common functions for vifm plugin related to globals
|
" common functions for vifm plugin related to globals
|
||||||
" Maintainer: xaizek <xaizek@posteo.net>
|
" Maintainer: xaizek <xaizek@posteo.net>
|
||||||
@@ -33,3 +31,5 @@ function! vifm#globals#Init()
|
|||||||
let g:vifm_embed_term = has('gui_running')
|
let g:vifm_embed_term = has('gui_running')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:_plugin_name = expand('<sfile>:t:r')
|
let s:_plugin_name = expand('<sfile>:t:r')
|
||||||
|
|
||||||
@@ -11,3 +9,5 @@ endfunction
|
|||||||
function! vital#{s:_plugin_name}#function(funcname) abort
|
function! vital#{s:_plugin_name}#function(funcname) abort
|
||||||
silent! return function(a:funcname)
|
silent! return function(a:funcname)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ___vital___
|
" ___vital___
|
||||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||||
@@ -189,3 +187,5 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ___vital___
|
" ___vital___
|
||||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||||
@@ -466,3 +464,5 @@ let &cpo = s:save_cpo
|
|||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ___vital___
|
" ___vital___
|
||||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||||
@@ -629,3 +627,5 @@ endfunction
|
|||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ___vital___
|
" ___vital___
|
||||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||||
@@ -175,3 +173,5 @@ let &cpo = s:save_cpo
|
|||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ___vital___
|
" ___vital___
|
||||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||||
@@ -180,3 +178,5 @@ let &cpo = s:save_cpo
|
|||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:plugin_name = expand('<sfile>:t:r')
|
let s:plugin_name = expand('<sfile>:t:r')
|
||||||
let s:vital_base_dir = expand('<sfile>:h')
|
let s:vital_base_dir = expand('<sfile>:h')
|
||||||
@@ -330,3 +328,5 @@ else
|
|||||||
return a:list
|
return a:list
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'crystal') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
crystal
|
crystal
|
||||||
bee84ae23effb0510137ad177e98c94d8b3657a6
|
bee84ae23effb0510137ad177e98c94d8b3657a6
|
||||||
@@ -8,3 +6,5 @@ bee84ae23effb0510137ad177e98c94d8b3657a6
|
|||||||
Process
|
Process
|
||||||
Web.JSON
|
Web.JSON
|
||||||
ColorEcho
|
ColorEcho
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim completion for WAI-ARIA data file
|
" Vim completion for WAI-ARIA data file
|
||||||
" Language: HTML + WAI-ARIA
|
" Language: HTML + WAI-ARIA
|
||||||
@@ -459,3 +457,5 @@ let g:xmldata_aria = {
|
|||||||
\ 'default_role': default_role,
|
\ 'default_role': default_role,
|
||||||
\ 'vimariaattrinfo': aria_attributes_value
|
\ 'vimariaattrinfo': aria_attributes_value
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim completion for HTML5 data file
|
" Vim completion for HTML5 data file
|
||||||
" Language: HTML (version 5.1 Draft 2016 Jan 13)
|
" Language: HTML (version 5.1 Draft 2016 Jan 13)
|
||||||
@@ -748,6 +746,10 @@ let g:xmldata_html5 = {
|
|||||||
\ [],
|
\ [],
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'slot': [
|
||||||
|
\ [],
|
||||||
|
\ extend(copy(global_attributes), {'name': []})
|
||||||
|
\ ],
|
||||||
\ 'small': [
|
\ 'small': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
@@ -872,3 +874,5 @@ let g:xmldata_html5 = {
|
|||||||
\ 'wbr': ['/>', ''],
|
\ 'wbr': ['/>', ''],
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! zig#config#ListTypeCommands() abort
|
function! zig#config#ListTypeCommands() abort
|
||||||
return get(g:, 'zig_list_type_commands', {})
|
return get(g:, 'zig_list_type_commands', {})
|
||||||
@@ -41,3 +39,5 @@ endfunction
|
|||||||
function! zig#config#Debug() abort
|
function! zig#config#Debug() abort
|
||||||
return get(g:, 'zig_debug', [])
|
return get(g:, 'zig_debug', [])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Adapted from fatih/vim-go: autoload/go/fmt.vim
|
" Adapted from fatih/vim-go: autoload/go/fmt.vim
|
||||||
"
|
"
|
||||||
@@ -168,3 +166,5 @@ function! zig#fmt#ToggleFmtAutoSave() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: sw=2 ts=2 et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Adapted from fatih/vim-go: autoload/go/list.vim
|
" Adapted from fatih/vim-go: autoload/go/list.vim
|
||||||
"
|
"
|
||||||
@@ -160,3 +158,5 @@ function! zig#list#Type(for) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: sw=2 ts=2 et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Adapted from vim-go: autoload/go/util.vim
|
" Adapted from vim-go: autoload/go/util.vim
|
||||||
"
|
"
|
||||||
@@ -392,3 +390,5 @@ function! zig#util#HasDebug(flag)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim: sw=2 ts=2 et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
29
build
29
build
@@ -6,13 +6,13 @@ DIRS="syntax indent compiler autoload ftplugin after/syntax after/indent after/f
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
|
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
DIRS_ALL="syntax indent compiler autoload ftplugin after"
|
DIRS_ALL="syntax indent compiler autoload ftplugin after extras"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
DIRS_SYNTAX="syntax indent after/syntax after/indent"
|
DIRS_SYNTAX="syntax indent after/syntax after/indent"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
DIRS_NOAFTER="syntax compiler indent autoload ftplugin"
|
DIRS_NOAFTER="syntax compiler indent autoload ftplugin"
|
||||||
DIRS_JAVASCRIPT="${DIRS} extras"
|
DIRS_JAVASCRIPT="${DIRS} extras"
|
||||||
read -r -a DIRS_RM <<<"$DIRS_JAVASCRIPT"
|
read -r -a DIRS_RM <<<"$DIRS_ALL"
|
||||||
|
|
||||||
OUTPUT=""
|
OUTPUT=""
|
||||||
|
|
||||||
@@ -127,7 +127,11 @@ copy_file() {
|
|||||||
touch "$file_in_dst"
|
touch "$file_in_dst"
|
||||||
|
|
||||||
# Use comma instead of / to handle cases like c/c++
|
# Use comma instead of / to handle cases like c/c++
|
||||||
|
if [[ "${package_name}" == "jsx" ]]; then
|
||||||
|
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard_jsx.vim.template >> "$file_in_dst"
|
||||||
|
else
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update_readme() {
|
update_readme() {
|
||||||
@@ -178,6 +182,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
|
||||||
|
dhall:vmchale/dhall-vim
|
||||||
dlang:JesseKPhillips/d.vim
|
dlang:JesseKPhillips/d.vim
|
||||||
dockerfile:ekalinin/Dockerfile.vim
|
dockerfile:ekalinin/Dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
@@ -186,7 +191,7 @@ PACKS="
|
|||||||
emblem:yalesov/vim-emblem
|
emblem:yalesov/vim-emblem
|
||||||
erlang:vim-erlang/vim-erlang-runtime
|
erlang:vim-erlang/vim-erlang-runtime
|
||||||
ferm:vim-scripts/ferm.vim
|
ferm:vim-scripts/ferm.vim
|
||||||
fish:dag/vim-fish
|
fish:georgewitteman/vim-fish
|
||||||
flatbuffers:dcharbon/vim-flatbuffers
|
flatbuffers:dcharbon/vim-flatbuffers
|
||||||
fsharp:fsharp/vim-fsharp:_BASIC
|
fsharp:fsharp/vim-fsharp:_BASIC
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
@@ -194,6 +199,7 @@ PACKS="
|
|||||||
gmpl:maelvalais/gmpl.vim
|
gmpl:maelvalais/gmpl.vim
|
||||||
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
||||||
go:fatih/vim-go:_BASIC
|
go:fatih/vim-go:_BASIC
|
||||||
|
graphql:jparise/vim-graphql:_ALL
|
||||||
gradle:tfnico/vim-gradle
|
gradle:tfnico/vim-gradle
|
||||||
groovy:vim-scripts/groovy.vim
|
groovy:vim-scripts/groovy.vim
|
||||||
groovy-indent:vim-scripts/groovyindent-unix
|
groovy-indent:vim-scripts/groovyindent-unix
|
||||||
@@ -203,6 +209,7 @@ PACKS="
|
|||||||
haskell:neovimhaskell/haskell-vim
|
haskell:neovimhaskell/haskell-vim
|
||||||
haxe:yaymukund/vim-haxe
|
haxe:yaymukund/vim-haxe
|
||||||
hcl:b4b4r07/vim-hcl
|
hcl:b4b4r07/vim-hcl
|
||||||
|
helm:towolf/vim-helm
|
||||||
hive:zebradil/hive.vim
|
hive:zebradil/hive.vim
|
||||||
html5:othree/html5.vim
|
html5:othree/html5.vim
|
||||||
i3:mboughaba/i3config.vim
|
i3:mboughaba/i3config.vim
|
||||||
@@ -215,7 +222,7 @@ 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:MaxMEllon/vim-jsx-pretty
|
jsx:MaxMEllon/vim-jsx-pretty:_ALL
|
||||||
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
|
||||||
@@ -236,7 +243,7 @@ PACKS="
|
|||||||
nix:LnL7/vim-nix
|
nix:LnL7/vim-nix
|
||||||
objc:b4winckler/vim-objc
|
objc:b4winckler/vim-objc
|
||||||
ocaml:rgrinberg/vim-ocaml
|
ocaml:rgrinberg/vim-ocaml
|
||||||
octave:vim-scripts/octave.vim--
|
octave:McSinyx/vim-octave
|
||||||
opencl:petRUShka/vim-opencl
|
opencl:petRUShka/vim-opencl
|
||||||
perl:vim-perl/vim-perl
|
perl:vim-perl/vim-perl
|
||||||
pgsql:lifepillar/pgsql.vim
|
pgsql:lifepillar/pgsql.vim
|
||||||
@@ -246,19 +253,18 @@ PACKS="
|
|||||||
powershell:PProvost/vim-ps1
|
powershell:PProvost/vim-ps1
|
||||||
protobuf:uarun/vim-protobuf
|
protobuf:uarun/vim-protobuf
|
||||||
pug:digitaltoad/vim-pug
|
pug:digitaltoad/vim-pug
|
||||||
puppet:voxpupuli/vim-puppet
|
puppet:rodjek/vim-puppet
|
||||||
purescript:purescript-contrib/purescript-vim
|
purescript:purescript-contrib/purescript-vim
|
||||||
python-compiler:aliev/vim-compiler-python
|
python-compiler:aliev/vim-compiler-python
|
||||||
python-indent:Vimjas/vim-python-pep8-indent
|
python-indent:Vimjas/vim-python-pep8-indent
|
||||||
python:vim-python/python-syntax
|
python:vim-python/python-syntax
|
||||||
qmake:artoj/qmake-syntax-vim
|
qmake:artoj/qmake-syntax-vim
|
||||||
qml:peterhoeg/vim-qml
|
qml:peterhoeg/vim-qml
|
||||||
r-lang:vim-scripts/R.vim
|
r-lang:vim-scripts/R.vim:_BASIC
|
||||||
racket:wlangstroth/vim-racket
|
racket:wlangstroth/vim-racket
|
||||||
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
|
||||||
@@ -270,8 +276,8 @@ 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
|
||||||
|
svelte:evanleck/vim-svelte
|
||||||
svg-indent:jasonshell/vim-svg-indent
|
svg-indent:jasonshell/vim-svg-indent
|
||||||
svg:vim-scripts/svg.vim
|
svg:vim-scripts/svg.vim
|
||||||
swift:keith/swift.vim
|
swift:keith/swift.vim
|
||||||
@@ -280,12 +286,12 @@ PACKS="
|
|||||||
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:ericpruitt/tmux.vim
|
tmux:ericpruitt/tmux.vim:_ALL:/vim/
|
||||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
tptp:c-cube/vim-tptp
|
tptp:c-cube/vim-tptp
|
||||||
twig:lumiliet/vim-twig
|
twig:lumiliet/vim-twig
|
||||||
typescript:leafgarland/typescript-vim
|
typescript:HerringtonDarkholme/yats.vim
|
||||||
vala:arrufat/vala.vim
|
vala:arrufat/vala.vim
|
||||||
vbnet:vim-scripts/vbnet.vim
|
vbnet:vim-scripts/vbnet.vim
|
||||||
vcl:smerrill/vcl-vim-plugin
|
vcl:smerrill/vcl-vim-plugin
|
||||||
@@ -297,6 +303,7 @@ PACKS="
|
|||||||
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
|
||||||
|
zephir:xwsoul/vim-zephir
|
||||||
zig:ziglang/zig.vim
|
zig:ziglang/zig.vim
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'coffee-script') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Language: CoffeeScript
|
" Language: CoffeeScript
|
||||||
" Maintainer: Mick Koch <mick@kochm.co>
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
@@ -17,3 +15,5 @@ call coffee#CoffeeSetUpVariables()
|
|||||||
exec 'CompilerSet makeprg=' . escape(g:coffee_cake . ' ' .
|
exec 'CompilerSet makeprg=' . escape(g:coffee_cake . ' ' .
|
||||||
\ g:coffee_cake_options . ' $*', ' ')
|
\ g:coffee_cake_options . ' $*', ' ')
|
||||||
call coffee#CoffeeSetUpErrorFormat()
|
call coffee#CoffeeSetUpErrorFormat()
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user