mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 19:43:52 -05:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
2edc785a5e | ||
|
|
445e026010 | ||
|
|
fca45b2c2b | ||
|
|
ebf9ec9d62 | ||
|
|
9caa678708 | ||
|
|
8f2a71643a | ||
|
|
af763ef221 | ||
|
|
5ded0682bd | ||
|
|
26c678b08d | ||
|
|
17ecfbdabc | ||
|
|
0217fb50fe | ||
|
|
5023da62ec | ||
|
|
957228cc25 | ||
|
|
7aae831309 | ||
|
|
671078ef6c | ||
|
|
aebef2c2e7 | ||
|
|
e8245dbf17 | ||
|
|
9fd5c11a20 | ||
|
|
679ccf0303 | ||
|
|
eacf785f5a | ||
|
|
83bd298476 | ||
|
|
415261dd1f | ||
|
|
4d18a5e5dd | ||
|
|
a55b6aa3aa | ||
|
|
1d45a6d4f0 | ||
|
|
420a65e9b0 | ||
|
|
2254b83675 | ||
|
|
12755e3583 | ||
|
|
cbad6b1e0a |
18
.github/ISSUE_TEMPLATE/add-language.md
vendored
Normal file
18
.github/ISSUE_TEMPLATE/add-language.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
name: Add language
|
||||||
|
about: Add support for new language
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--- vim-polyglot accepts only lightweight, maintained github-hosted vim plugins -->
|
||||||
|
|
||||||
|
**GitHub repository url**
|
||||||
|
|
||||||
|
|
||||||
|
**Is this plugin well maintained?**
|
||||||
|
|
||||||
|
|
||||||
|
**Is this plugin lightweight? (no advanced functionality, just indent and syntax support)**
|
||||||
20
.github/ISSUE_TEMPLATE/add-support-for-language.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/add-support-for-language.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Add support for language
|
||||||
|
about: ''
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
16
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Report vim-polyglot bug
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- Vim-polyglot is not responsible for bugs of plugins it uses. Please report only bugs that happen when plugin is used as part of vim-polyglot and doesn't happen when just install the plugin -->
|
||||||
|
|
||||||
|
**Does this bug happen when you install plugin without vim-polyglot?**
|
||||||
|
|
||||||
|
**Describe the bug:**
|
||||||
|
|
||||||
|
**To Reproduce:**
|
||||||
@@ -7,6 +7,5 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- vim-gtk
|
- vim-gtk
|
||||||
before_script:
|
before_script:
|
||||||
- "export DISPLAY=:99.0"
|
- "./build"
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
script: xvfb-run bundle exec rspec --format=documentation
|
||||||
script: bundle exec rspec --format=documentation
|
|
||||||
|
|||||||
52
README.md
52
README.md
@@ -1,4 +1,6 @@
|
|||||||
# vim-polyglot [![Build Status][travis-img-url]][travis-url] []()
|

|
||||||
|
|
||||||
|
[![Build Status][travis-img-url]][travis-url] []()
|
||||||
|
|
||||||
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
||||||
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
||||||
@@ -8,7 +10,7 @@ A collection of language packs for Vim.
|
|||||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||||
|
|
||||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||||
- It **installs and updates 100+ times faster** than the <!--Package Count-->132<!--/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`).
|
||||||
@@ -66,6 +68,8 @@ 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)
|
||||||
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
|
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin)
|
- [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin)
|
||||||
@@ -73,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)
|
||||||
@@ -82,7 +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, ftplugin)
|
- [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)
|
||||||
@@ -90,9 +94,13 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
||||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
||||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||||
|
- [hcl](https://github.com/b4b4r07/vim-hcl) (syntax, indent, ftplugin)
|
||||||
|
- [helm](https://github.com/towolf/vim-helm) (syntax)
|
||||||
|
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
|
||||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
||||||
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
||||||
|
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
||||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
|
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
|
||||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
||||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
||||||
@@ -100,18 +108,19 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
||||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||||
- [jsx](https://github.com/amadeus/vim-jsx) (syntax, indent, ftplugin)
|
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, 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)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
||||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
|
||||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
||||||
|
- [llvm](https://github.com/rhysd/vim-llvm) (syntax, indent, ftplugin)
|
||||||
|
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax)
|
||||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
||||||
- [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin)
|
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin)
|
||||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
||||||
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
||||||
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
|
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
|
||||||
@@ -120,61 +129,68 @@ 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/exu/pgsql.vim) (syntax)
|
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent)
|
||||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
||||||
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
|
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
|
||||||
- [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, autoload, ftplugin)
|
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, ftplugin)
|
||||||
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
||||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
||||||
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
||||||
- [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)
|
||||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
|
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
|
||||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin)
|
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin)
|
||||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
||||||
- [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](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, ftplugin)
|
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, ftplugin)
|
||||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
||||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||||
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin)
|
- [tmux](https://github.com/ericpruitt/tmux.vim) (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)
|
||||||
- [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)
|
||||||
- [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)
|
||||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||||
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
||||||
|
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (syntax)
|
||||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||||
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
||||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
|
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
||||||
|
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
||||||
<!--/Language Packs-->
|
<!--/Language Packs-->
|
||||||
|
|
||||||
## Updating
|
## Updating
|
||||||
|
|||||||
@@ -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,3 +12,40 @@ if exists('b:undo_ftplugin')
|
|||||||
else
|
else
|
||||||
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
||||||
endif
|
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
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" modified from html.vim
|
||||||
|
" For matchit plugin
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" For andymass/vim-matchup plugin
|
||||||
|
if exists("loaded_matchup")
|
||||||
|
setlocal matchpairs=(:),{:},[:],<:>
|
||||||
|
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||||
|
let b:match_skip = 's:comment\|string'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:original_commentstring = &l:commentstring
|
||||||
|
|
||||||
|
augroup jsx_comment
|
||||||
|
autocmd! CursorMoved <buffer>
|
||||||
|
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
setlocal suffixesadd+=.jsx
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim ftplugin file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" modified from html.vim
|
|
||||||
if exists("loaded_matchit")
|
|
||||||
let b:match_ignorecase = 0
|
|
||||||
let s:jsx_match_words = '<\([a-zA-Z0-9.]\+\)\(>\|$\|\s\):<\/\1>'
|
|
||||||
|
|
||||||
if !exists('b:loaded_jsx_match_words')
|
|
||||||
let b:loaded_jsx_match_words = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if b:loaded_jsx_match_words == 0
|
|
||||||
let b:match_words = exists('b:match_words')
|
|
||||||
\ ? b:match_words . ',' . s:jsx_match_words
|
|
||||||
\ : s:jsx_match_words
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:loaded_jsx_match_words = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal suffixesadd+=.jsx
|
|
||||||
477
after/ftplugin/llvm.vim
Normal file
477
after/ftplugin/llvm.vim
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||||
|
|
||||||
|
" Copyright (c) 2018 rhysd
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of this software and associated documentation files (the "Software"), to deal
|
||||||
|
" in the Software without restriction, including without limitation the rights
|
||||||
|
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
" copies of the Software, and to permit persons to whom the Software is
|
||||||
|
" furnished to do so, subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in
|
||||||
|
" all copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
" THE SOFTWARE.
|
||||||
|
|
||||||
|
if get(g:, 'llvm_extends_official', 1) == 0
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let g:llvm_ext_no_mapping = get(g:, 'llvm_ext_no_mapping', 0)
|
||||||
|
let g:llvm_ext_lli_executable = get(g:, 'llvm_ext_lli_executable', 'lli')
|
||||||
|
|
||||||
|
let s:KIND_BLOCK_PREC = 0
|
||||||
|
let s:KIND_BLOCK_FOLLOW = 1
|
||||||
|
let s:KIND_FUNC_BEGIN = 2
|
||||||
|
let s:KIND_FUNC_END = 3
|
||||||
|
|
||||||
|
function! s:section_delim_at(lnum) abort
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
let m = matchlist(line, '^\([^:]\+\):\%( \+; preds = \(%.\+\)\)\=$')
|
||||||
|
if !empty(m)
|
||||||
|
if m[2] ==# ''
|
||||||
|
return [s:KIND_BLOCK_PREC, m[1]]
|
||||||
|
else
|
||||||
|
return [s:KIND_BLOCK_FOLLOW, m[1], split(m[2], ',\s*')]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if line =~# '^}$'
|
||||||
|
return [s:KIND_FUNC_END]
|
||||||
|
endif
|
||||||
|
if line =~# '^define\>'
|
||||||
|
return [s:KIND_FUNC_BEGIN]
|
||||||
|
endif
|
||||||
|
return []
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:is_section_delim(line, func_delim) abort
|
||||||
|
let sec = s:section_delim_at(a:line)
|
||||||
|
if empty(sec)
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
let kind = sec[0]
|
||||||
|
return kind == s:KIND_BLOCK_PREC || kind == s:KIND_BLOCK_FOLLOW || kind == func_delim
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:next_section(stop_func_begin) abort
|
||||||
|
let func_delim = a:stop_func_begin ? s:KIND_FUNC_BEGIN : s:KIND_FUNC_END
|
||||||
|
let last = line('$') - 1
|
||||||
|
let line = line('.')
|
||||||
|
while line < last
|
||||||
|
let line += 1
|
||||||
|
if s:is_section_delim(line, func_delim)
|
||||||
|
call cursor(line, col('.'))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:prev_section(stop_func_begin) abort
|
||||||
|
let func_delim = a:stop_func_begin ? s:KIND_FUNC_BEGIN : s:KIND_FUNC_END
|
||||||
|
let line = line('.')
|
||||||
|
while line > 1
|
||||||
|
let line -= 1
|
||||||
|
if s:is_section_delim(line, func_delim)
|
||||||
|
call cursor(line, col('.'))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !g:llvm_ext_no_mapping
|
||||||
|
nnoremap <buffer><silent>]] :<C-u>call <SID>next_section(1)<CR>
|
||||||
|
nnoremap <buffer><silent>[[ :<C-u>call <SID>prev_section(1)<CR>
|
||||||
|
nnoremap <buffer><silent>][ :<C-u>call <SID>next_section(0)<CR>
|
||||||
|
nnoremap <buffer><silent>[] :<C-u>call <SID>prev_section(0)<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! s:function_range_at(linum) abort
|
||||||
|
let line = a:linum
|
||||||
|
while line >= 1
|
||||||
|
let s = getline(line)
|
||||||
|
if s =~# '^define\>'
|
||||||
|
let start = line
|
||||||
|
break
|
||||||
|
elseif s =~# '^}$'
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
let line -= 1
|
||||||
|
endwhile
|
||||||
|
if line < 1
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let line = a:linum
|
||||||
|
let last = line('$')
|
||||||
|
while line <= last
|
||||||
|
let s = getline(line)
|
||||||
|
if s =~# '^}$'
|
||||||
|
let end = line
|
||||||
|
break
|
||||||
|
elseif s =~# '^define\>'
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
let line += 1
|
||||||
|
endwhile
|
||||||
|
if line > last
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
return [start, end]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:blocks_graph_at(linum) abort
|
||||||
|
let func_range = s:function_range_at(a:linum)
|
||||||
|
if empty(func_range)
|
||||||
|
return {}
|
||||||
|
endif
|
||||||
|
let line = func_range[0] + 1
|
||||||
|
let last = func_range[1] - 1
|
||||||
|
let graph = {}
|
||||||
|
while line <= last
|
||||||
|
let block = s:section_delim_at(line)
|
||||||
|
if empty(block)
|
||||||
|
let line += 1
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let block_name = '%' . block[1]
|
||||||
|
if block[0] == s:KIND_BLOCK_PREC
|
||||||
|
let graph[block_name] = {'line': line, 'follows': [], 'preds': []}
|
||||||
|
elseif block[0] == s:KIND_BLOCK_FOLLOW
|
||||||
|
let graph[block_name] = {'line': line, 'follows': [], 'preds': block[2]}
|
||||||
|
for follow in block[2]
|
||||||
|
call add(graph[follow].follows, block_name)
|
||||||
|
endfor
|
||||||
|
else
|
||||||
|
echoerr 'unreachable'
|
||||||
|
endif
|
||||||
|
let line += 1
|
||||||
|
endwhile
|
||||||
|
return graph
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:find_pred_block(linum) abort
|
||||||
|
let sec = s:section_delim_at(a:linum)
|
||||||
|
if empty(sec) || sec[0] != s:KIND_BLOCK_PREC && sec[0] != s:KIND_BLOCK_FOLLOW
|
||||||
|
throw 'No block is starting at line ' . a:linum
|
||||||
|
endif
|
||||||
|
if sec[0] != s:KIND_BLOCK_FOLLOW
|
||||||
|
throw printf("Block '%s' has no pred block", sec[1])
|
||||||
|
endif
|
||||||
|
let block_name = '%' . sec[1]
|
||||||
|
let pred_block = sec[2][0]
|
||||||
|
|
||||||
|
let graph = s:blocks_graph_at(a:linum)
|
||||||
|
if empty(graph)
|
||||||
|
throw 'No block is found in function at line ' . a:linum
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !has_key(graph, pred_block)
|
||||||
|
throw printf("Block '%s' (pred block of '%s') not found in function", pred_block, block_name)
|
||||||
|
endif
|
||||||
|
return graph[pred_block]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:move_to_pred_block() abort
|
||||||
|
try
|
||||||
|
let b = s:find_pred_block(line('.'))
|
||||||
|
call cursor(b.line, col('.'))
|
||||||
|
catch
|
||||||
|
echohl ErrorMsg | echom v:exception | echohl None
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:find_following_block(linum) abort
|
||||||
|
let sec = s:section_delim_at(a:linum)
|
||||||
|
if empty(sec) || sec[0] != s:KIND_BLOCK_PREC && sec[0] != s:KIND_BLOCK_FOLLOW
|
||||||
|
throw 'No block is starting at line ' . a:linum
|
||||||
|
endif
|
||||||
|
let block_name = '%' . sec[1]
|
||||||
|
|
||||||
|
let graph = s:blocks_graph_at(a:linum)
|
||||||
|
if empty(graph)
|
||||||
|
throw 'No block is found in function at line ' . a:linum
|
||||||
|
endif
|
||||||
|
|
||||||
|
let follows = graph[block_name].follows
|
||||||
|
if empty(follows)
|
||||||
|
throw printf("Block '%s' has no following block", block_name)
|
||||||
|
endif
|
||||||
|
|
||||||
|
echom printf("Block '%s' has %d following blocks: %s", block_name, len(follows), join(follows, ', '))
|
||||||
|
|
||||||
|
if !has_key(graph, follows[0])
|
||||||
|
throw printf("Block '%s' is not defined in function at line %d", follows[0], a:linum)
|
||||||
|
endif
|
||||||
|
return graph[follows[0]]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:move_to_following_block() abort
|
||||||
|
try
|
||||||
|
let b = s:find_following_block(line('.'))
|
||||||
|
call cursor(b.line, col('.'))
|
||||||
|
catch
|
||||||
|
echohl ErrorMsg | echom v:exception | echohl None
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !g:llvm_ext_no_mapping
|
||||||
|
nnoremap <buffer><silent>[b :<C-u>call <SID>move_to_pred_block()<CR>
|
||||||
|
nnoremap <buffer><silent>]b :<C-u>call <SID>move_to_following_block()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! s:get_func_identifiers(line) abort
|
||||||
|
let idx = stridx(a:line, '@')
|
||||||
|
if idx == -1
|
||||||
|
" Invalid signature
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
" e.g. define internal i32 @foo(...) { -> @foo(...) {
|
||||||
|
let sig = a:line[idx:]
|
||||||
|
|
||||||
|
let idx = stridx(sig, '(')
|
||||||
|
if idx == -1
|
||||||
|
" Invalid signature
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
|
||||||
|
" @foo(...) { -> @foo
|
||||||
|
let idents = [sig[:idx-1]]
|
||||||
|
|
||||||
|
" @foo(...) { -> ...) {
|
||||||
|
let params = sig[idx+1:]
|
||||||
|
|
||||||
|
let idx = strridx(sig, ')')
|
||||||
|
if idx == -1
|
||||||
|
return idents
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ...) { -> ...
|
||||||
|
let params = params[:idx-1]
|
||||||
|
|
||||||
|
" Gather parameters in function signature
|
||||||
|
while params !=# ''
|
||||||
|
let m = matchlist(params, '^[^%]*\(%\%("[^"]\+"\|[[:alnum:]_.]\+\)\)\s*\(.*\)$')
|
||||||
|
if empty(m)
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let idents += [m[1]]
|
||||||
|
let params = m[2]
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return idents
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:get_identifiers(line) abort
|
||||||
|
" Registers and type defs
|
||||||
|
let m = matchlist(a:line, '^\s*\(%\S\+\)\s\+=')
|
||||||
|
if !empty(m)
|
||||||
|
return [m[1]]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Constants
|
||||||
|
let m = matchlist(a:line, '^\(@\S\+\)\s\+=.\+\<constant\>')
|
||||||
|
if !empty(m)
|
||||||
|
return [m[1]]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Labels for basic blocks
|
||||||
|
let m = matchlist(a:line, '^\([^:]\+\):\%(\s\+; preds = .\+\)\=$')
|
||||||
|
if !empty(m)
|
||||||
|
return ['%' . m[1]]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Meta variables
|
||||||
|
let m = matchlist(a:line, '^\(!\S\+\)\s\+=')
|
||||||
|
if !empty(m)
|
||||||
|
return [m[1]]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Attributes
|
||||||
|
let m = matchlist(a:line, '^attributes\s\+\(#\d\+\)\s\+=')
|
||||||
|
if !empty(m)
|
||||||
|
return [m[1]]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:line =~# '^\%(declare\|define\)\>'
|
||||||
|
return s:get_func_identifiers(a:line)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return []
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:extract_identifier(word) abort
|
||||||
|
if strlen(a:word) <= 1
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prefix = a:word[0]
|
||||||
|
if prefix ==# '@' || prefix ==# '%' || prefix ==# '!'
|
||||||
|
if prefix ==# '!' && a:word[1] ==# '{'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:word[1] == '"'
|
||||||
|
let idx = stridx(a:word, '"', 2)
|
||||||
|
if idx == -1
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
" @"foo" or %"foo"
|
||||||
|
return a:word[:idx]
|
||||||
|
else
|
||||||
|
" @foo or %foo
|
||||||
|
return matchstr(a:word, '^[@%!][[:alnum:]_.]\+')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if prefix ==# '#'
|
||||||
|
return matchstr(a:word, '^#\d\+')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:jump_to_identifier_at(linum, ident) abort
|
||||||
|
let line = getline(a:linum)
|
||||||
|
let column = stridx(line, a:ident) + 1
|
||||||
|
if column == 0
|
||||||
|
let column = col('.')
|
||||||
|
endif
|
||||||
|
call cursor(a:linum, column)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:browser_open_command() abort
|
||||||
|
if exists('g:llvm_ext_browser_open_command')
|
||||||
|
return g:llvm_ext_browser_open_command
|
||||||
|
endif
|
||||||
|
if exists('s:browser_opener')
|
||||||
|
return s:browser_opener
|
||||||
|
endif
|
||||||
|
let s:browser_opener = ''
|
||||||
|
if has('mac')
|
||||||
|
let s:browser_opener = 'open'
|
||||||
|
elseif has('win32') || has('win64')
|
||||||
|
let s:browser_opener = 'cmd /q /c start ""'
|
||||||
|
else
|
||||||
|
for cmd in ['xdg-open', 'chromium', 'google-chrome', 'firefox']
|
||||||
|
if executable(cmd)
|
||||||
|
let s:browser_opener = cmd
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
return s:browser_opener
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:open_browser(url) abort
|
||||||
|
let cmd = s:browser_open_command()
|
||||||
|
if cmd ==# ''
|
||||||
|
throw "Failed to open a browser. I don't know how to open a browser: Please set g:llvm_ext_browser_open_command"
|
||||||
|
endif
|
||||||
|
let cmdline = cmd . ' ' . shellescape(a:url)
|
||||||
|
let out = system(cmdline)
|
||||||
|
if v:shell_error
|
||||||
|
throw printf("Failed to open a browser with command '%s': %s", cmdline, out)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:goto_definition() abort
|
||||||
|
" Open language reference manual under the cursor in browser
|
||||||
|
let syn_name = synIDattr(synID(line('.'),col('.'),1),'name')
|
||||||
|
if syn_name ==# 'llvmStatement'
|
||||||
|
let word = expand('<cword>')
|
||||||
|
if word !=# ''
|
||||||
|
try
|
||||||
|
" Open browser assuming a word under the cursor is an instruction
|
||||||
|
call s:open_browser('https://llvm.org/docs/LangRef.html#' . word . '-instruction')
|
||||||
|
catch /^Failed to open a browser/
|
||||||
|
echohl ErrorMsg | echom v:exception | echohl None
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" XXX: This does not support identifiers which contains spaces
|
||||||
|
let word = expand('<cWORD>')
|
||||||
|
if word ==# ''
|
||||||
|
echom 'No identifier found under the cursor'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let ident = s:extract_identifier(word)
|
||||||
|
if ident ==# ''
|
||||||
|
echom 'No identifier found under the cursor'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Definition tends to be near its usages. Look back at first.
|
||||||
|
let line = line('.')
|
||||||
|
while line > 0
|
||||||
|
for found in s:get_identifiers(getline(line))
|
||||||
|
if ident ==# found
|
||||||
|
call s:jump_to_identifier_at(line, ident)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let line -= 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
let line = line('.') + 1
|
||||||
|
let last = line('$')
|
||||||
|
while line <= last
|
||||||
|
for found in s:get_identifiers(getline(line))
|
||||||
|
if ident ==# found
|
||||||
|
call s:jump_to_identifier_at(line, ident)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let line += 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
echom "No definition for '" . ident . "' found"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !g:llvm_ext_no_mapping
|
||||||
|
nnoremap <buffer><silent>K :<C-u>call <SID>goto_definition()<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! s:run_lli(...) abort
|
||||||
|
if !has('job') || !has('channel') || !has('terminal')
|
||||||
|
echohl ErrorMsg
|
||||||
|
echomsg ':LLI requires terminal feature. Please update your Vim to 8.0+'
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !executable(g:llvm_ext_lli_executable)
|
||||||
|
echohl ErrorMsg
|
||||||
|
echomsg g:llvm_ext_lli_executable . ' is not executable. Please set g:llvm_ext_lli_executable'
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:0 > 0
|
||||||
|
let bufnr = term_start([g:llvm_ext_lli_executable, a:1])
|
||||||
|
echo 'Run lli in termnal buffer(' . bufnr . ')'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let tmpfile = tempname()
|
||||||
|
call writefile(getline(1, '$'), tmpfile)
|
||||||
|
let Cleanup = {ch -> filereadable(tmpfile) ? delete(tmpfile) : 0}
|
||||||
|
let bufnr = term_start([g:llvm_ext_lli_executable, tmpfile], {'close_cb': Cleanup, 'exit_cb': Cleanup})
|
||||||
|
echo 'Run lli in termnal buffer(' . bufnr . ')'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
if !exists(':LLI')
|
||||||
|
command! -buffer -nargs=? -bar -complete=file LLI call <SID>run_lli(<f-args>)
|
||||||
|
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,85 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_align')
|
|
||||||
let g:terraform_align = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_remap_spacebar')
|
|
||||||
let g:terraform_remap_spacebar = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:terraform_fold_sections')
|
|
||||||
let g:terraform_fold_sections = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:terraform_align && exists(':Tabularize')
|
|
||||||
inoremap <buffer> <silent> = =<Esc>:call <SID>terraformalign()<CR>a
|
|
||||||
function! s:terraformalign()
|
|
||||||
let p = '^.*=[^>]*$'
|
|
||||||
if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
|
||||||
let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
|
|
||||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
|
|
||||||
Tabularize/=/l1
|
|
||||||
normal! 0
|
|
||||||
call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:terraform_fold_sections
|
|
||||||
function! TerraformFolds()
|
|
||||||
let thisline = getline(v:lnum)
|
|
||||||
if match(thisline, '^resource') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^provider') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^module') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^variable') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^output') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^data') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^terraform') >= 0
|
|
||||||
return ">1"
|
|
||||||
elseif match(thisline, '^locals') >= 0
|
|
||||||
return ">1"
|
|
||||||
else
|
|
||||||
return "="
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
setlocal foldmethod=expr
|
|
||||||
setlocal foldexpr=TerraformFolds()
|
|
||||||
setlocal foldlevel=1
|
|
||||||
|
|
||||||
function! TerraformFoldText()
|
|
||||||
let foldsize = (v:foldend-v:foldstart)
|
|
||||||
return getline(v:foldstart).' ('.foldsize.' lines)'
|
|
||||||
endfunction
|
|
||||||
setlocal foldtext=TerraformFoldText()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Re-map the space bar to fold and unfold
|
|
||||||
if get(g:, "terraform_remap_spacebar", 1)
|
|
||||||
"inoremap <space> <C-O>za
|
|
||||||
nnoremap <space> za
|
|
||||||
onoremap <space> <C-C>za
|
|
||||||
vnoremap <space> zf
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Match the identation put in place by Hashicorp and :TerraformFmt, https://github.com/hashivim/vim-terraform/issues/21
|
|
||||||
if get(g:, "terraform_align", 1)
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal softtabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Set the commentstring
|
|
||||||
if exists('g:terraform_commentstring')
|
|
||||||
let &l:commentstring=g:terraform_commentstring
|
|
||||||
else
|
|
||||||
setlocal commentstring=#%s
|
|
||||||
endif
|
|
||||||
32
after/ftplugin/typescript.vim
Normal file
32
after/ftplugin/typescript.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
" modified from html.vim
|
||||||
|
" For matchit plugin
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" For andymass/vim-matchup plugin
|
||||||
|
if exists("loaded_matchup")
|
||||||
|
setlocal matchpairs=(:),{:},[:],<:>
|
||||||
|
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||||
|
let b:match_skip = 's:comment\|string'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:original_commentstring = &l:commentstring
|
||||||
|
|
||||||
|
augroup jsx_comment
|
||||||
|
autocmd! CursorMoved <buffer>
|
||||||
|
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
|
||||||
|
augroup end
|
||||||
|
|
||||||
|
setlocal suffixesadd+=.tsx
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
33
after/indent/javascript.vim
Normal file
33
after/indent/javascript.vim
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim indent file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if exists('b:did_indent')
|
||||||
|
let s:did_indent = b:did_indent
|
||||||
|
unlet b:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists('s:did_indent')
|
||||||
|
let b:did_indent = s:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal indentexpr=GetJsxIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||||
|
|
||||||
|
function! GetJsxIndent()
|
||||||
|
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim indent file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" Save the current JavaScript indentexpr.
|
|
||||||
let b:jsx_js_indentexpr = &indentexpr
|
|
||||||
|
|
||||||
" Prologue; load in XML indentation.
|
|
||||||
if exists('b:did_indent')
|
|
||||||
let s:did_indent=b:did_indent
|
|
||||||
unlet b:did_indent
|
|
||||||
endif
|
|
||||||
exe 'runtime! indent/xml.vim'
|
|
||||||
if exists('s:did_indent')
|
|
||||||
let b:did_indent=s:did_indent
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal indentexpr=GetJsxIndent()
|
|
||||||
|
|
||||||
" JS indentkeys
|
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
|
||||||
" XML indentkeys
|
|
||||||
setlocal indentkeys+=*<Return>,<>>,<<>,/
|
|
||||||
|
|
||||||
" Multiline end tag regex (line beginning with '>' or '/>')
|
|
||||||
let s:endtag = '^\s*\/\?>\s*;\='
|
|
||||||
|
|
||||||
" Get all syntax types at the beginning of a given line.
|
|
||||||
fu! SynSOL(lnum)
|
|
||||||
return map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Get all syntax types at the end of a given line.
|
|
||||||
fu! SynEOL(lnum)
|
|
||||||
let lnum = prevnonblank(a:lnum)
|
|
||||||
let col = strlen(getline(lnum))
|
|
||||||
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Check if a syntax attribute is XMLish.
|
|
||||||
fu! SynAttrXMLish(synattr)
|
|
||||||
return a:synattr =~ "^xml" || a:synattr =~ "^jsx"
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Check if a synstack is XMLish (i.e., has an XMLish last attribute).
|
|
||||||
fu! SynXMLish(syns)
|
|
||||||
return SynAttrXMLish(get(a:syns, -1))
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Check if a synstack denotes the end of a JSX block.
|
|
||||||
fu! SynJSXBlockEnd(syns)
|
|
||||||
return get(a:syns, -1) =~ '\%(js\|javascript\)Braces' &&
|
|
||||||
\ SynAttrXMLish(get(a:syns, -2))
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Determine how many jsxRegions deep a synstack is.
|
|
||||||
fu! SynJSXDepth(syns)
|
|
||||||
return len(filter(copy(a:syns), 'v:val ==# "jsxRegion"'))
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Check whether `cursyn' continues the same jsxRegion as `prevsyn'.
|
|
||||||
fu! SynJSXContinues(cursyn, prevsyn)
|
|
||||||
let curdepth = SynJSXDepth(a:cursyn)
|
|
||||||
let prevdepth = SynJSXDepth(a:prevsyn)
|
|
||||||
|
|
||||||
" In most places, we expect the nesting depths to be the same between any
|
|
||||||
" two consecutive positions within a jsxRegion (e.g., between a parent and
|
|
||||||
" child node, between two JSX attributes, etc.). The exception is between
|
|
||||||
" sibling nodes, where after a completed element (with depth N), we return
|
|
||||||
" to the parent's nesting (depth N - 1). This case is easily detected,
|
|
||||||
" since it is the only time when the top syntax element in the synstack is
|
|
||||||
" jsxRegion---specifically, the jsxRegion corresponding to the parent.
|
|
||||||
return prevdepth == curdepth ||
|
|
||||||
\ (prevdepth == curdepth + 1 && get(a:cursyn, -1) ==# 'jsxRegion')
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Cleverly mix JS and XML indentation.
|
|
||||||
fu! GetJsxIndent()
|
|
||||||
let cursyn = SynSOL(v:lnum)
|
|
||||||
let prevsyn = SynEOL(v:lnum - 1)
|
|
||||||
|
|
||||||
" Use XML indenting iff:
|
|
||||||
" - the syntax at the end of the previous line was either JSX or was the
|
|
||||||
" closing brace of a jsBlock whose parent syntax was JSX; and
|
|
||||||
" - the current line continues the same jsxRegion as the previous line.
|
|
||||||
if (SynXMLish(prevsyn) || SynJSXBlockEnd(prevsyn)) &&
|
|
||||||
\ SynJSXContinues(cursyn, prevsyn)
|
|
||||||
let ind = XmlIndentGet(v:lnum, 0)
|
|
||||||
|
|
||||||
" Align '/>' and '>' with '<' for multiline tags.
|
|
||||||
if getline(v:lnum) =~? s:endtag
|
|
||||||
let ind = ind - &sw
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Then correct the indentation of any JSX following '/>' or '>'.
|
|
||||||
if getline(v:lnum - 1) =~? s:endtag
|
|
||||||
let ind = ind + &sw
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
if len(b:jsx_js_indentexpr)
|
|
||||||
" Invoke the base JS package's custom indenter. (For vim-javascript,
|
|
||||||
" e.g., this will be GetJavascriptIndent().)
|
|
||||||
let ind = eval(b:jsx_js_indentexpr)
|
|
||||||
else
|
|
||||||
let ind = cindent(v:lnum)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ind
|
|
||||||
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
|
||||||
|
|||||||
38
after/indent/typescript.vim
Normal file
38
after/indent/typescript.vim
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim indent file
|
||||||
|
"
|
||||||
|
" Language: typescript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
" Depends: leafgarland/typescript-vim
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('b:did_indent')
|
||||||
|
let s:did_indent = b:did_indent
|
||||||
|
unlet b:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists('s:did_indent')
|
||||||
|
let b:did_indent = s:did_indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal indentexpr=GetJsxIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||||
|
|
||||||
|
function! GetJsxIndent()
|
||||||
|
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
59
after/syntax/javascript.vim
Normal file
59
after/syntax/javascript.vim
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim syntax file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
let s:jsx_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
syntax case match
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
let s:current_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('s:current_syntax')
|
||||||
|
let b:current_syntax = s:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
|
||||||
|
syntax cluster jsExpression add=jsxRegion
|
||||||
|
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||||
|
" refine the javascript line comment
|
||||||
|
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||||
|
syntax cluster javascriptValue add=jsxRegion
|
||||||
|
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
||||||
|
else " build-in javascript syntax
|
||||||
|
" refine the javascript line comment
|
||||||
|
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
|
||||||
|
syntax region javaScriptBlock
|
||||||
|
\ matchgroup=javaScriptBraces
|
||||||
|
\ start="{"
|
||||||
|
\ end="}"
|
||||||
|
\ contained
|
||||||
|
\ extend
|
||||||
|
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
|
||||||
|
\ fold
|
||||||
|
|
||||||
|
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime syntax/jsx_pretty.vim
|
||||||
|
|
||||||
|
let b:current_syntax = 'javascript.jsx'
|
||||||
|
|
||||||
|
let &cpo = s:jsx_cpo
|
||||||
|
unlet s:jsx_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -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
|
||||||
@@ -11,7 +9,7 @@ if exists('s:current_syntax')
|
|||||||
let b:current_syntax = s:current_syntax
|
let b:current_syntax = s:current_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:tags = '\%(' . join(g:graphql_javascript_tags, '\|') . '\)'
|
let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)'
|
||||||
|
|
||||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend'
|
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend'
|
||||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
||||||
@@ -25,3 +23,5 @@ hi def link graphqlTemplateExpression jsTemplateExpression
|
|||||||
|
|
||||||
syn cluster jsExpression add=graphqlTaggedTemplate
|
syn cluster jsExpression add=graphqlTaggedTemplate
|
||||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'jsx') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Vim syntax file
|
|
||||||
"
|
|
||||||
" Language: JSX (JavaScript)
|
|
||||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
||||||
" Depends: pangloss/vim-javascript
|
|
||||||
"
|
|
||||||
" CREDITS: Inspired by Facebook.
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
" Prologue; load in XML syntax.
|
|
||||||
if exists('b:current_syntax')
|
|
||||||
let s:current_syntax=b:current_syntax
|
|
||||||
unlet b:current_syntax
|
|
||||||
endif
|
|
||||||
syn include @XMLSyntax syntax/xml.vim
|
|
||||||
if exists('s:current_syntax')
|
|
||||||
let b:current_syntax=s:current_syntax
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Officially, vim-jsx depends on the pangloss/vim-javascript syntax package
|
|
||||||
" (and is tested against it exclusively). However, in practice, we make some
|
|
||||||
" effort towards compatibility with other packages.
|
|
||||||
"
|
|
||||||
" These are the plugin-to-syntax-element correspondences:
|
|
||||||
"
|
|
||||||
" - pangloss/vim-javascript: jsBlock, jsExpression
|
|
||||||
" - jelera/vim-javascript-syntax: javascriptBlock
|
|
||||||
" - othree/yajs.vim: javascriptNoReserved
|
|
||||||
|
|
||||||
|
|
||||||
" JSX attributes should color as JS. Note the trivial end pattern; we let
|
|
||||||
" jsBlock take care of ending the region.
|
|
||||||
syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock
|
|
||||||
|
|
||||||
" JSX comments inside XML tag should color as comment. Note the trivial end pattern; we let
|
|
||||||
" jsComment take care of ending the region.
|
|
||||||
syn region xmlString contained start=+//+ end=++ contains=jsComment
|
|
||||||
|
|
||||||
" JSX child blocks behave just like JSX attributes, except that (a) they are
|
|
||||||
" syntactically distinct, and (b) they need the syn-extend argument, or else
|
|
||||||
" nested XML end-tag patterns may end the outer jsxRegion.
|
|
||||||
syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Highlight JSX regions as XML; recursively match.
|
|
||||||
"
|
|
||||||
" Note that we prohibit JSX tags from having a < or word character immediately
|
|
||||||
" preceding it, to avoid conflicts with, respectively, the left shift operator
|
|
||||||
" and generic Flow type annotations (http://flowtype.org/).
|
|
||||||
syn region jsxRegion
|
|
||||||
\ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock
|
|
||||||
\ start=+\%(<\|\w\)\@<!<\z([a-zA-Z_][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*>(\)\@!+
|
|
||||||
\ skip=+<!--\_.\{-}-->+
|
|
||||||
\ end=+</\z1\_\s\{-}>+
|
|
||||||
\ end=+/>+
|
|
||||||
\ keepend
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Shorthand fragment support
|
|
||||||
"
|
|
||||||
" Note that since the main jsxRegion contains @XMLSyntax, we cannot simply
|
|
||||||
" adjust the regex above since @XMLSyntax will highlight the opening `<` as an
|
|
||||||
" XMLError. Instead we create a new group with the same name that does not
|
|
||||||
" include @XMLSyntax and instead uses matchgroup to get the same highlighting.
|
|
||||||
syn region jsxRegion
|
|
||||||
\ contains=@Spell,jsxRegion,jsxChild,jsBlock,javascriptBlock
|
|
||||||
\ matchgroup=xmlTag
|
|
||||||
\ start=/<>/
|
|
||||||
\ end=/<\/>/
|
|
||||||
\ keepend
|
|
||||||
\ extend
|
|
||||||
|
|
||||||
" Add jsxRegion to the lowest-level JS syntax cluster.
|
|
||||||
syn cluster jsExpression add=jsxRegion
|
|
||||||
|
|
||||||
" Allow jsxRegion to contain reserved words.
|
|
||||||
syn cluster javascriptNoReserved add=jsxRegion
|
|
||||||
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
|
||||||
26
after/syntax/llvm.vim
Normal file
26
after/syntax/llvm.vim
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||||
|
|
||||||
|
" Copyright (c) 2018 rhysd
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of this software and associated documentation files (the "Software"), to deal
|
||||||
|
" in the Software without restriction, including without limitation the rights
|
||||||
|
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
" copies of the Software, and to permit persons to whom the Software is
|
||||||
|
" furnished to do so, subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in
|
||||||
|
" all copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
" THE SOFTWARE.
|
||||||
|
|
||||||
|
syn keyword llvmKeyword attributes
|
||||||
|
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
|
||||||
|
|||||||
1475
after/syntax/mma.vim
1475
after/syntax/mma.vim
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
|
|||||||
54
after/syntax/typescript.vim
Normal file
54
after/syntax/typescript.vim
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim syntax file
|
||||||
|
"
|
||||||
|
" Language: javascript.jsx
|
||||||
|
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||||
|
" Depends: leafgarland/typescript-vim
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:jsx_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
syntax case match
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
let s:current_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('s:current_syntax')
|
||||||
|
let b:current_syntax = s:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
" refine the typescript line comment
|
||||||
|
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
||||||
|
|
||||||
|
if !hlexists('typescriptTypeCast')
|
||||||
|
" add a typescriptBlock group for typescript
|
||||||
|
syntax region typescriptBlock
|
||||||
|
\ matchgroup=typescriptBraces
|
||||||
|
\ start="{"
|
||||||
|
\ end="}"
|
||||||
|
\ contained
|
||||||
|
\ extend
|
||||||
|
\ contains=@typescriptExpression,typescriptBlock
|
||||||
|
\ fold
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax cluster typescriptExpression add=jsxRegion,typescriptParens
|
||||||
|
|
||||||
|
runtime syntax/jsx_pretty.vim
|
||||||
|
|
||||||
|
let b:current_syntax = 'typescript.tsx'
|
||||||
|
|
||||||
|
let &cpo = s:jsx_cpo
|
||||||
|
unlet s:jsx_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -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
|
||||||
@@ -11,7 +9,7 @@ if exists('s:current_syntax')
|
|||||||
let b:current_syntax = s:current_syntax
|
let b:current_syntax = s:current_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:tags = '\%(' . join(g:graphql_javascript_tags, '\|') . '\)'
|
let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)'
|
||||||
|
|
||||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend'
|
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend'
|
||||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
||||||
@@ -24,3 +22,5 @@ hi def link graphqlTemplateExpression typescriptTemplateSubstitution
|
|||||||
|
|
||||||
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
||||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||||
|
|
||||||
|
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,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#Load()
|
function! cargo#Load()
|
||||||
" Utility call to get this script loaded, for debugging
|
" Utility call to get this script loaded, for debugging
|
||||||
@@ -117,3 +115,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
|
||||||
@@ -37,28 +35,59 @@ function! s:run_cmd(cmd) abort
|
|||||||
return s:P.system(a:cmd)
|
return s:P.system(a:cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:find_root_by_spec(d) abort
|
function! s:find_root_by(search_dir, d) abort
|
||||||
let dir = finddir('spec', a:d . ';')
|
let found_dir = finddir(a:search_dir, a:d . ';')
|
||||||
if dir ==# ''
|
if found_dir ==# ''
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Note: ':h:h' for {root}/spec/ -> {root}/spec -> {root}
|
" Note: ':h:h' for {root}/{search_dir}/ -> {root}/{search_dir} -> {root}
|
||||||
return fnamemodify(dir, ':p:h:h')
|
return fnamemodify(found_dir, ':p:h:h')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Search the root directory containing a 'spec/' and a 'src/' directories.
|
||||||
|
"
|
||||||
|
" Searching for the 'spec/' directory is not enough: for example the crystal
|
||||||
|
" compiler has a 'cr_sources/src/spec/' directory that would otherwise give the root
|
||||||
|
" directory as 'cr_source/src/' instead of 'cr_sources/'.
|
||||||
|
function! s:find_root_by_spec_and_src(d) abort
|
||||||
|
" Search for 'spec/'
|
||||||
|
let root = s:find_root_by('spec', a:d)
|
||||||
|
" Check that 'src/' is also there
|
||||||
|
if root !=# '' && isdirectory(root . '/src')
|
||||||
|
return root
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Search for 'src/'
|
||||||
|
let root = s:find_root_by('src', a:d)
|
||||||
|
" Check that 'spec/' is also there
|
||||||
|
if root !=# '' && isdirectory(root . '/spec')
|
||||||
|
return root
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Cannot find a directory containing both 'src/' and 'spec/'
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! crystal_lang#entrypoint_for(file_path) abort
|
function! crystal_lang#entrypoint_for(file_path) abort
|
||||||
let parent_dir = fnamemodify(a:file_path, ':p:h')
|
let parent_dir = fnamemodify(a:file_path, ':p:h')
|
||||||
let root_dir = s:find_root_by_spec(parent_dir)
|
let root_dir = s:find_root_by_spec_and_src(parent_dir)
|
||||||
if root_dir ==# ''
|
if root_dir ==# ''
|
||||||
" No spec diretory found. No need to make temporary file
|
" No spec directory found. No need to make temporary file
|
||||||
return a:file_path
|
return a:file_path
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
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 : ])
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
@@ -232,7 +261,7 @@ endfunction
|
|||||||
|
|
||||||
function! crystal_lang#run_all_spec(...) abort
|
function! crystal_lang#run_all_spec(...) abort
|
||||||
let path = a:0 == 0 ? expand('%:p:h') : a:1
|
let path = a:0 == 0 ? expand('%:p:h') : a:1
|
||||||
let root_path = s:find_root_by_spec(path)
|
let root_path = s:find_root_by_spec_and_src(path)
|
||||||
if root_path ==# ''
|
if root_path ==# ''
|
||||||
return s:echo_error("'spec' directory is not found")
|
return s:echo_error("'spec' directory is not found")
|
||||||
endif
|
endif
|
||||||
@@ -250,9 +279,9 @@ function! crystal_lang#run_current_spec(...) abort
|
|||||||
let source_dir = fnamemodify(path, ':h')
|
let source_dir = fnamemodify(path, ':h')
|
||||||
|
|
||||||
" /foo/bar
|
" /foo/bar
|
||||||
let root_dir = s:find_root_by_spec(source_dir)
|
let root_dir = s:find_root_by_spec_and_src(source_dir)
|
||||||
if root_dir ==# ''
|
if root_dir ==# ''
|
||||||
return s:echo_error("'spec' directory is not found")
|
return s:echo_error("Root directory with 'src/' and 'spec/' not found")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" src
|
" src
|
||||||
@@ -318,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
|
||||||
@@ -9,68 +7,77 @@ function! s:error(text) abort
|
|||||||
echohl None
|
echohl None
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:cexpr(errorformat, joined_lines) abort
|
function! s:cexpr(errorformat, lines, reason) abort
|
||||||
let temp_errorfomat = &errorformat
|
call setqflist([], ' ', {
|
||||||
try
|
\ 'lines': a:lines,
|
||||||
let &errorformat = a:errorformat
|
\ 'efm': a:errorformat,
|
||||||
cexpr a:joined_lines
|
\ 'context': {'reason': a:reason},
|
||||||
copen
|
\})
|
||||||
finally
|
copen
|
||||||
let &errorformat = temp_errorfomat
|
endfunction
|
||||||
endtry
|
|
||||||
|
" If the quickfix list has a context matching [reason], clear and close it.
|
||||||
|
function! s:clearQfList(reason) abort
|
||||||
|
let context = get(getqflist({'context': 1}), 'context', {})
|
||||||
|
if type(context) == v:t_dict &&
|
||||||
|
\ has_key(context, 'reason') &&
|
||||||
|
\ context.reason == a:reason
|
||||||
|
call setqflist([], 'r')
|
||||||
|
cclose
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#fmt(q_args) abort
|
function! dart#fmt(q_args) abort
|
||||||
if executable('dartfmt')
|
let cmd = s:FindDartFmt()
|
||||||
let buffer_content = join(getline(1, '$'), "\n")
|
if type(cmd) != type('') | return | endif
|
||||||
let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content)
|
let buffer_content = getline(1, '$')
|
||||||
if buffer_content ==# joined_lines[:-2] | return | endif
|
let args = '--stdin-name '.expand('%').' '.a:q_args
|
||||||
if 0 == v:shell_error
|
let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n"))
|
||||||
let win_view = winsaveview()
|
" TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the
|
||||||
let lines = split(joined_lines, "\n")
|
" tool no longer emits this line on SDK upgrades.
|
||||||
silent keepjumps call setline(1, lines)
|
if lines[-1] ==# 'Isolate creation failed'
|
||||||
if line('$') > len(lines)
|
let lines = lines[:-2]
|
||||||
silent keepjumps execute string(len(lines)+1).',$ delete'
|
|
||||||
endif
|
|
||||||
call winrestview(win_view)
|
|
||||||
else
|
|
||||||
let errors = split(joined_lines, "\n")[2:]
|
|
||||||
let file_path = expand('%')
|
|
||||||
call map(errors, 'file_path.":".v:val')
|
|
||||||
let error_format = '%A%f:line %l\, column %c of stdin: %m,%C%.%#'
|
|
||||||
call s:cexpr(error_format, join(errors, "\n"))
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
call s:error('cannot execute binary file: dartfmt')
|
|
||||||
endif
|
endif
|
||||||
|
if buffer_content == lines
|
||||||
|
call s:clearQfList('dartfmt')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if 0 == v:shell_error
|
||||||
|
let win_view = winsaveview()
|
||||||
|
silent keepjumps call setline(1, lines)
|
||||||
|
if line('$') > len(lines)
|
||||||
|
silent keepjumps execute string(len(lines)+1).',$ delete'
|
||||||
|
endif
|
||||||
|
call winrestview(win_view)
|
||||||
|
call s:clearQfList('dartfmt')
|
||||||
|
else
|
||||||
|
let errors = lines[2:]
|
||||||
|
let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
|
||||||
|
call s:cexpr(error_format, errors, 'dartfmt')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
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
|
||||||
|
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 joined_lines = system(printf('dartanalyzer %s %s', a:q_args, shellescape(path)))
|
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
|
||||||
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 joined_lines = system(printf('dart2js %s %s', a:q_args, shellescape(path)))
|
|
||||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
|
||||||
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`.
|
||||||
@@ -172,3 +179,5 @@ function! dart#setModifiable() abort
|
|||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
24
autoload/db/adapter/ecto.vim
Normal file
24
autoload/db/adapter/ecto.vim
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||||
|
|
||||||
|
let s:path = expand('<sfile>:h')
|
||||||
|
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
|
||||||
|
|
||||||
|
function! s:repo_list() abort
|
||||||
|
return map(systemlist(s:cmd), 'split(v:val)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! db#adapter#ecto#canonicalize(url) abort
|
||||||
|
for l:item in s:repo_list()
|
||||||
|
let l:name = get(l:item, 0)
|
||||||
|
let l:url = get(l:item, 1)
|
||||||
|
if !empty(l:name) && 'ecto:'.l:name ==# a:url
|
||||||
|
return l:url
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! db#adapter#ecto#complete_opaque(url) abort
|
||||||
|
return map(s:repo_list(), 'v:val[0]')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
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
|
||||||
@@ -136,7 +134,13 @@ function! elm#util#GoToModule(name)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:findLocalModule(rel_path, root)
|
function! s:findLocalModule(rel_path, root)
|
||||||
let l:package_json = a:root . '/elm-package.json'
|
let l:old_match = findfile('elm-package.json', a:root . ';')
|
||||||
|
let l:new_match = findfile('elm.json', a:root . ';')
|
||||||
|
if !empty(l:new_match)
|
||||||
|
let l:package_json = l:new_match
|
||||||
|
elseif !empty(l:old_match)
|
||||||
|
let l:package_json = l:old_match
|
||||||
|
endif
|
||||||
if exists('*json_decode')
|
if exists('*json_decode')
|
||||||
let l:package = json_decode(readfile(l:package_json))
|
let l:package = json_decode(readfile(l:package_json))
|
||||||
let l:source_roots = l:package['source-directories']
|
let l:source_roots = l:package['source-directories']
|
||||||
@@ -176,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
|
||||||
@@ -25,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
|
||||||
@@ -51,8 +51,16 @@ 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 get(g:, 'go_term_enabled', 0)
|
return has('nvim') && get(g:, 'go_term_enabled', 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#SetTermEnabled(value) abort
|
function! go#config#SetTermEnabled(value) abort
|
||||||
@@ -118,7 +126,7 @@ function! go#config#ListAutoclose() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#InfoMode() abort
|
function! go#config#InfoMode() abort
|
||||||
return get(g:, 'go_info_mode', 'gocode')
|
return get(g:, 'go_info_mode', 'gopls')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GuruScope() abort
|
function! go#config#GuruScope() abort
|
||||||
@@ -178,12 +186,15 @@ 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
|
||||||
|
|
||||||
function! go#config#DefMode() abort
|
function! go#config#DefMode() abort
|
||||||
return get(g:, 'go_def_mode', 'guru')
|
return get(g:, 'go_def_mode', 'gopls')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#DeclsIncludes() abort
|
function! go#config#DeclsIncludes() abort
|
||||||
@@ -196,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',
|
||||||
\ }
|
\ }
|
||||||
\ )
|
\ )
|
||||||
|
|
||||||
@@ -214,6 +226,16 @@ function! go#config#DebugCommands() abort
|
|||||||
return g:go_debug_commands
|
return g:go_debug_commands
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#DebugLogOutput() abort
|
||||||
|
return get(g:, 'go_debug_log_output', 'debugger,rpc')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#LspLog() abort
|
||||||
|
" make sure g:go_lsp_log is set so that it can be added to easily.
|
||||||
|
let g:go_lsp_log = get(g:, 'go_lsp_log', [])
|
||||||
|
return g:go_lsp_log
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#SetDebugDiag(value) abort
|
function! go#config#SetDebugDiag(value) abort
|
||||||
let g:go_debug_diag = a:value
|
let g:go_debug_diag = a:value
|
||||||
endfunction
|
endfunction
|
||||||
@@ -239,19 +261,27 @@ function! go#config#SetTemplateAutocreate(value) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterCommand() abort
|
function! go#config#MetalinterCommand() abort
|
||||||
return get(g:, "go_metalinter_command", "")
|
return get(g:, "go_metalinter_command", "golangci-lint")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterAutosaveEnabled() abort
|
function! go#config#MetalinterAutosaveEnabled() abort
|
||||||
return get(g:, 'go_metalinter_autosave_enabled', ['vet', 'golint'])
|
let l:default_enabled = ["vet", "golint"]
|
||||||
|
|
||||||
|
if go#config#MetalinterCommand() == "golangci-lint"
|
||||||
|
let l:default_enabled = ["govet", "golint"]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(g:, "go_metalinter_autosave_enabled", default_enabled)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterEnabled() abort
|
function! go#config#MetalinterEnabled() abort
|
||||||
return get(g:, "go_metalinter_enabled", ['vet', 'golint', 'errcheck'])
|
let l:default_enabled = ["vet", "golint", "errcheck"]
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! go#config#MetalinterDisabled() abort
|
if go#config#MetalinterCommand() == "golangci-lint"
|
||||||
return get(g:, "go_metalinter_disabled", [])
|
let l:default_enabled = ["govet", "golint"]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(g:, "go_metalinter_enabled", default_enabled)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GolintBin() abort
|
function! go#config#GolintBin() abort
|
||||||
@@ -338,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
|
||||||
@@ -433,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
|
||||||
@@ -448,6 +491,34 @@ function! go#config#EchoGoInfo() abort
|
|||||||
return get(g:, "go_echo_go_info", 1)
|
return get(g:, "go_echo_go_info", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#CodeCompletionEnabled() abort
|
||||||
|
return get(g:, "go_code_completion_enabled", 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
" 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.
|
||||||
@@ -460,3 +531,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
|
||||||
|
|||||||
41
autoload/jsx_pretty/comment.vim
Normal file
41
autoload/jsx_pretty/comment.vim
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
function! jsx_pretty#comment#update_commentstring(original)
|
||||||
|
let syn_current = s:syn_name(line('.'), col('.'))
|
||||||
|
let syn_start = s:syn_name(line('.'), 1)
|
||||||
|
let save_cursor = getcurpos()
|
||||||
|
|
||||||
|
if syn_start =~? '^jsx'
|
||||||
|
let line = getline(".")
|
||||||
|
let start = len(matchstr(line, '^\s*'))
|
||||||
|
let syn_name = s:syn_name(line('.'), start + 1)
|
||||||
|
|
||||||
|
if line =~ '^\s*//'
|
||||||
|
let &l:commentstring = '// %s'
|
||||||
|
elseif s:syn_contains(line('.'), col('.'), 'jsxTaggedRegion')
|
||||||
|
let &l:commentstring = '<!-- %s -->'
|
||||||
|
elseif syn_name =~? '^jsxAttrib'
|
||||||
|
let &l:commentstring = '// %s'
|
||||||
|
else
|
||||||
|
let &l:commentstring = '{/* %s */}'
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let &l:commentstring = a:original
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Restore the cursor position
|
||||||
|
call setpos('.', save_cursor)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_name(lnum, cnum)
|
||||||
|
let syn_id = get(synstack(a:lnum, a:cnum), -1)
|
||||||
|
return synIDattr(syn_id, "name")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:syn_contains(lnum, cnum, syn_name)
|
||||||
|
let stack = synstack(a:lnum, a:cnum)
|
||||||
|
let syn_names = map(stack, 'synIDattr(v:val, "name")')
|
||||||
|
return index(syn_names, a:syn_name) >= 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
306
autoload/jsx_pretty/indent.vim
Normal file
306
autoload/jsx_pretty/indent.vim
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||||
|
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
function! s:sw()
|
||||||
|
return shiftwidth()
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:sw()
|
||||||
|
return &sw
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Regexp for the start tag
|
||||||
|
let s:start_tag = '<\_s*\%(>\|\${\|\%(\<[-:._$A-Za-z0-9]\+\>\)\)'
|
||||||
|
" Regexp for the end tag
|
||||||
|
let s:end_tag = '\%(<\_s*/\_s*\%(\<[-:._$A-Za-z0-9]\+\>\)\_s*>\|/\_s*>\)'
|
||||||
|
|
||||||
|
function s:trim(line)
|
||||||
|
return substitute(a:line, '^\s*\|\s*$', '', 'g')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the syntax stack at the given position
|
||||||
|
function s:syntax_stack_at(lnum, col)
|
||||||
|
return map(synstack(a:lnum, a:col), 'synIDattr(v:val, "name")')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the syntax at the given position
|
||||||
|
function s:syntax_at(lnum, col)
|
||||||
|
return synIDattr(synID(a:lnum, a:col, 1), 'name')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the start col of the non-space charactor
|
||||||
|
function s:start_col(lnum)
|
||||||
|
return len(matchstr(getline(a:lnum), '^\s*')) + 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the start syntax of a given line number
|
||||||
|
function s:start_syntax(lnum)
|
||||||
|
return s:syntax_at(a:lnum, s:start_col(a:lnum))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" The skip function for searchpair
|
||||||
|
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
|
||||||
|
|
||||||
|
" Whether the specified stytax group is the opening tag
|
||||||
|
function s:is_opening_tag(syntax)
|
||||||
|
return a:syntax =~? 'jsxOpenPunct'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified stytax group is the closing tag
|
||||||
|
function s:is_closing_tag(syntax)
|
||||||
|
return a:syntax =~? 'jsxClose'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxRegion
|
||||||
|
function s:is_jsx_region(syntax)
|
||||||
|
return a:syntax =~? 'jsxRegion'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Whether the specified syntax group is the jsxElement
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
function! jsx_pretty#indent#get(js_indent)
|
||||||
|
let line = s:trim(getline(v:lnum))
|
||||||
|
let start_syntax = s:start_syntax(v:lnum)
|
||||||
|
|
||||||
|
if s:is_jsx_backticks(start_syntax)
|
||||||
|
return s:jsx_indent_backticks(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:is_jsx_brace(start_syntax)
|
||||||
|
return s:jsx_indent_element(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:is_opening_tag(start_syntax) && line =~ '^>'
|
||||||
|
return s:jsx_indent_trail_punct(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
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
|
||||||
|
return indent(prev_lnum)
|
||||||
|
endif
|
||||||
|
elseif syntax_context == 'jsxTaggedRegion'
|
||||||
|
if s:is_closing_tag(start_syntax)
|
||||||
|
return s:jsx_indent_closing_tag(v:lnum)
|
||||||
|
elseif s:is_jsx_comment(start_syntax)
|
||||||
|
return s:jsx_indent_comment(v:lnum)
|
||||||
|
else
|
||||||
|
return indent(s:prev_lnum(v:lnum)) + s:sw()
|
||||||
|
endif
|
||||||
|
elseif syntax_context == 'jsxElement'
|
||||||
|
if s:is_jsx_comment(start_syntax)
|
||||||
|
return s:jsx_indent_comment(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:is_comment(start_syntax)
|
||||||
|
return s:jsx_indent_comment(v:lnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return s:jsx_indent_element(v:lnum)
|
||||||
|
elseif syntax_context == 'jsxEscapeJs'
|
||||||
|
let prev_lnum = s:prev_lnum(v:lnum)
|
||||||
|
let prev_line = s:trim(getline(prev_lnum))
|
||||||
|
|
||||||
|
if line =~ '^?'
|
||||||
|
return indent(prev_lnum) + s:sw()
|
||||||
|
elseif line =~ '^:'
|
||||||
|
return indent(prev_lnum)
|
||||||
|
else
|
||||||
|
return a:js_indent()
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return a:js_indent()
|
||||||
|
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
|
|
||||||
|
|
||||||
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,9 +1,7 @@
|
|||||||
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.1.0-DEV.695
|
" The symbols are based on Julia version 1.3.0-DEV.263
|
||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
@@ -392,6 +390,7 @@ function! julia_latex_symbols#get_dict()
|
|||||||
\ '\trademark': '™',
|
\ '\trademark': '™',
|
||||||
\ '\:tm:': '™',
|
\ '\:tm:': '™',
|
||||||
\ '\bbZ': 'ℤ',
|
\ '\bbZ': 'ℤ',
|
||||||
|
\ '\ohm': 'Ω',
|
||||||
\ '\mho': '℧',
|
\ '\mho': '℧',
|
||||||
\ '\frakZ': 'ℨ',
|
\ '\frakZ': 'ℨ',
|
||||||
\ '\turnediota': '℩',
|
\ '\turnediota': '℩',
|
||||||
@@ -498,8 +497,8 @@ function! julia_latex_symbols#get_dict()
|
|||||||
\ '\circlearrowright': '↻',
|
\ '\circlearrowright': '↻',
|
||||||
\ '\leftharpoonup': '↼',
|
\ '\leftharpoonup': '↼',
|
||||||
\ '\leftharpoondown': '↽',
|
\ '\leftharpoondown': '↽',
|
||||||
\ '\upharpoonleft': '↾',
|
\ '\upharpoonright': '↾',
|
||||||
\ '\upharpoonright': '↿',
|
\ '\upharpoonleft': '↿',
|
||||||
\ '\rightharpoonup': '⇀',
|
\ '\rightharpoonup': '⇀',
|
||||||
\ '\rightharpoondown': '⇁',
|
\ '\rightharpoondown': '⇁',
|
||||||
\ '\downharpoonright': '⇂',
|
\ '\downharpoonright': '⇂',
|
||||||
@@ -3331,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,7 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'racket') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("g:raco_command")
|
|
||||||
let g:raco_command = system("which raco")
|
|
||||||
endif
|
|
||||||
@@ -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,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: Kevin Ballard
|
" Author: Kevin Ballard
|
||||||
" Description: Helper functions for Rust commands/mappings
|
" Description: Helper functions for Rust commands/mappings
|
||||||
@@ -400,10 +398,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
|
||||||
echoerr 'Attempted to delete protected path: ' . a:path
|
let l:path = expand(a:path)
|
||||||
|
if l:path ==# '/' || l:path ==# $HOME
|
||||||
|
echoerr 'Attempted to delete protected path: ' . a:path
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !isdirectory(a:path)
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
return system("rm -rf " . shellescape(a:path))
|
|
||||||
|
" 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.
|
||||||
@@ -509,8 +516,10 @@ function! rust#Test(all, options) abort
|
|||||||
return rust#Run(1, '--test ' . a:options)
|
return rust#Run(1, '--test ' . a:options)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists(':terminal')
|
if has('terminal')
|
||||||
let cmd = 'terminal '
|
let cmd = 'terminal '
|
||||||
|
elseif has('nvim')
|
||||||
|
let cmd = 'noautocmd new | terminal '
|
||||||
else
|
else
|
||||||
let cmd = '!'
|
let cmd = '!'
|
||||||
let manifest = shellescape(manifest)
|
let manifest = shellescape(manifest)
|
||||||
@@ -530,7 +539,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 +557,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
|
||||||
call s:Echo('let g:' . l:key . ' = ' . string(get(g:, l:key, v:null)))
|
if l:key !~# '^_'
|
||||||
|
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()
|
||||||
@@ -149,9 +147,12 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
|
|
||||||
call delete(l:stderr_tmpname)
|
call delete(l:stderr_tmpname)
|
||||||
|
|
||||||
|
let l:open_lwindow = 0
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0
|
||||||
" remove undo point caused via BufWritePre
|
if a:from_writepre
|
||||||
try | silent undojoin | catch | endtry
|
" remove undo point caused via BufWritePre
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
endif
|
||||||
|
|
||||||
if a:tmpname ==# ''
|
if a:tmpname ==# ''
|
||||||
let l:content = l:out
|
let l:content = l:out
|
||||||
@@ -169,9 +170,9 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
if s:got_fmt_error
|
if s:got_fmt_error
|
||||||
let s:got_fmt_error = 0
|
let s:got_fmt_error = 0
|
||||||
call setloclist(0, [])
|
call setloclist(0, [])
|
||||||
lwindow
|
let l:open_lwindow = 1
|
||||||
endif
|
endif
|
||||||
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
|
elseif g:rustfmt_fail_silently == 0 && !a: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 = []
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let s:got_fmt_error = 1
|
let s:got_fmt_error = 1
|
||||||
lwindow
|
let l:open_lwindow = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Restore the current directory if needed
|
" Restore the current directory if needed
|
||||||
@@ -213,6 +214,11 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Open lwindow after we have changed back to the previous directory
|
||||||
|
if l:open_lwindow == 1
|
||||||
|
lwindow
|
||||||
|
endif
|
||||||
|
|
||||||
silent! loadview
|
silent! loadview
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -220,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()
|
||||||
@@ -234,10 +240,18 @@ function! rustfmt#Cmd()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! rustfmt#PreWrite()
|
function! rustfmt#PreWrite()
|
||||||
|
if !filereadable(expand("%@"))
|
||||||
|
return
|
||||||
|
endif
|
||||||
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
|
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
|
||||||
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
|
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
|
||||||
let b:rustfmt_autosave = 1
|
let b:rustfmt_autosave = 1
|
||||||
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
|
||||||
|
|
||||||
@@ -245,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,41 +0,0 @@
|
|||||||
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'scss') != -1
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" usage:
|
|
||||||
" set indentexpr=scss_indent#GetIndent(v:lnum)
|
|
||||||
fun! scss_indent#GetIndent(lnum)
|
|
||||||
" { -> increase indent
|
|
||||||
" } -> decrease indent
|
|
||||||
if a:lnum == 1
|
|
||||||
" start at 0 indentation
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" try to find last line ending with { or }
|
|
||||||
" ignoring // comments
|
|
||||||
let regex = '\([{}]\)\%(\/\/.*\)\?$'
|
|
||||||
let nr = search(regex, 'bnW')
|
|
||||||
if nr > 0
|
|
||||||
let last = indent(nr)
|
|
||||||
let m = matchlist(getline(nr), regex)
|
|
||||||
let m_curr = matchlist(getline(a:lnum), regex)
|
|
||||||
echoe string(m).string(m_curr)
|
|
||||||
if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{'
|
|
||||||
" last was open, current is close, use same indent
|
|
||||||
return last
|
|
||||||
elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}'
|
|
||||||
" } line and last line was }: decrease
|
|
||||||
return last - &sw
|
|
||||||
endif
|
|
||||||
if m[1] == '{'
|
|
||||||
" line after {: increase indent
|
|
||||||
return last + &sw
|
|
||||||
else
|
|
||||||
" line after } or { - same indent
|
|
||||||
return last
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
@@ -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
|
||||||
|
|||||||
64
autoload/terraform.vim
Normal file
64
autoload/terraform.vim
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
|
||||||
|
|
||||||
|
" Ensure no conflict with arguments from the environment
|
||||||
|
let $TF_CLI_ARGS_fmt=''
|
||||||
|
|
||||||
|
function! terraform#fmt()
|
||||||
|
if !filereadable(expand('%:p'))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
" Make a fake change so that the undo point is right.
|
||||||
|
normal! ix
|
||||||
|
normal! "_x
|
||||||
|
silent execute '%!terraform fmt -no-color -'
|
||||||
|
if v:shell_error != 0
|
||||||
|
let output = getline(1, '$')
|
||||||
|
silent undo
|
||||||
|
echo join(output, "\n")
|
||||||
|
endif
|
||||||
|
call winrestview(l:curw)
|
||||||
|
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)
|
||||||
@@ -872,3 +870,5 @@ let g:xmldata_html5 = {
|
|||||||
\ 'wbr': ['/>', ''],
|
\ 'wbr': ['/>', ''],
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
43
autoload/zig/config.vim
Normal file
43
autoload/zig/config.vim
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
|
||||||
|
function! zig#config#ListTypeCommands() abort
|
||||||
|
return get(g:, 'zig_list_type_commands', {})
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListType() abort
|
||||||
|
return get(g:, 'zig_list_type', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListAutoclose() abort
|
||||||
|
return get(g:, 'zig_list_autoclose', 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#ListHeight() abort
|
||||||
|
return get(g:, "zig_list_height", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtAutosave() abort
|
||||||
|
return get(g:, "zig_fmt_autosave", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#SetFmtAutosave(value) abort
|
||||||
|
let g:zig_fmt_autosave = a:value
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtCommand() abort
|
||||||
|
return get(g:, "zig_fmt_command", ['zig', 'fmt', '--color', 'off'])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtFailSilently() abort
|
||||||
|
return get(g:, "zig_fmt_fail_silently", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#FmtExperimental() abort
|
||||||
|
return get(g:, "zig_fmt_experimental", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#config#Debug() abort
|
||||||
|
return get(g:, 'zig_debug', [])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
170
autoload/zig/fmt.vim
Normal file
170
autoload/zig/fmt.vim
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
|
||||||
|
" Adapted from fatih/vim-go: autoload/go/fmt.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
function! zig#fmt#Format() abort
|
||||||
|
if zig#config#FmtExperimental()
|
||||||
|
" Using winsaveview to save/restore cursor state has the problem of
|
||||||
|
" closing folds on save:
|
||||||
|
" https://github.com/fatih/vim-go/issues/502
|
||||||
|
" One fix is to use mkview instead. Unfortunately, this sometimes causes
|
||||||
|
" other bad side effects:
|
||||||
|
" https://github.com/fatih/vim-go/issues/728
|
||||||
|
" and still closes all folds if foldlevel>0:
|
||||||
|
" https://github.com/fatih/vim-go/issues/732
|
||||||
|
let l:curw = {}
|
||||||
|
try
|
||||||
|
mkview!
|
||||||
|
catch
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
endtry
|
||||||
|
|
||||||
|
" save our undo file to be restored after we are done. This is needed to
|
||||||
|
" prevent an additional undo jump due to BufWritePre auto command and also
|
||||||
|
" restore 'redo' history because it's getting being destroyed every
|
||||||
|
" BufWritePre
|
||||||
|
let tmpundofile = tempname()
|
||||||
|
exe 'wundo! ' . tmpundofile
|
||||||
|
else
|
||||||
|
" Save cursor position and many other things.
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Save cursor position and many other things.
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
|
||||||
|
let bin_name = zig#config#FmtCommand()
|
||||||
|
|
||||||
|
" Get current position in file
|
||||||
|
let current_col = col('.')
|
||||||
|
let orig_line_count = line('$')
|
||||||
|
|
||||||
|
" Save current buffer first, else fmt will run on the original file and we
|
||||||
|
" will lose our changes.
|
||||||
|
silent! execute 'write' expand('%')
|
||||||
|
|
||||||
|
let [l:out, l:err] = zig#fmt#run(bin_name, expand('%'))
|
||||||
|
|
||||||
|
if l:err == 0
|
||||||
|
call zig#fmt#update_file(expand('%'))
|
||||||
|
elseif !zig#config#FmtFailSilently()
|
||||||
|
let errors = s:parse_errors(expand('%'), out)
|
||||||
|
call s:show_errors(errors)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let diff_offset = line('$') - orig_line_count
|
||||||
|
|
||||||
|
if zig#config#FmtExperimental()
|
||||||
|
" restore our undo history
|
||||||
|
silent! exe 'rundo ' . tmpundofile
|
||||||
|
call delete(tmpundofile)
|
||||||
|
|
||||||
|
" Restore our cursor/windows positions, folds, etc.
|
||||||
|
if empty(l:curw)
|
||||||
|
silent! loadview
|
||||||
|
else
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" Restore our cursor/windows positions.
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" be smart and jump to the line the new statement was added/removed
|
||||||
|
call cursor(line('.') + diff_offset, current_col)
|
||||||
|
|
||||||
|
" Syntax highlighting breaks less often.
|
||||||
|
syntax sync fromstart
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" update_file updates the target file with the given formatted source
|
||||||
|
function! zig#fmt#update_file(target)
|
||||||
|
" remove undo point caused via BufWritePre
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
|
||||||
|
" reload buffer to reflect latest changes
|
||||||
|
silent edit!
|
||||||
|
|
||||||
|
let l:listtype = zig#list#Type("ZigFmt")
|
||||||
|
|
||||||
|
" the title information was introduced with 7.4-2200
|
||||||
|
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||||
|
if has('patch-7.4.2200')
|
||||||
|
" clean up previous list
|
||||||
|
if l:listtype == "quickfix"
|
||||||
|
let l:list_title = getqflist({'title': 1})
|
||||||
|
else
|
||||||
|
let l:list_title = getloclist(0, {'title': 1})
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" can't check the title, so assume that the list was for go fmt.
|
||||||
|
let l:list_title = {'title': 'Format'}
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
|
||||||
|
call zig#list#Clean(l:listtype)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" run runs the gofmt/goimport command for the given source file and returns
|
||||||
|
" the output of the executed command. Target is the real file to be formatted.
|
||||||
|
function! zig#fmt#run(bin_name, target)
|
||||||
|
let l:cmd = []
|
||||||
|
call extend(cmd, a:bin_name)
|
||||||
|
call extend(cmd, [a:target])
|
||||||
|
return zig#util#Exec(l:cmd)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" parse_errors parses the given errors and returns a list of parsed errors
|
||||||
|
function! s:parse_errors(filename, content) abort
|
||||||
|
let splitted = split(a:content, '\n')
|
||||||
|
|
||||||
|
" list of errors to be put into location list
|
||||||
|
let errors = []
|
||||||
|
for line in splitted
|
||||||
|
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
|
||||||
|
if !empty(tokens)
|
||||||
|
call add(errors,{
|
||||||
|
\"filename": a:filename,
|
||||||
|
\"lnum": tokens[2],
|
||||||
|
\"col": tokens[3],
|
||||||
|
\"text": tokens[4],
|
||||||
|
\ })
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return errors
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" show_errors opens a location list and shows the given errors. If the given
|
||||||
|
" errors is empty, it closes the the location list
|
||||||
|
function! s:show_errors(errors) abort
|
||||||
|
let l:listtype = zig#list#Type("ZigFmt")
|
||||||
|
if !empty(a:errors)
|
||||||
|
call zig#list#Populate(l:listtype, a:errors, 'Format')
|
||||||
|
echohl Error | echomsg "zig fmt returned error" | echohl None
|
||||||
|
endif
|
||||||
|
|
||||||
|
" this closes the window if there are no errors or it opens
|
||||||
|
" it if there is any
|
||||||
|
call zig#list#Window(l:listtype, len(a:errors))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#fmt#ToggleFmtAutoSave() abort
|
||||||
|
if zig#config#FmtAutosave()
|
||||||
|
call zig#config#SetFmtAutosave(0)
|
||||||
|
call zig#util#EchoProgress("auto fmt disabled")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
call zig#config#SetFmtAutosave(1)
|
||||||
|
call zig#util#EchoProgress("auto fmt enabled")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
162
autoload/zig/list.vim
Normal file
162
autoload/zig/list.vim
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
|
||||||
|
" Adapted from fatih/vim-go: autoload/go/list.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
|
||||||
|
" Window opens the list with the given height up to 10 lines maximum.
|
||||||
|
" Otherwise g:zig_loclist_height is used.
|
||||||
|
"
|
||||||
|
" If no or zero height is given it closes the window by default.
|
||||||
|
" To prevent this, set g:zig_list_autoclose = 0
|
||||||
|
function! zig#list#Window(listtype, ...) abort
|
||||||
|
" we don't use lwindow to close the location list as we need also the
|
||||||
|
" ability to resize the window. So, we are going to use lopen and lclose
|
||||||
|
" for a better user experience. If the number of errors in a current
|
||||||
|
" location list increases/decreases, cwindow will not resize when a new
|
||||||
|
" updated height is passed. lopen in the other hand resizes the screen.
|
||||||
|
if !a:0 || a:1 == 0
|
||||||
|
call zig#list#Close(a:listtype)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let height = zig#config#ListHeight()
|
||||||
|
if height == 0
|
||||||
|
" prevent creating a large location height for a large set of numbers
|
||||||
|
if a:1 > 10
|
||||||
|
let height = 10
|
||||||
|
else
|
||||||
|
let height = a:1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
exe 'lopen ' . height
|
||||||
|
else
|
||||||
|
exe 'copen ' . height
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" Get returns the current items from the list
|
||||||
|
function! zig#list#Get(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
return getloclist(0)
|
||||||
|
else
|
||||||
|
return getqflist()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Populate populate the list with the given items
|
||||||
|
function! zig#list#Populate(listtype, items, title) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
call setloclist(0, a:items, 'r')
|
||||||
|
|
||||||
|
" The last argument ({what}) is introduced with 7.4.2200:
|
||||||
|
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||||
|
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||||
|
else
|
||||||
|
call setqflist(a:items, 'r')
|
||||||
|
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Parse parses the given items based on the specified errorformat and
|
||||||
|
" populates the list.
|
||||||
|
function! zig#list#ParseFormat(listtype, errformat, items, title) abort
|
||||||
|
" backup users errorformat, will be restored once we are finished
|
||||||
|
let old_errorformat = &errorformat
|
||||||
|
|
||||||
|
" parse and populate the location list
|
||||||
|
let &errorformat = a:errformat
|
||||||
|
try
|
||||||
|
call zig#list#Parse(a:listtype, a:items, a:title)
|
||||||
|
finally
|
||||||
|
"restore back
|
||||||
|
let &errorformat = old_errorformat
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Parse parses the given items based on the global errorformat and
|
||||||
|
" populates the list.
|
||||||
|
function! zig#list#Parse(listtype, items, title) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lgetexpr a:items
|
||||||
|
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||||
|
else
|
||||||
|
cgetexpr a:items
|
||||||
|
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" JumpToFirst jumps to the first item in the location list
|
||||||
|
function! zig#list#JumpToFirst(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
ll 1
|
||||||
|
else
|
||||||
|
cc 1
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Clean cleans and closes the location list
|
||||||
|
function! zig#list#Clean(listtype) abort
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lex []
|
||||||
|
else
|
||||||
|
cex []
|
||||||
|
endif
|
||||||
|
|
||||||
|
call zig#list#Close(a:listtype)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Close closes the location list
|
||||||
|
function! zig#list#Close(listtype) abort
|
||||||
|
let autoclose_window = zig#config#ListAutoclose()
|
||||||
|
if !autoclose_window
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:listtype == "locationlist"
|
||||||
|
lclose
|
||||||
|
else
|
||||||
|
cclose
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:listtype(listtype) abort
|
||||||
|
let listtype = zig#config#ListType()
|
||||||
|
if empty(listtype)
|
||||||
|
return a:listtype
|
||||||
|
endif
|
||||||
|
|
||||||
|
return listtype
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" s:default_list_type_commands is the defaults that will be used for each of
|
||||||
|
" the supported commands (see documentation for g:zig_list_type_commands). When
|
||||||
|
" defining a default, quickfix should be used if the command operates on
|
||||||
|
" multiple files, while locationlist should be used if the command operates on a
|
||||||
|
" single file or buffer. Keys that begin with an underscore are not supported
|
||||||
|
" in g:zig_list_type_commands.
|
||||||
|
let s:default_list_type_commands = {
|
||||||
|
\ "ZigFmt": "locationlist",
|
||||||
|
\ }
|
||||||
|
|
||||||
|
function! zig#list#Type(for) abort
|
||||||
|
let l:listtype = s:listtype(get(s:default_list_type_commands, a:for))
|
||||||
|
if l:listtype == "0"
|
||||||
|
call zig#util#EchoError(printf(
|
||||||
|
\ "unknown list type command value found ('%s'). Please open a bug report in the zig.vim repo.",
|
||||||
|
\ a:for))
|
||||||
|
let l:listtype = "quickfix"
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(zig#config#ListTypeCommands(), a:for, l:listtype)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
394
autoload/zig/util.vim
Normal file
394
autoload/zig/util.vim
Normal file
@@ -0,0 +1,394 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
|
||||||
|
" Adapted from vim-go: autoload/go/util.vim
|
||||||
|
"
|
||||||
|
" Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
" Use of this source code is governed by a BSD-style
|
||||||
|
" license that can be found in the LICENSE file.
|
||||||
|
"
|
||||||
|
|
||||||
|
" PathSep returns the appropriate OS specific path separator.
|
||||||
|
function! zig#util#PathSep() abort
|
||||||
|
if zig#util#IsWin()
|
||||||
|
return '\'
|
||||||
|
endif
|
||||||
|
return '/'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" PathListSep returns the appropriate OS specific path list separator.
|
||||||
|
function! zig#util#PathListSep() abort
|
||||||
|
if zig#util#IsWin()
|
||||||
|
return ";"
|
||||||
|
endif
|
||||||
|
return ":"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" LineEnding returns the correct line ending, based on the current fileformat
|
||||||
|
function! zig#util#LineEnding() abort
|
||||||
|
if &fileformat == 'dos'
|
||||||
|
return "\r\n"
|
||||||
|
elseif &fileformat == 'mac'
|
||||||
|
return "\r"
|
||||||
|
endif
|
||||||
|
|
||||||
|
return "\n"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Join joins any number of path elements into a single path, adding a
|
||||||
|
" Separator if necessary and returns the result
|
||||||
|
function! zig#util#Join(...) abort
|
||||||
|
return join(a:000, zig#util#PathSep())
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
||||||
|
function! zig#util#IsWin() abort
|
||||||
|
let win = ['win16', 'win32', 'win64', 'win95']
|
||||||
|
for w in win
|
||||||
|
if (has(w))
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" IsMac returns 1 if current OS is macOS or 0 otherwise.
|
||||||
|
function! zig#util#IsMac() abort
|
||||||
|
return has('mac') ||
|
||||||
|
\ has('macunix') ||
|
||||||
|
\ has('gui_macvim') ||
|
||||||
|
\ zig#util#Exec(['uname'])[0] =~? '^darwin'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Checks if using:
|
||||||
|
" 1) Windows system,
|
||||||
|
" 2) And has cygpath executable,
|
||||||
|
" 3) And uses *sh* as 'shell'
|
||||||
|
function! zig#util#IsUsingCygwinShell()
|
||||||
|
return zig#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if Vim jobs API is supported.
|
||||||
|
"
|
||||||
|
" The (optional) first paramter can be added to indicate the 'cwd' or 'env'
|
||||||
|
" parameters will be used, which wasn't added until a later version.
|
||||||
|
function! zig#util#has_job(...) abort
|
||||||
|
" cwd and env parameters to job_start was added in this version.
|
||||||
|
if a:0 > 0 && a:1 is 1
|
||||||
|
return has('job') && has("patch-8.0.0902")
|
||||||
|
endif
|
||||||
|
|
||||||
|
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
|
||||||
|
" of the latest is 8.0.0087 which is required for a stable async API.
|
||||||
|
return has('job') && has("patch-8.0.0087")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let s:env_cache = {}
|
||||||
|
|
||||||
|
" env returns the go environment variable for the given key. Where key can be
|
||||||
|
" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached
|
||||||
|
" version.
|
||||||
|
function! zig#util#env(key) abort
|
||||||
|
let l:key = tolower(a:key)
|
||||||
|
if has_key(s:env_cache, l:key)
|
||||||
|
return s:env_cache[l:key]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if executable('go')
|
||||||
|
let l:var = call('zig#util#'.l:key, [])
|
||||||
|
if zig#util#ShellError() != 0
|
||||||
|
call zig#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let l:var = eval("$".toupper(a:key))
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:env_cache[l:key] = l:var
|
||||||
|
return l:var
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Run a shell command.
|
||||||
|
"
|
||||||
|
" It will temporary set the shell to /bin/sh for Unix-like systems if possible,
|
||||||
|
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
|
||||||
|
" csh, fish, etc.) See #988 and #1276.
|
||||||
|
function! s:system(cmd, ...) abort
|
||||||
|
" Preserve original shell and shellredir values
|
||||||
|
let l:shell = &shell
|
||||||
|
let l:shellredir = &shellredir
|
||||||
|
|
||||||
|
if !zig#util#IsWin() && executable('/bin/sh')
|
||||||
|
set shell=/bin/sh shellredir=>%s\ 2>&1
|
||||||
|
endif
|
||||||
|
|
||||||
|
try
|
||||||
|
return call('system', [a:cmd] + a:000)
|
||||||
|
finally
|
||||||
|
" Restore original values
|
||||||
|
let &shell = l:shell
|
||||||
|
let &shellredir = l:shellredir
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" System runs a shell command "str". Every arguments after "str" is passed to
|
||||||
|
" stdin.
|
||||||
|
function! zig#util#System(str, ...) abort
|
||||||
|
return call('s:system', [a:str] + a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Exec runs a shell command "cmd", which must be a list, one argument per item.
|
||||||
|
" Every list entry will be automatically shell-escaped
|
||||||
|
" Every other argument is passed to stdin.
|
||||||
|
function! zig#util#Exec(cmd, ...) abort
|
||||||
|
if len(a:cmd) == 0
|
||||||
|
call zig#util#EchoError("zig#util#Exec() called with empty a:cmd")
|
||||||
|
return ['', 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:bin = a:cmd[0]
|
||||||
|
|
||||||
|
if !executable(l:bin)
|
||||||
|
call zig#util#EchoError(printf("could not find binary '%s'", a:cmd[0]))
|
||||||
|
return ['', 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return call('s:exec', [a:cmd] + a:000)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:exec(cmd, ...) abort
|
||||||
|
let l:bin = a:cmd[0]
|
||||||
|
let l:cmd = zig#util#Shelljoin([l:bin] + a:cmd[1:])
|
||||||
|
if zig#util#HasDebug('shell-commands')
|
||||||
|
call zig#util#EchoInfo('shell command: ' . l:cmd)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:out = call('s:system', [l:cmd] + a:000)
|
||||||
|
return [l:out, zig#util#ShellError()]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#util#ShellError() abort
|
||||||
|
return v:shell_error
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" StripPath strips the path's last character if it's a path separator.
|
||||||
|
" example: '/foo/bar/' -> '/foo/bar'
|
||||||
|
function! zig#util#StripPathSep(path) abort
|
||||||
|
let last_char = strlen(a:path) - 1
|
||||||
|
if a:path[last_char] == zig#util#PathSep()
|
||||||
|
return strpart(a:path, 0, last_char)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return a:path
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" StripTrailingSlash strips the trailing slash from the given path list.
|
||||||
|
" example: ['/foo/bar/'] -> ['/foo/bar']
|
||||||
|
function! zig#util#StripTrailingSlash(paths) abort
|
||||||
|
return map(copy(a:paths), 'zig#util#StripPathSep(v:val)')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Shelljoin returns a shell-safe string representation of arglist. The
|
||||||
|
" {special} argument of shellescape() may optionally be passed.
|
||||||
|
function! zig#util#Shelljoin(arglist, ...) abort
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
if a:0
|
||||||
|
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
fu! zig#util#Shellescape(arg)
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
return shellescape(a:arg)
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endf
|
||||||
|
|
||||||
|
" Shelllist returns a shell-safe representation of the items in the given
|
||||||
|
" arglist. The {special} argument of shellescape() may optionally be passed.
|
||||||
|
function! zig#util#Shelllist(arglist, ...) abort
|
||||||
|
try
|
||||||
|
let ssl_save = &shellslash
|
||||||
|
set noshellslash
|
||||||
|
if a:0
|
||||||
|
return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')')
|
||||||
|
endif
|
||||||
|
return map(copy(a:arglist), 'shellescape(v:val)')
|
||||||
|
finally
|
||||||
|
let &shellslash = ssl_save
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Returns the byte offset for line and column
|
||||||
|
function! zig#util#Offset(line, col) abort
|
||||||
|
if &encoding != 'utf-8'
|
||||||
|
let sep = zig#util#LineEnding()
|
||||||
|
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
|
||||||
|
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
|
||||||
|
return len(iconv(buf, &encoding, 'utf-8'))
|
||||||
|
endif
|
||||||
|
return line2byte(a:line) + (a:col-2)
|
||||||
|
endfunction
|
||||||
|
"
|
||||||
|
" Returns the byte offset for the cursor
|
||||||
|
function! zig#util#OffsetCursor() abort
|
||||||
|
return zig#util#Offset(line('.'), col('.'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Windo is like the built-in :windo, only it returns to the window the command
|
||||||
|
" was issued from
|
||||||
|
function! zig#util#Windo(command) abort
|
||||||
|
let s:currentWindow = winnr()
|
||||||
|
try
|
||||||
|
execute "windo " . a:command
|
||||||
|
finally
|
||||||
|
execute s:currentWindow. "wincmd w"
|
||||||
|
unlet s:currentWindow
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" snippetcase converts the given word to given preferred snippet setting type
|
||||||
|
" case.
|
||||||
|
function! zig#util#snippetcase(word) abort
|
||||||
|
let l:snippet_case = zig#config#AddtagsTransform()
|
||||||
|
if l:snippet_case == "snakecase"
|
||||||
|
return zig#util#snakecase(a:word)
|
||||||
|
elseif l:snippet_case == "camelcase"
|
||||||
|
return zig#util#camelcase(a:word)
|
||||||
|
else
|
||||||
|
return a:word " do nothing
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" snakecase converts a string to snake case. i.e: FooBar -> foo_bar
|
||||||
|
" Copied from tpope/vim-abolish
|
||||||
|
function! zig#util#snakecase(word) abort
|
||||||
|
let word = substitute(a:word, '::', '/', 'g')
|
||||||
|
let word = substitute(word, '\(\u\+\)\(\u\l\)', '\1_\2', 'g')
|
||||||
|
let word = substitute(word, '\(\l\|\d\)\(\u\)', '\1_\2', 'g')
|
||||||
|
let word = substitute(word, '[.-]', '_', 'g')
|
||||||
|
let word = tolower(word)
|
||||||
|
return word
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become
|
||||||
|
" fooBar.
|
||||||
|
" Copied from tpope/vim-abolish.
|
||||||
|
function! zig#util#camelcase(word) abort
|
||||||
|
let word = substitute(a:word, '-', '_', 'g')
|
||||||
|
if word !~# '_' && word =~# '\l'
|
||||||
|
return substitute(word, '^.', '\l&', '')
|
||||||
|
else
|
||||||
|
return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will
|
||||||
|
" become FooBar.
|
||||||
|
function! zig#util#pascalcase(word) abort
|
||||||
|
let word = zig#util#camelcase(a:word)
|
||||||
|
return toupper(word[0]) . word[1:]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Echo a message to the screen and highlight it with the group in a:hi.
|
||||||
|
"
|
||||||
|
" The message can be a list or string; every line with be :echomsg'd separately.
|
||||||
|
function! s:echo(msg, hi)
|
||||||
|
let l:msg = []
|
||||||
|
if type(a:msg) != type([])
|
||||||
|
let l:msg = split(a:msg, "\n")
|
||||||
|
else
|
||||||
|
let l:msg = a:msg
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Tabs display as ^I or <09>, so manually expand them.
|
||||||
|
let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")')
|
||||||
|
|
||||||
|
exe 'echohl ' . a:hi
|
||||||
|
for line in l:msg
|
||||||
|
echom "zig.vim: " . line
|
||||||
|
endfor
|
||||||
|
echohl None
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! zig#util#EchoSuccess(msg)
|
||||||
|
call s:echo(a:msg, 'Function')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoError(msg)
|
||||||
|
call s:echo(a:msg, 'ErrorMsg')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoWarning(msg)
|
||||||
|
call s:echo(a:msg, 'WarningMsg')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoProgress(msg)
|
||||||
|
redraw
|
||||||
|
call s:echo(a:msg, 'Identifier')
|
||||||
|
endfunction
|
||||||
|
function! zig#util#EchoInfo(msg)
|
||||||
|
call s:echo(a:msg, 'Debug')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get all lines in the buffer as a a list.
|
||||||
|
function! zig#util#GetLines()
|
||||||
|
let buf = getline(1, '$')
|
||||||
|
if &encoding != 'utf-8'
|
||||||
|
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
|
||||||
|
endif
|
||||||
|
if &l:fileformat == 'dos'
|
||||||
|
" XXX: line2byte() depend on 'fileformat' option.
|
||||||
|
" so if fileformat is 'dos', 'buf' must include '\r'.
|
||||||
|
let buf = map(buf, 'v:val."\r"')
|
||||||
|
endif
|
||||||
|
return buf
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Make a named temporary directory which starts with "prefix".
|
||||||
|
"
|
||||||
|
" Unfortunately Vim's tempname() is not portable enough across various systems;
|
||||||
|
" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911
|
||||||
|
function! zig#util#tempdir(prefix) abort
|
||||||
|
" See :help tempfile
|
||||||
|
if zig#util#IsWin()
|
||||||
|
let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp']
|
||||||
|
else
|
||||||
|
let l:dirs = [$TMPDIR, '/tmp', './', $HOME]
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:dir = ''
|
||||||
|
for l:d in dirs
|
||||||
|
if !empty(l:d) && filewritable(l:d) == 2
|
||||||
|
let l:dir = l:d
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
if l:dir == ''
|
||||||
|
call zig#util#EchoError('Unable to find directory to store temporary directory in')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Not great randomness, but "good enough" for our purpose here.
|
||||||
|
let l:rnd = sha256(printf('%s%s', localtime(), fnamemodify(bufname(''), ":p")))
|
||||||
|
let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd)
|
||||||
|
call mkdir(l:tmp, 'p', 0700)
|
||||||
|
return l:tmp
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Report if the user enabled a debug flag in g:zig_debug.
|
||||||
|
function! zig#util#HasDebug(flag)
|
||||||
|
return index(zig#config#Debug(), a:flag) >= 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
|
endif
|
||||||
50
build
50
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=""
|
||||||
|
|
||||||
@@ -25,8 +25,10 @@ download() {
|
|||||||
for pack in $1; do
|
for pack in $1; do
|
||||||
path="$(cut -d ':' -f 2 <<<"$pack")"
|
path="$(cut -d ':' -f 2 <<<"$pack")"
|
||||||
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
||||||
|
repo="$(awk -F\# '{print $1}' <<<"$path")"
|
||||||
|
branch="$(awk -F\# '{print $2}' <<<"$path")"
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
(mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$path/tar.gz/master" | tar -zx -C "$dir" --strip 1 && printf '.') &
|
(mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$repo/tar.gz/${branch:-master}" | tar -zx -C "$dir" --strip 1 && printf '.') &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
@@ -125,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++
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
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"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update_readme() {
|
update_readme() {
|
||||||
@@ -176,6 +182,8 @@ 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
|
||||||
dockerfile:ekalinin/Dockerfile.vim
|
dockerfile:ekalinin/Dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
elm:ElmCast/elm-vim
|
elm:ElmCast/elm-vim
|
||||||
@@ -183,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
|
||||||
@@ -191,8 +199,8 @@ 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
|
||||||
graphql:jparise/vim-graphql
|
|
||||||
groovy:vim-scripts/groovy.vim
|
groovy:vim-scripts/groovy.vim
|
||||||
groovy-indent:vim-scripts/groovyindent-unix
|
groovy-indent:vim-scripts/groovyindent-unix
|
||||||
haml:sheerun/vim-haml
|
haml:sheerun/vim-haml
|
||||||
@@ -200,9 +208,13 @@ PACKS="
|
|||||||
haproxy:CH-DanReif/haproxy.vim
|
haproxy:CH-DanReif/haproxy.vim
|
||||||
haskell:neovimhaskell/haskell-vim
|
haskell:neovimhaskell/haskell-vim
|
||||||
haxe:yaymukund/vim-haxe
|
haxe:yaymukund/vim-haxe
|
||||||
|
hcl:b4b4r07/vim-hcl
|
||||||
|
helm:towolf/vim-helm
|
||||||
|
hive:zebradil/hive.vim
|
||||||
html5:othree/html5.vim
|
html5:othree/html5.vim
|
||||||
i3:mboughaba/i3config.vim
|
i3:mboughaba/i3config.vim
|
||||||
idris:idris-hackers/idris-vim
|
idris:idris-hackers/idris-vim
|
||||||
|
ion:vmchale/ion-vim
|
||||||
jasmine:glanotte/vim-jasmine
|
jasmine:glanotte/vim-jasmine
|
||||||
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
||||||
jenkins:martinda/Jenkinsfile-vim-syntax
|
jenkins:martinda/Jenkinsfile-vim-syntax
|
||||||
@@ -210,18 +222,19 @@ PACKS="
|
|||||||
json5:GutenYe/json5.vim
|
json5:GutenYe/json5.vim
|
||||||
json:elzr/vim-json
|
json:elzr/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
jsx:amadeus/vim-jsx
|
jsx:MaxMEllon/vim-jsx-pretty:_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
|
||||||
less:groenewege/vim-less:_NOAFTER
|
less:groenewege/vim-less:_NOAFTER
|
||||||
liquid:tpope/vim-liquid
|
|
||||||
lilypond:anowlcalledjosh/vim-lilypond
|
lilypond:anowlcalledjosh/vim-lilypond
|
||||||
livescript:gkz/vim-ls
|
livescript:gkz/vim-ls
|
||||||
|
llvm:rhysd/vim-llvm
|
||||||
|
log:MTDL9/vim-log-highlighting
|
||||||
lua:tbastos/vim-lua
|
lua:tbastos/vim-lua
|
||||||
mako:sophacles/vim-bundle-mako
|
mako:sophacles/vim-bundle-mako
|
||||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||||
mathematica:rsmenon/vim-mathematica
|
mathematica:voldikss/vim-mma
|
||||||
mdx:jxnblk/vim-mdx-js
|
mdx:jxnblk/vim-mdx-js
|
||||||
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
||||||
moonscript:leafo/moonscript-vim
|
moonscript:leafo/moonscript-vim
|
||||||
@@ -230,24 +243,24 @@ 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:exu/pgsql.vim
|
pgsql:lifepillar/pgsql.vim
|
||||||
php:StanAngeloff/php.vim
|
php:StanAngeloff/php.vim
|
||||||
plantuml:aklt/plantuml-syntax
|
plantuml:aklt/plantuml-syntax
|
||||||
pony:jakwings/vim-pony
|
pony:jakwings/vim-pony
|
||||||
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
|
||||||
@@ -264,27 +277,34 @@ PACKS="
|
|||||||
smt2:bohlender/vim-smt2
|
smt2:bohlender/vim-smt2
|
||||||
solidity:tomlion/vim-solidity
|
solidity:tomlion/vim-solidity
|
||||||
stylus:wavded/vim-stylus
|
stylus:wavded/vim-stylus
|
||||||
|
svelte:evanleck/vim-svelte
|
||||||
|
svg-indent:jasonshell/vim-svg-indent
|
||||||
|
svg:vim-scripts/svg.vim
|
||||||
swift:keith/swift.vim
|
swift:keith/swift.vim
|
||||||
sxhkd:baskerville/vim-sxhkdrc
|
sxhkd:baskerville/vim-sxhkdrc
|
||||||
systemd:wgwoods/vim-systemd-syntax
|
systemd:wgwoods/vim-systemd-syntax
|
||||||
terraform:hashivim/vim-terraform
|
terraform:hashivim/vim-terraform
|
||||||
textile:timcharper/textile.vim
|
textile:timcharper/textile.vim
|
||||||
thrift:solarnz/thrift.vim
|
thrift:solarnz/thrift.vim
|
||||||
tmux:keith/tmux.vim
|
tmux:ericpruitt/tmux.vim:_ALL:/vim/
|
||||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
|
tptp:c-cube/vim-tptp
|
||||||
twig:lumiliet/vim-twig
|
twig:lumiliet/vim-twig
|
||||||
typescript:leafgarland/typescript-vim
|
typescript: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
|
||||||
vifm:vifm/vifm.vim
|
vifm:vifm/vifm.vim
|
||||||
vm:lepture/vim-velocity
|
vm:lepture/vim-velocity
|
||||||
vue:posva/vim-vue
|
vue:posva/vim-vue
|
||||||
|
xdc:amal-khailtash/vim-xdc-syntax
|
||||||
xml:amadeus/vim-xml
|
xml:amadeus/vim-xml
|
||||||
xls:vim-scripts/XSLT-syntax
|
xls:vim-scripts/XSLT-syntax
|
||||||
yaml:stephpy/vim-yaml
|
yaml:stephpy/vim-yaml
|
||||||
yard:sheerun/vim-yardoc
|
yard:sheerun/vim-yardoc
|
||||||
|
zephir:xwsoul/vim-zephir
|
||||||
|
zig:ziglang/zig.vim
|
||||||
"
|
"
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user