Compare commits

...

84 Commits

Author SHA1 Message Date
Adam Stankiewicz
34eb36e6d1 Fix tmux plugin 2019-09-06 14:49:10 +02:00
Adam Stankiewicz
84ec4eedcd Switch typescript provider, closes #428 2019-09-06 14:32:07 +02:00
Adam Stankiewicz
66b769328c Update 2019-09-06 14:25:42 +02:00
Adam Stankiewicz
ae18284e5a Disable jsx when ts or js is disabled, closes #414 2019-09-04 17:39:23 +02:00
Adam Stankiewicz
e3024f21fc Fix build script 2019-09-04 17:01:29 +02:00
Adam Stankiewicz
31d757fc7b Update 2019-09-04 16:50:13 +02:00
Adam Stankiewicz
556c56d185 Add graphql support, closes #298 2019-09-04 16:29:56 +02:00
Adam Stankiewicz
fe84062992 Include missing file from styledcomponents, fixes #418 2019-09-04 16:25:08 +02:00
Adam Stankiewicz
8742443e69 Remove advanced stuff from r plugin, fixes #420 2019-09-04 16:08:22 +02:00
Adam Stankiewicz
832dfece76 Add dhall, closes #426 2019-09-04 16:06:18 +02:00
Adam Stankiewicz
933e42ea1f Change provider for puppet, closes #424 2019-09-04 16:04:21 +02:00
Adam Stankiewicz
cdd6d73e39 Switch fish provider, fixes #408 2019-09-04 15:55:58 +02:00
Adam Stankiewicz
a48874df4c Update elixir filedetect, closes #421 2019-09-04 15:53:42 +02:00
Adam Stankiewicz
21849c2e18 Add helm syntax, closes #422 2019-09-04 15:45:55 +02:00
Adam Stankiewicz
664aa988f6 Update 2019-09-04 15:44:43 +02:00
Adam Stankiewicz
3ddca5da46 Remove rego, fixes #415 2019-07-01 16:26:25 +02:00
Adam Stankiewicz
140430ffb7 Update 2019-07-01 16:25:37 +02:00
Adam Stankiewicz
d527002849 Update 2019-06-16 18:36:23 +02:00
Adam Stankiewicz
15727e7eb0 Add zephir support 2019-06-14 16:11:54 +02:00
Adam Stankiewicz
6b169212f8 Add svelte support, closes #410 2019-06-14 16:07:20 +02:00
Adam Stankiewicz
2edc785a5e Make typescript.tsx default filetype for tsx, fixes #409 2019-06-09 00:08:31 +02:00
Adam Stankiewicz
445e026010 Add styled-components, closes #407 2019-06-08 14:12:14 +02:00
Adam Stankiewicz
fca45b2c2b Add rego support, closes #406 2019-06-08 13:36:13 +02:00
Adam Stankiewicz
ebf9ec9d62 Add zig support, closes #405 2019-06-08 13:34:40 +02:00
Adam Stankiewicz
9caa678708 Add ion shell support, closes #404 2019-06-08 13:33:25 +02:00
Adam Stankiewicz
8f2a71643a Add hcl support, closes #403 2019-06-08 13:32:04 +02:00
Adam Stankiewicz
af763ef221 Change tmux provider, closes #402 2019-06-08 13:29:23 +02:00
Adam Stankiewicz
5ded0682bd Add dlang support, closes #401 2019-06-08 13:28:47 +02:00
Adam Stankiewicz
26c678b08d Change jsx/tsx provider, closes #400 2019-06-08 13:25:41 +02:00
Adam Stankiewicz
17ecfbdabc Add s:setf helper, fixes #399 2019-06-08 13:14:56 +02:00
Adam Stankiewicz
0217fb50fe Add tsx provider, closes #330 2019-06-08 13:03:32 +02:00
Adam Stankiewicz
5023da62ec Add hive syntax, closes #396 2019-06-08 12:50:29 +02:00
Adam Stankiewicz
957228cc25 Add log syntax, closes #394 2019-06-08 12:48:22 +02:00
Adam Stankiewicz
7aae831309 Add tptp syntax 2019-06-08 12:46:43 +02:00
Adam Stankiewicz
671078ef6c Update 2019-06-08 12:44:15 +02:00
Adam Stankiewicz
aebef2c2e7 Update 2019-05-07 16:17:56 +02:00
German Lashevich
e8245dbf17 FIx CI build freezing (#398)
* Kill vim server

* Fix incorrect usage of rspec

* Add build stage to CI

* Try using new server for each run

* Sort and uniq test files
2019-05-01 23:52:54 +02:00
Adam Stankiewicz
9fd5c11a20 Remove liquid syntax, closes #384 2019-04-23 11:49:34 +02:00
Adam Stankiewicz
679ccf0303 Change pgsql provider, closes #391 2019-04-23 11:46:52 +02:00
Adam Stankiewicz
eacf785f5a Add svg plugin, closes #388 2019-04-23 11:43:40 +02:00
Adam Stankiewicz
83bd298476 Add xdc syntax, closes #393 2019-04-23 11:38:41 +02:00
Adam Stankiewicz
415261dd1f Switch mathematica provider, closes #385 2019-04-23 11:37:21 +02:00
Adam Stankiewicz
4d18a5e5dd Update 2019-04-23 11:32:40 +02:00
Adam Stankiewicz
a55b6aa3aa Remove grapqhl, fixes #387 2019-03-29 20:30:36 +01:00
Adam Stankiewicz
1d45a6d4f0 Update readme 2019-03-11 09:22:40 +01:00
Adam Stankiewicz
420a65e9b0 Add llvm support, closes #376 2019-03-11 09:20:36 +01:00
Adam Stankiewicz
2254b83675 Update logo 2019-03-10 22:52:10 +01:00
Adam Stankiewicz
12755e3583 Add logo 2019-03-10 22:49:59 +01:00
Adam Stankiewicz
cbad6b1e0a Update issue templates 2019-03-10 22:37:36 +01:00
Adam Stankiewicz
fabb550c17 Reuse server for tests 2019-03-10 21:23:30 +01:00
Adam Stankiewicz
9d9ed14485 Add ACPI ASL and SMT2 support
closes #379
closes #378
2019-03-10 21:22:06 +01:00
Adam Stankiewicz
5005f1e27a Add csv plugin, closes #239 2019-03-10 21:16:48 +01:00
Adam Stankiewicz
571f76e6b6 Remove rare html extensions, fixes #280 2019-03-10 20:14:21 +01:00
Adam Stankiewicz
e4f906d9a5 Fix specs 2019-03-10 19:42:33 +01:00
Adam Stankiewicz
8b3a563bd0 Fix regexp 2019-03-10 19:11:11 +01:00
Adam Stankiewicz
0475f2b8d1 Fix test extensions 2019-03-10 18:49:28 +01:00
Adam Stankiewicz
1d9a032a66 Update timeout and ruby version 2019-03-10 18:46:17 +01:00
Adam Stankiewicz
86721731c7 Add lilypond support, closes #278 2019-03-05 09:34:59 +01:00
Adam Stankiewicz
6f7257ade2 Use upstreadm mdx ftdetect 2019-03-04 17:55:31 +01:00
Adam Stankiewicz
25ed6ff970 Reintroduce mdx 2019-03-04 17:53:21 +01:00
Adam Stankiewicz
521220f389 Change ocaml provider, closes #320 2019-03-04 12:09:44 +01:00
Adam Stankiewicz
b4cb58661e Add tsx support, fixes #330 2019-03-04 11:46:48 +01:00
Adam Stankiewicz
ebf81f7369 Fix spelling errors, closes #334 2019-03-04 11:35:21 +01:00
Adam Stankiewicz
b69fbad1af Add mdx support, closes #342 2019-03-04 11:33:35 +01:00
Adam Stankiewicz
fc272a0aa2 Revert llvm support (takes too long to download) 2019-03-04 11:11:01 +01:00
dv
65f090faef Add LLVM support (#376) 2019-03-04 11:05:07 +01:00
Adam Stankiewicz
58f9b8cd02 Proper casing for Dockerfile, fixes #361 2019-03-04 11:00:45 +01:00
Adam Stankiewicz
1ba88cc7d8 Add gradle compiler support, closes #358 2019-03-04 10:57:25 +01:00
Adam Stankiewicz
ca2fbfe038 Update vimrunner 2019-03-04 10:51:48 +01:00
Adam Stankiewicz
b06535a1c6 Update maintenance badge 2019-03-04 10:48:32 +01:00
Adam Stankiewicz
2c59360e01 Switch jsx provider to amadeus, closes #364 2019-03-04 10:46:19 +01:00
Adam Stankiewicz
4f0bde6d67 Add flatbuffers support, closes #368 2019-03-04 10:35:44 +01:00
Adam Stankiewicz
833b2fadd5 Add quake support, closes #372 2019-03-04 10:32:24 +01:00
Adam Stankiewicz
efa1a55dc7 Add meson support 2019-03-04 10:29:18 +01:00
Adam Stankiewicz
63922a1d1e Add idris support, closes #265 2019-03-04 10:14:37 +01:00
Adam Stankiewicz
0cd0b7f894 Add reason support, closes #266 2019-03-04 10:09:33 +01:00
Adam Stankiewicz
ec5884b1d0 Add jinja support, closes #269 2019-03-04 09:52:59 +01:00
Adam Stankiewicz
92f779dc77 Add groovy indent support, closes #324 2019-03-04 09:38:52 +01:00
Adam Stankiewicz
9d887c4b38 Add indent support for groovy 2019-03-04 09:38:12 +01:00
Adam Stankiewicz
edfcded9fd Add cuesheet support, closes #366 2019-03-04 09:37:07 +01:00
Adam Stankiewicz
c39dff0b10 Sort packs, closes #367 2019-03-04 09:34:05 +01:00
Adam Stankiewicz
288b0d2423 Remove orgmode plugin, #360 2019-03-04 09:30:55 +01:00
Adam Stankiewicz
1597b7b766 Change plugin guard for disabling, fixes #371 2019-03-04 09:28:35 +01:00
Adam Stankiewicz
ed677c34d5 Update 2019-03-04 09:15:44 +01:00
595 changed files with 29085 additions and 9333 deletions

18
.github/ISSUE_TEMPLATE/add-language.md vendored Normal file
View 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)**

View 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
View 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:**

View File

@@ -1,12 +1,11 @@
language: ruby language: ruby
rvm: rvm:
- 1.9.3 - 2.6
sudo: false sudo: false
addons: addons:
apt: apt:
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

View File

@@ -1,16 +1,21 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
diff-lcs (1.1.3) diff-lcs (1.3)
rspec (2.12.0) rspec (3.8.0)
rspec-core (~> 2.12.0) rspec-core (~> 3.8.0)
rspec-expectations (~> 2.12.0) rspec-expectations (~> 3.8.0)
rspec-mocks (~> 2.12.0) rspec-mocks (~> 3.8.0)
rspec-core (2.12.2) rspec-core (3.8.0)
rspec-expectations (2.12.1) rspec-support (~> 3.8.0)
diff-lcs (~> 1.1.3) rspec-expectations (3.8.2)
rspec-mocks (2.12.0) diff-lcs (>= 1.2.0, < 2.0)
vimrunner (0.3.0) rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
vimrunner (0.3.4)
PLATFORMS PLATFORMS
ruby ruby
@@ -18,3 +23,6 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
rspec rspec
vimrunner vimrunner
BUNDLED WITH
1.16.2

View File

@@ -1,4 +1,6 @@
# vim-polyglot [![Build Status][travis-img-url]][travis-url] [![Maintenance](https://img.shields.io/maintenance/yes/2018.svg?maxAge=2592000)]() ![vim-polyglot](https://i.imgur.com/9RxQK6k.png)
[![Build Status][travis-img-url]][travis-url] [![Maintenance](https://img.shields.io/maintenance/yes/2019.svg?maxAge=2592000)]()
[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-->118<!--/Package Count--> packages it consists of. - It **installs and updates 120+ times faster** than the <!--Package Count-->147<!--/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`).
@@ -43,6 +45,7 @@ If you need full functionality of any plugin, please use it directly with your p
## Language packs ## Language packs
<!--Language Packs--> <!--Language Packs-->
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl) (syntax)
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin) - [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin)
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax) - [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax)
- [applescript](https://github.com/mityu/vim-applescript) (syntax, indent) - [applescript](https://github.com/mityu/vim-applescript) (syntax, indent)
@@ -57,12 +60,16 @@ If you need full functionality of any plugin, please use it directly with your p
- [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin) - [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin)
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin) - [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin)
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (syntax, indent) - [cmake](https://github.com/pboettch/vim-cmake-syntax) (syntax, indent)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, compiler, indent, autoload, ftplugin)
- [cql](https://github.com/elubow/cql-vim) (syntax) - [cql](https://github.com/elubow/cql-vim) (syntax)
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin) - [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, compiler, ftplugin)
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin) - [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin)
- [csv](https://github.com/chrisbra/csv.vim) (syntax, autoload, ftplugin)
- [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)
- [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)
@@ -70,97 +77,121 @@ 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)
- [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)
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent) - [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent)
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax) - [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
- [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)
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, ftplugin) - [gradle](https://github.com/tfnico/vim-gradle) (compiler)
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after)
- [groovy-indent](https://github.com/vim-scripts/groovyindent-unix) (indent)
- [groovy](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)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin) - [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin)
- [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)
- [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)
- [jinja](https://github.com/lepture/vim-jinja) (syntax, indent)
- [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/mxw/vim-jsx) (after) - [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, syntax, indent, ftplugin)
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin) - [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent) - [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)
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin) - [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, 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)
- [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)
- [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin) - [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin)
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent)
- [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/jrk/vim-ocaml) (syntax, indent, 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/vim-scripts/octave.vim--) (syntax)
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin) - [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
- [org](https://github.com/jceb/vim-orgmode) (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-ident](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)
- [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)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax) - [rspec](https://github.com/sheerun/rspec.vim) (syntax)
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin) - [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin) - [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin) - [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax) - [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin) - [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, autoload, ftplugin) - [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin) - [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent) - [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin) - [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
- [styled-components](https://github.com/styled-components/vim-styled-components#main) (after)
- [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)
- [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)
- [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

View File

@@ -0,0 +1,21 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
" Vim completion script
" Language: styled-components (js/ts)
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
" URL: https://github.com/styled-components/vim-styled-components
fun! styledcomplete#CompleteSC(findstart, base)
if IsStyledDefinition(line('.'))
return csscomplete#CompleteCSS(a:findstart, a:base)
endif
" Only trigger original omnifunc if it was set in the first place
if exists('b:prevofu')
" create a funcref to call with the previous omnicomplete function
let s:funcref = function(b:prevofu)
return s:funcref(a:findstart, a:base)
endif
endfun

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

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

@@ -0,0 +1,5 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'idris') != -1
finish
endif
setlocal iskeyword+='

View File

@@ -1,5 +1,7 @@
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
" Maintainer: vim-javascript community " Maintainer: vim-javascript community
@@ -12,5 +14,79 @@ if exists('b:undo_ftplugin')
else else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<' let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif endif
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftplugin file
"
" Language: javascript.jsx
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:original_commentstring = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
augroup end
setlocal suffixesadd+=.jsx
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
" Vim filetype plugin file
" Language: styled-components (js/ts)
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
" URL: https://github.com/styled-components/vim-styled-components
fu! s:GetSyntaxNames(lnum, cnum)
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
endfu
" re-implement SynSOL of vim-jsx
fu! s:SynSOL(lnum)
return s:GetSyntaxNames(a:lnum, 1)
endfu
"" Return whether the current line is a jsTemplateString
fu! IsStyledDefinition(lnum)
" iterate through all syntax items in the given line
for item in s:SynSOL(a:lnum)
" if syntax-item is a jsTemplateString return 1 - true
" `==#` is a match case comparison of the item
if item ==# 'styledDefinition'
return 1
endif
endfor
" fallback to 0 - false
return 0
endfu
if exists('&ofu')
if &ofu
" Do not keep track of previous omnifunc if it was not set in the first
" place
let b:prevofu=&ofu
endif
setl omnifunc=styledcomplete#CompleteSC
endif endif

View File

@@ -1,23 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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 = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_words = exists('b:match_words')
\ ? b:match_words . ',' . s:jsx_match_words
\ : s:jsx_match_words
endif
setlocal suffixesadd+=.jsx
endif

477
after/ftplugin/llvm.vim Normal file
View File

@@ -0,0 +1,477 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'llvm') != -1
finish
endif
" 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

View File

@@ -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()
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 endif

View File

@@ -1,85 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
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
endif

View File

@@ -0,0 +1,31 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
" modified from html.vim
" For matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '(:),\[:\],{:},<:>,' .
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
endif
" For andymass/vim-matchup plugin
if exists("loaded_matchup")
setlocal matchpairs=(:),{:},[:],<:>
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
let b:match_skip = 's:comment\|string'
endif
let b:original_commentstring = &l:commentstring
augroup jsx_comment
autocmd! CursorMoved <buffer>
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:original_commentstring)
augroup end
setlocal suffixesadd+=.tsx
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif

View File

@@ -1,5 +1,7 @@
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
" Author: Henrique Barcelos " Author: Henrique Barcelos
@@ -7,5 +9,3 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
" 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

View File

@@ -1,37 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
" Language: CoffeeScript
" Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
" Load the coffee and html indent functions.
silent! unlet b:did_indent
runtime indent/coffee.vim
let s:coffeeIndentExpr = &l:indentexpr
" Load html last so it can overwrite coffee settings.
silent! unlet b:did_indent
runtime indent/html.vim
let s:htmlIndentExpr = &l:indentexpr
" Inject our wrapper indent function.
setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum)
function! GetCoffeeHtmlIndent(curlinenum)
" See if we're inside a coffeescript block.
let scriptlnum = searchpair('<script [^>]*type=[''"]\?text/coffeescript[''"]\?[^>]*>', '',
\ '</script>', 'bWn')
let prevlnum = prevnonblank(a:curlinenum)
" If we're in the script block and the previous line isn't the script tag
" itself, use coffee indenting.
if scriptlnum && scriptlnum != prevlnum
exec 'return ' s:coffeeIndentExpr
endif
" Otherwise use html indenting.
exec 'return ' s:htmlIndentExpr
endfunction
endif

206
after/indent/javascript.vim Normal file
View File

@@ -0,0 +1,206 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif
let s:keepcpo = &cpo
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
" Vim syntax file
" Language: styled-components (js/ts)
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
" URL: https://github.com/styled-components/vim-styled-components
" initialize variable to check, if the indentation expression is run
" multiple times in a row, which indicates an infinite recursion
let s:is_recursion = 0
" store current indentexpr for later
let b:js_ts_indent=&indentexpr
" set indentexpr for this filetype (styled-components)
setlocal indentexpr=GetStyledIndent()
" add the following keys to trigger reindenting, when in insert mode
" - *; - Indent and insert on press of ';' key.
" - *<:> - Indent and insert on press of ':' key.
set indentkeys+=*;,*<:>,*<Return>
fu! s:GetSyntaxNames(lnum, cnum)
return map(synstack(a:lnum, a:cnum), 'synIDattr(v:val, "name")')
endfu
" re-implement SynSOL of vim-jsx
" TODO: add dependency to the readme and remove duplicate implementation
fu! s:SynSOL(lnum)
return s:GetSyntaxNames(a:lnum, 1)
endfu
" re-implement SynEOL of vim-jsx
" TODO: add dependency to the readme and remove duplicate implementation
fu! s:SynEOL(lnum, offset)
let l:lnum = prevnonblank(a:lnum)
let l:col = strlen(getline(l:lnum))
return s:GetSyntaxNames(l:lnum, l:col + a:offset)
endfu
"" Return whether the current line is a jsTemplateString
fu! s:IsStyledDefinition(lnum)
" iterate through all syntax items in the given line
for item in s:SynSOL(a:lnum)
" if syntax-item is a jsTemplateString return 1 - true
" `==#` is a match case comparison of the item
if item ==# 'styledDefinition'
return 1
endif
endfor
" fallback to 0 - false
return 0
endfu
"" Count occurences of `str` at the beginning of the given `lnum` line
fu! s:CountOccurencesInSOL(lnum, str)
let l:occurence = 0
" iterate through all items in the given line
for item in s:SynSOL(a:lnum)
" if the syntax-item equals the given str increment the counter
" `==?` is a case isensitive equal operation
if item ==? a:str
let l:occurence += 1
endif
endfor
" return the accumulated count of occurences
return l:occurence
endfu
"" Count occurences of `str` at the end of the given `lnum` line
fu! s:CountOccurencesInEOL(lnum, str, offset)
let l:occurence = 0
" iterate through all items in the given line
for item in s:SynEOL(a:lnum, a:offset)
" if the syntax-item equals the given str increment the counter
" `==?` is a case insensitive equal operation
if item == a:str
let l:occurence += 1
endif
endfor
" return the accumulated count of occurences
return l:occurence
endfu
"" Get the indentation of the current line
fu! GetStyledIndent()
if s:IsStyledDefinition(v:lnum)
let l:baseIndent = 0
" find last non-styled line
let l:cnum = v:lnum
while s:IsStyledDefinition(l:cnum)
let l:cnum -= 1
endwhile
" get indentation of the last non-styled line as base indentation
let l:baseIndent = indent(l:cnum)
" incrementally build indentation based on current indentation
" - one shiftwidth for the styled definition region
" - one shiftwidth per open nested definition region
let l:styledIndent = &sw
let l:styledIndent += min([
\ s:CountOccurencesInSOL(v:lnum, 'styledNestedRegion'),
\ s:CountOccurencesInEOL(v:lnum, 'styledNestedRegion', 0)
\ ]) * &sw
" decrease indentation by one shiftwidth, if the styled definition
" region ends on the current line
" - either directly via styled definition region, or
" - if the very last
if s:CountOccurencesInEOL(v:lnum, 'styledDefinition', 1) == 0
let l:styledIndent -= &sw
endif
" return the base indentation
" (for nested styles inside classes/objects/etc.) plus the actual
" indentation inside the styled definition region
return l:baseIndent + l:styledIndent
elseif len(b:js_ts_indent)
let l:result = 0
let l:offset = 0
" increase indentation by one shiftwidth, if the last line ended on a
" styledXmlRegion and this line does not continue with it
" this is a fix for an incorrectly indented xml prop after a
" glamor-styled styledXmlRegion
if s:CountOccurencesInEOL(v:lnum-1, 'styledXmlRegion', 0) == 1 &&
\ s:CountOccurencesInSOL(v:lnum, 'styledXmlRegion') == 0
let l:offset = &sw
endif
" make sure `GetStyledIndent` and `GetJsxIndent` don't infinitely
" recurse by incrementing a counter variable, before evaluating the
" stored indent expression
if s:is_recursion == 0
let s:is_recursion = 1
let l:result = eval(b:js_ts_indent)
endif
" `is_recursion` being 0 at this point indicates, that
" `eval(b:js_ts_indent)` did itself evaluate it's stored indentexpr
" and thus it can be assumed, that the current line should be
" indented as JS
if s:is_recursion == 0
" use one of `GetJavascriptIndent` or `GetJsIndent` if existing
" fallback to cindent, if not
if exists('*GetJavascriptIndent')
let l:result = GetJavascriptIndent()
elseif exists('*GetJsIndent')
let l:result = GetJsIndent()
else
let l:result = cindent(v:lnum)
endif
endif
" reset `is_recursion` counter and return the indentation value
let s:is_recursion = 0
return l:result + l:offset
endif
" if all else fails indent according to C-syntax
return cindent(v:lnum)
endfu

View File

@@ -1,118 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1 if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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 endif
setlocal indentexpr=GetJsxIndent() runtime! indent/javascript.vim
" 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
endif

View File

@@ -1,5 +1,7 @@
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
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com> " Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
@@ -93,5 +95,3 @@ 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

View File

@@ -0,0 +1,39 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim indent file
"
" Language: typescript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
" Depends: leafgarland/typescript-vim
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if exists('b:did_indent')
let s:did_indent = b:did_indent
unlet b:did_indent
endif
let s:keepcpo = &cpo
set cpo&vim
if exists('s:did_indent')
let b:did_indent = s:did_indent
endif
setlocal indentexpr=GetJsxIndent()
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
function! GetJsxIndent()
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
runtime! indent/javascript.vim

View File

@@ -1,5 +1,7 @@
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>
@@ -304,5 +306,3 @@ 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

View File

@@ -1,5 +1,7 @@
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
unlet b:current_syntax unlet b:current_syntax
@@ -27,5 +29,3 @@ 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

View File

@@ -1,10 +1,12 @@
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.
@@ -962,6 +964,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
@@ -1981,6 +1989,9 @@ endif " C++17
if !exists("cpp_no_cpp20") if !exists("cpp_no_cpp20")
" type_traits " type_traits
syntax keyword cppSTLtype remove_cvref remove_cvref_t syntax keyword cppSTLtype remove_cvref remove_cvref_t
syntax keyword cppType char8_t
syntax keyword cppStatement co_yield co_return co_await
syntax keyword cppStorageClass consteval
endif endif
@@ -2092,5 +2103,3 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppRawDelimiter Delimiter HiLink cppRawDelimiter Delimiter
delcommand HiLink delcommand HiLink
endif endif
endif

View File

@@ -1,27 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
" Language: CoffeeScript
" Maintainer: Sven Felix Oberquelle <Svelix.Github@gmail.com>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists('b:current_syntax')
let s:current_syntax_save = b:current_syntax
endif
" Inherit coffee from html so coffeeComment isn't redefined and given higher
" priority than hamlInterpolation.
syn cluster hamlCoffeescript contains=@htmlCoffeeScript
syn region hamlCoffeescriptFilter matchgroup=hamlFilter
\ start="^\z(\s*\):coffee\z(script\)\?\s*$"
\ end="^\%(\z1 \| *$\)\@!"
\ contains=@hamlCoffeeScript,hamlInterpolation
\ keepend
if exists('s:current_syntax_save')
let b:current_syntax = s:current_syntax_save
unlet s:current_syntax_save
endif
endif

17
after/syntax/haskell.vim Normal file
View File

@@ -0,0 +1,17 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'dhall') != -1
finish
endif
" 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

View File

@@ -1,5 +1,7 @@
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.
" "
" Place code between !sc! and !/sc! delimiters. These will be hidden if Vim is " Place code between !sc! and !/sc! delimiters. These will be hidden if Vim is
@@ -14,5 +16,3 @@ 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

View File

@@ -1,42 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1 if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'html5') != -1
finish
" Language: CoffeeScript
" Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
if exists('b:current_syntax')
let s:current_syntax_save = b:current_syntax
endif endif
" Syntax highlighting for text/coffeescript script tags
syn include @htmlCoffeeScript syntax/coffee.vim
syn region coffeeScript start=#<script [^>]*type=['"]\?text/coffeescript['"]\?[^>]*>#
\ end=#</script>#me=s-1 keepend
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
\ containedin=htmlHead
if exists('s:current_syntax_save')
let b:current_syntax = s:current_syntax_save
unlet s:current_syntax_save
endif
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
" Language: OpenGL Shading Language
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
syn include @GLSL syntax/glsl.vim
syn region ShaderScript
\ start="<script [^>]*type=\('\|\"\)x-shader/x-\(vertex\|fragment\)\('\|\"\)[^>]*>"
\ keepend
\ end="</script>"me=s-1
\ contains=@GLSL,htmlScriptTag,@htmlPreproc
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
" Vim syntax file " Vim syntax file
" Language: HTML (version 5.1) " Language: HTML (version 5.1)
" Last Change: 2017 Feb 15 " Last Change: 2017 Feb 15
@@ -49,35 +14,3 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
" 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
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
if !exists("g:less_html_style_tags")
let g:less_html_style_tags = 1
endif
if !g:less_html_style_tags
finish
endif
" Unset (but preserve) so that less will run.
if exists("b:current_syntax")
let s:pre_less_cur_syn = b:current_syntax
unlet b:current_syntax
endif
" Inspired by code from github.com/kchmck/vim-coffee-script
" and the html syntax file included with vim 7.4.
syn include @htmlLess syntax/less.vim
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
" Reset since 'less' isn't really the current_syntax.
if exists("s:pre_less_cur_syn")
let b:current_syntax = s:pre_less_cur_syn
endif
endif

82
after/syntax/idris.vim Normal file
View File

@@ -0,0 +1,82 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'idris') != -1
finish
endif
" This script allows for unicode concealing of certain characters
" For instance -> goes to →
"
" It needs vim >= 7.3, set nocompatible, set enc=utf-8
"
" If you want to turn this on, let g:idris_conceal = 1
if !exists('g:idris_conceal') || !has('conceal') || &enc != 'utf-8'
finish
endif
" vim: set fenc=utf-8:
syntax match idrNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ
syntax match idrNiceOperator "<-" conceal cchar=
syntax match idrNiceOperator "->" conceal cchar=
syntax match idrNiceOperator "\<sum\>" conceal cchar=
syntax match idrNiceOperator "\<product\>" conceal cchar=
syntax match idrNiceOperator "\<sqrt\>" conceal cchar=
syntax match idrNiceOperator "\<pi\>" conceal cchar=π
syntax match idrNiceOperator "==" conceal cchar=
syntax match idrNiceOperator "\/=" conceal cchar=
let s:extraConceal = 1
let s:doubleArrow = 1
" Set this to 0 to use the more technically correct arrow from bar
" Some windows font don't support some of the characters,
" so if they are the main font, we don't load them :)
if has("win32")
let s:incompleteFont = [ 'Consolas'
\ , 'Lucida Console'
\ , 'Courier New'
\ ]
let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '')
for s:fontName in s:incompleteFont
if s:mainfont ==? s:fontName
let s:extraConceal = 0
break
endif
endfor
endif
if s:extraConceal
syntax match idrNiceOperator "Void" conceal cchar=
" Match greater than and lower than w/o messing with Kleisli composition
syntax match idrNiceOperator "<=\ze[^<]" conceal cchar=
syntax match idrNiceOperator ">=\ze[^>]" conceal cchar=
if s:doubleArrow
syntax match idrNiceOperator "=>" conceal cchar=
else
syntax match idrNiceOperator "=>" conceal cchar=
endif
syntax match idrNiceOperator "=\zs<<" conceal cchar=«
syntax match idrNiceOperator "++" conceal cchar=
syntax match idrNiceOperator "::" conceal cchar=
syntax match idrNiceOperator "-<" conceal cchar=
syntax match idrNiceOperator ">-" conceal cchar=
syntax match idrNiceOperator "-<<" conceal cchar=
syntax match idrNiceOperator ">>-" conceal cchar=
" Only replace the dot, avoid taking spaces around.
syntax match idrNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=
syntax match idrNiceOperator "\.\." conceal cchar=
syntax match idrNiceOperator "`elem`" conceal cchar=
syntax match idrNiceOperator "`notElem`" conceal cchar=
endif
hi link idrNiceOperator Operator
hi! link Conceal Operator
setlocal conceallevel=2

261
after/syntax/javascript.vim Normal file
View File

@@ -0,0 +1,261 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
if hlexists("jsNoise") " pangloss/vim-javascript
syntax cluster jsExpression add=jsxRegion
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
" refine the javascript line comment
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
syntax cluster javascriptValue add=jsxRegion
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
" add support to arrow function which returns a tagged template string, e.g.
" () => html`<div></div>`
syntax cluster afterArrowFunc add=javascriptTagRef
else " build-in javascript syntax
" refine the javascript line comment
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
" add a javaScriptBlock group for build-in syntax
syntax region javaScriptBlockBuildIn
\ contained
\ matchgroup=javaScriptBraces
\ start="{"
\ end="}"
\ extend
\ contains=javaScriptBlockBuildIn,@javaScriptEmbededExpr,javaScript.*
\ fold
syntax cluster javaScriptEmbededExpr add=jsxRegion
" refine the template string syntax
syntax region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr,javaScript.*
endif
runtime syntax/jsx_pretty.vim
let b:current_syntax = 'javascript.jsx'
let &cpo = s:jsx_cpo
unlet s:jsx_cpo
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
" Vim syntax file
" Language: styled-components (js/ts)
" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com>
" URL: https://github.com/styled-components/vim-styled-components
if exists("b:current_syntax")
let s:current_syntax=b:current_syntax
unlet b:current_syntax
endif
" fix for "-" before cssPositioningProp
" - needs to be above CSS include to not match cssVendor definitions
syn region cssCustomPositioningPrefix contained
\ start='-' end='\%(\s\{-}:\)\@='
\ contains=cssPositioningProp
" introduce CSS cluster from built-in (or single third party syntax file)
syn include @CSS syntax/css.vim
" try to include CSS3 definitions from multiple files
" this is only possible on vim version above 7
if v:version >= 700
try
syn include @CSS3 syntax/css/*.vim
catch
endtry
endif
" TODO: include react-native keywords
" define custom cssAttrRegion
" - add ",", "`" and "{" to the end characters
" - add "cssPseudoClassId" to it's containing elements
" this will incorrectly highlight pseudo elements incorrectly used as
" attributes but correctly highlight actual attributes
syn region cssCustomAttrRegion contained
\ start=":" end="\ze\%(;\|)\|{\|}\|`\)"
\ contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,
\ cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,
\ cssError,cssAttrComma,cssNoise,cssPseudoClassId,
\ jsTemplateExpression,
\ typescriptInterpolation,typescriptTemplateSubstitution
syn region cssCustomAttrRegion contained
\ start="transition\s*:" end="\ze\%(;\|)\|{\|}\|`\)"
\ contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,
\ cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,
\ cssVendor,cssError,cssAttrComma,cssNoise,cssPseudoClassId,
\ jsTemplateExpression,
\ typescriptInterpolation,typescriptTemplateSubstitution
" define custom css elements to not utilize cssDefinition
syn region cssCustomMediaBlock contained fold transparent matchgroup=cssBraces
\ start="{" end="}"
\ contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,
\ cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,
\ cssUnicodeEscape,cssVendor,cssTagName,cssClassName,
\ cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,
\ cssAttributeSelector
syn region cssCustomPageWrap contained transparent matchgroup=cssBraces
\ start="{" end="}"
\ contains=cssPageMargin,cssPageProp,cssCustomAttrRegion,css.*Prop,
\ cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
\ cssHacks
syn match cssCustomPageMargin contained skipwhite skipnl
\ "@\%(\%(top\|left\|right\|bottom\)-\%(left\|center\|right\|middle\|bottom\)\)\%(-corner\)\="
syn match cssCustomKeyFrameSelector "\%(\d*%\|\<from\>\|\<to\>\)" contained
\ skipwhite skipnl
" define css include customly to overwrite nextgroup
syn region cssInclude start="@media\>" end="\ze{" skipwhite skipnl
\ contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,
\ cssMediaMediaAttr,cssVencor,cssMediaType,cssIncludeKeyword,
\ cssMediaComma,cssComment
\ nextgroup=cssCustomMediaBlock
" define all non-contained css definitions
syn cluster CSSTop
\ contains=cssTagName,cssSelectorOp,cssAttributeSelector,cssClassName,
\ cssBraces,cssIdentifier,cssIncludeKeyword,cssPage,cssKeyFrame,
\ cssFontDescriptor,cssAttrComma,cssPseudoClass,cssUnicodeEscape
" custom highlights for styled components
" - "&" inside top level
" - cssTagName inside of jsStrings inside of styledPrefix regions
" TODO: override highlighting of cssTagName with more subtle one
syn match styledAmpersand contained "&"
syn region styledTagNameString matchgroup=jsString contained
\ start=+'+ end=+'+ skip=+\\\%(\'\|$\)+
\ contains=cssTagName
syn region styledTagNameString matchgroup=jsString contained
\ start=+"+ end=+"+ skip=+\\\%(\"\|$\)+
\ contains=cssTagName
syn region styledTagNameString matchgroup=jsString contained
\ start=+`+ end=+`+ skip=+\\\%(\`\|$\)+
\ contains=cssTagName
" define custom API sections that trigger the styledDefinition highlighting
syn match styledPrefix "\<styled\>\.\k\+"
\ transparent fold
\ nextgroup=styledDefinition
\ contains=cssTagName,javascriptTagRef
\ containedin=jsFuncBlock,jsParen,jsObject,jsObjectValue
syn match styledPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})"
\ transparent fold extend
\ nextgroup=styledDefinition
\ contains=jsObject,jsParen
\ containedin=jsFuncBlock,jsParen,jsObject,jsObjectValue
syn match styledPrefix "\.\<extend\>"
\ transparent fold
\ nextgroup=styledDefinition
\ containedin=jsFuncBlock,jsParen,jsObject,jsObjectValue
" define emotion css prop
" to bypass problems from top-level defined xml/js definitions, this
" plugin re-defines keywords/noise for highlighting inside of the custom
" xmlAttrib definition
syn keyword styledXmlRegionKeyword css contained
syn match styledXmlRegionNoise "\%(=\|{\|}\)" contained
" only include styledDefinitions inside of xmlAttribs, that are wrapped
" in `css={}` regions, `keepend` is necessary to correctly break on the
" higher-level xmlAttrib region end
syn region styledXmlRegion
\ start="\<css\>={" end="}"
\ keepend fold
\ containedin=xmlAttrib
\ contains=styledXmlRegionKeyword,styledXmlRegionNoise,styledDefinition
" define nested region for indenting
syn region styledNestedRegion contained transparent
\ matchgroup=cssBraces
\ start="{" end="}"
" re-define cssError to be highlighted correctly in styledNestedRegion
syn match cssError contained "{@<>"
" extend javascript matches to trigger styledDefinition highlighting
syn match jsTaggedTemplate extend
\ "\<css\>\|\.\<resolve\>\|\.\<global\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
\ nextgroup=styledDefinition
syn match jsFuncCall "\<styled\>\s*(.\+)" transparent
\ nextgroup=styledDefinition
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
\ contains=styledTagNameString
\ nextgroup=styledDefinition
syn match jsFuncCall "\.\<withComponent\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))"
\ contains=styledTagNameString
syn match jsFuncCall "\<dc\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))\%((\)\@="
\ contains=styledTagNameString
\ nextgroup=styledDefinitionArgument
" inject css highlighting into custom jsTemplateString region
" - use `extend` to not end all nested jsTemplateExpression on the first
" closing one
syn region styledDefinition contained transparent fold extend
\ start="`" end="`" skip="\\\%(`\|$\)"
\ contains=@CSSTop,
\ css.*Prop,cssValue.*,cssColor,cssUrl,cssImportant,cssError,
\ cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,
\ cssHacks,
\ cssCustom.*,
\ jsComment,jsTemplateExpression,
\ typescriptInterpolation,typescriptTemplateSubstitution,
\ styledAmpersand,styledNestedRegion
syn region styledDefinitionArgument contained transparent start=+(+ end=+)+
\ contains=styledDefinition
""" yajs specific extensions
" define template tag keywords, that trigger styledDefinitions again to be
" contained in and also do contain the `javascriptTagRef` region
syn match javascriptTagRefStyledPrefix transparent fold
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
\ containedin=javascriptTagRef
\ contains=javascriptTagRef
\ nextgroup=styledDefinition
" extend the yajs clusters to include the previously and extraneously defined
" styled-related matches
syn cluster javascriptExpression
\ add=styledPrefix,jsFuncCall,javascriptTagRefStyledPrefix
syn cluster javascriptAfterIdentifier add=styledPrefix,jsFuncCall
" color the custom highlight elements
hi def link cssCustomKeyFrameSelector Constant
hi def link cssCustomPositioningPrefix StorageClass
hi def link styledAmpersand Special
hi def link styledXmlRegionKeyword Type
hi def link styledXmlRegionNoise Noise
hi def link styledXmlRegion String
if exists("s:current_syntax")
let b:current_syntax=s:current_syntax
endif

View File

@@ -1,5 +1,7 @@
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
unlet b:current_syntax unlet b:current_syntax
@@ -9,7 +11,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'
@@ -23,5 +25,3 @@ 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

216
after/syntax/jsx_pretty.vim Normal file
View File

@@ -0,0 +1,216 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
" <tag id="sample">
" ~~~~~~~~~~~~~~~~~
" and self close tag
" <tag id="sample" />
" ~~~~~~~~~~~~~~~~~~~
syntax region jsxTag
\ start=+<+
\ matchgroup=jsxOpenPunct
\ end=+>+
\ matchgroup=NONE
\ end=+\(/\_s*>\)\@=+
\ contained
\ contains=jsxOpenTag,jsxEscapeJs,jsxAttrib,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment,jsxSpreadOperator
\ keepend
\ extend
" <tag></tag>
" ~~~~~~~~~~~
" and fragment
" <></>
" ~~~~~
" and self close tag
" <tag />
" ~~~~~~~
syntax region jsxElement
\ start=+<\_s*\(>\|\${\|\z(\<[-:_\.\$0-9A-Za-z]\+\>\)\)+
\ end=+/\_s*>+
\ end=+<\_s*/\_s*\z1\_s*>+
\ contains=jsxElement,jsxEscapeJs,jsxTag,jsxComment,jsxCloseString,jsxCloseTag,@Spell
\ keepend
\ extend
\ contained
\ fold
" detect jsx region
syntax region jsxRegion
\ start=+\(\(\_[([,?:=+\-*/<>{}]\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\(>\|\z(\(script\)\@!\<[_\$A-Za-z][-:_\.\$0-9A-Za-z]*\>\)\(\_s*\([-+*)\]}&|?]\|/\([/*]\|\_s*>\)\@!\)\)\@!\)+
\ end=++
\ contains=jsxElement
" <tag key={this.props.key}>
" ~~~~~~~~~~~~~~~~
syntax region jsxEscapeJs
\ start=+{+
\ end=++
\ extend
\ contained
\ contains=jsBlock,javascriptBlock,javaScriptBlockBuildIn,typescriptBlock
" <tag key={this.props.key}>
" ~~~~
" and fragment start tag
" <>
" ~~
exe 'syntax region jsxOpenTag
\ matchgroup=jsxOpenPunct
\ start=+<+
\ end=+>+
\ matchgroup=NONE
\ end=+\>+
\ contained
\ contains=jsxTagName
\ nextgroup=jsxAttrib
\ skipwhite
\ skipempty ' .(s:highlight_close_tag ? 'transparent' : '')
" <foo.bar>
" ~
syntax match jsxDot +\.+ contained display
" <foo:bar>
" ~
syntax match jsxNamespace +:+ contained display
" <tag id="sample">
" ~
syntax match jsxEqual +=+ contained display nextgroup=jsxString,jsxEscapeJs,jsxRegion skipwhite
" <tag />
" ~~
syntax match jsxCloseString +/\_s*>+ contained
" </tag>
" ~~~~~~
" and fragment close tag
" </>
" ~~~
syntax region jsxCloseTag
\ matchgroup=jsxClosePunct
\ start=+<\_s*/+
\ end=+>+
\ contained
\ contains=jsxTagName
" <tag key={this.props.key}>
" ~~~
syntax match jsxAttrib
\ +\<[-A-Za-z_][-:_\$0-9A-Za-z]*\>+
\ contained
\ nextgroup=jsxEqual
\ skipwhite
\ skipempty
\ contains=jsxAttribKeyword
\ display
" <MyComponent ...>
" ~~~~~~~~~~~
" NOT
" <someCamel ...>
" ~~~~~
exe 'syntax match jsxComponentName
\ +\<[A-Z][\$0-9A-Za-z]\+\>+
\ contained
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
" <tag key={this.props.key}>
" ~~~
exe 'syntax match jsxTagName
\ +\<[-:_\.\$0-9A-Za-z]\+\>+
\ contained
\ contains=jsxComponentName,jsxDot,jsxNamespace
\ nextgroup=jsxAttrib
\ skipempty
\ skipwhite
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
" <tag id="sample">
" ~~~~~~~~
" and
" <tag id='sample'>
" ~~~~~~~~
syntax region jsxString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ contained contains=@Spell display
let s:tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'raw'])
let s:enable_tagged_jsx = !empty(s:tags)
" add support to JSX inside the tagged template string
" https://github.com/developit/htm
if s:enable_tagged_jsx
exe 'syntax region jsxTaggedRegion
\ start=+\%('. join(s:tags, '\|') .'\)\@<=`+ms=s+1
\ end=+`+me=e-1
\ extend
\ contained
\ containedin=jsTemplateString,javascriptTemplate,javaScriptStringT,typescriptStringB
\ contains=jsxElement'
syntax region jsxEscapeJs
\ start=+\${+
\ end=++
\ extend
\ contained
\ contains=jsTemplateExpression,javascriptTemplateSubstitution,javaScriptEmbed,typescriptInterpolation
syntax region jsxOpenTag
\ matchgroup=jsxOpenPunct
\ start=+<\%(\${\)\@=+
\ matchgroup=NONE
\ end=++
\ contained
\ contains=jsxEscapeJs
\ nextgroup=jsxAttrib,jsxSpreadOperator
\ skipwhite
\ skipempty
syntax keyword jsxAttribKeyword class contained display
syntax match jsxSpreadOperator +\.\.\.+ contained display nextgroup=jsxEscapeJs skipwhite
syntax match jsxCloseTag +<//>+ display
syntax match jsxComment +<!--\_.\{-}-->+ display
endif
" Highlight the tag name
highlight def link jsxTag Function
highlight def link jsxTagName Identifier
highlight def link jsxComponentName Function
highlight def link jsxAttrib Type
highlight def link jsxAttribKeyword jsxAttrib
highlight def link jsxEqual Operator
highlight def link jsxString String
highlight def link jsxDot Operator
highlight def link jsxNamespace Operator
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
highlight def link jsxComment Comment
highlight def link jsxSpreadOperator Operator
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

26
after/syntax/llvm.vim Normal file
View File

@@ -0,0 +1,26 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'llvm') != -1
finish
endif
" 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\+\>/

View File

@@ -1,17 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1 if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'mdx') != -1
finish
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" endif
" Vim syntax file
"
" Language: JSX (JavaScript) " based on mxw/vim-jsx
" Maintainer: Max Wang <mxawng@gmail.com>
" Depends: pangloss/vim-javascript
"
" CREDITS: Inspired by Facebook.
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Prologue; load in XML syntax.
if exists('b:current_syntax') if exists('b:current_syntax')
let s:current_syntax=b:current_syntax let s:current_syntax=b:current_syntax
unlet b:current_syntax unlet b:current_syntax
@@ -21,25 +14,10 @@ if exists('s:current_syntax')
let b:current_syntax=s:current_syntax let b:current_syntax=s:current_syntax
endif 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 " JSX attributes should color as JS. Note the trivial end pattern; we let
" jsBlock take care of ending the region. " jsBlock take care of ending the region.
syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock 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 " 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 " syntactically distinct, and (b) they need the syn-extend argument, or else
" nested XML end-tag patterns may end the outer jsxRegion. " nested XML end-tag patterns may end the outer jsxRegion.
@@ -53,7 +31,7 @@ syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock
" and generic Flow type annotations (http://flowtype.org/). " and generic Flow type annotations (http://flowtype.org/).
syn region jsxRegion syn region jsxRegion
\ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock \ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock
\ start=+\%(<\|\w\)\@<!<\z([a-zA-Z_][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*>(\)\@!+ \ start=+\%(<\|\w\)\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+
\ skip=+<!--\_.\{-}-->+ \ skip=+<!--\_.\{-}-->+
\ end=+</\z1\_\s\{-}>+ \ end=+</\z1\_\s\{-}>+
\ end=+/>+ \ end=+/>+
@@ -65,5 +43,3 @@ 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

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,7 @@
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
@@ -19,5 +21,3 @@ 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

4
after/syntax/reason.vim Normal file
View File

@@ -0,0 +1,4 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'reason') != -1
finish
endif

View File

@@ -1,5 +1,7 @@
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
" Originally from http://www.vim.org/scripts/script.php?script_id=2286 " Originally from http://www.vim.org/scripts/script.php?script_id=2286
@@ -32,5 +34,3 @@ 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

View File

@@ -1,5 +1,7 @@
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.
" "
" Author: Joel Holdbrooks <https://github.com/noprompt> " Author: Joel Holdbrooks <https://github.com/noprompt>
@@ -126,5 +128,3 @@ 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

View File

@@ -1,5 +1,7 @@
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
if !get(g:, 'rust_conceal', 0) || !has('conceal') || &encoding !=# 'utf-8' if !get(g:, 'rust_conceal', 0) || !has('conceal') || &encoding !=# 'utf-8'
@@ -41,5 +43,3 @@ 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

View File

@@ -1,5 +1,7 @@
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
syn region texRefZone matchgroup=texStatement start="\\Cref{" end="}\|%stopzone\>" contains=@texRefGroup syn region texRefZone matchgroup=texStatement start="\\Cref{" end="}\|%stopzone\>" contains=@texRefGroup
@@ -9,5 +11,3 @@ 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

116
after/syntax/typescript.vim Normal file
View File

@@ -0,0 +1,116 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim syntax file
"
" Language: javascript.jsx
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
" Depends: leafgarland/typescript-vim
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:jsx_cpo = &cpo
set cpo&vim
syntax case match
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
" refine the typescript line comment
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
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
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1
finish
endif
runtime! syntax/javascript.vim
" define custom API section, that contains typescript annotations
" this is structurally similar to `jsFuncCall`, but allows type
" annotations (delimited by brackets (e.g. "<>")) between `styled` and
" the function call parenthesis
syn match styledTypescriptPrefix
\ "\<styled\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>(\%('\k\+'\|\"\k\+\"\|\k\+\))"
\ transparent fold extend
\ nextgroup=styledDefinition
\ contains=cssTagName,
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
\ typescriptParens,typescriptStringS,@typescriptType,
\ typescriptType,foldBraces,
\ styledTagNameString
\ containedin=foldBraces
syn match styledTypescriptPrefix
\ "\<styled\>\%((\%('\k\+'\|\"\k\+\"\|\k\+\))\|\.\k\+\)<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
\ transparent fold extend
\ nextgroup=styledDefinition
\ contains=cssTagName,
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
\ typescriptParens,typescriptStringS,@typescriptType,
\ typescriptType,foldBraces,
\ styledTagNameString
\ containedin=foldBraces
syn match styledTypescriptPrefix "\.\<attrs\>\s*(\%(\n\|\s\|.\)\{-})<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
\ transparent fold extend
\ nextgroup=styledDefinition
\ contains=cssTagName,
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
\ typescriptParens,typescriptStringS,@typescriptType,
\ typescriptType,foldBraces,
\ styledTagNameString
\ containedin=foldBraces
syn match styledTypescriptPrefix "\.\<extend\><\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
\ transparent fold extend
\ nextgroup=styledDefinition
\ contains=cssTagName,
\ typescriptBraces,typescriptOpSymbols,typescriptEndColons,
\ typescriptParens,typescriptStringS,@typescriptType,
\ typescriptType,foldBraces,
\ styledTagNameString
\ containedin=foldBraces
syn match jsFuncCall "\<styled\>\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))<\%(\[\|\]\|{\|}\||\|&\|:\|;\|,\|?\|'\|\"\|\k\|\s\|\n\)\+>"
\ transparent fold
\ contains=typescriptBraces,typescriptOpSymbols,typescriptEndColons,
\ typescriptParens,typescriptStringS,@typescriptType,
\ typescriptType,foldBraces,
\ styledTagNameString
\ nextgroup=styledDefinition
\ containedin=foldBraces
syn cluster typescriptValue add=styledPrefix,jsFuncCall,styledTypescriptPrefix
""" yats specific extensions
" extend typescriptIdentifierName to allow styledDefinitions in their
" tagged templates
syn match typescriptIdentifierName extend
\ "\<css\>\|\<keyframes\>\|\<injectGlobal\>\|\<fontFace\>\|\<createGlobalStyle\>"
\ nextgroup=styledDefinition

View File

@@ -1,5 +1,7 @@
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
unlet b:current_syntax unlet b:current_syntax
@@ -9,7 +11,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'
@@ -22,5 +24,3 @@ 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

View File

@@ -1,5 +1,7 @@
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:
" au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim " au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim
@@ -27,7 +29,7 @@ syn match yamlBlock "[>|]\d\?[+-]"
syn region yamlComment start="\#" end="$" syn region yamlComment start="\#" end="$"
syn match yamlIndicator "#YAML:\S\+" syn match yamlIndicator "#YAML:\S\+"
syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)'" end="'" skip="\\'" syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)\@<='" end="'" skip="\\'"
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1 syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1 syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
@@ -61,5 +63,3 @@ 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

View File

@@ -1,5 +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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Support for LaTex-to-Unicode conversion as in the Julia REPL " " Support for LaTex-to-Unicode conversion as in the Julia REPL "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -650,5 +652,3 @@ function! LaTeXtoUnicode#Toggle()
endif endif
return return
endfunction endfunction
endif

View File

@@ -1,10 +1,16 @@
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
" Last Modified: 2018-01-07 " Last Modified: 2018-12-29
function s:CacheRstFold() function s:CacheRstFold()
if !g:rst_fold_enabled
return
endif
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}} let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
function closure.Process(match) dict function closure.Process(match) dict
let curline = getcurpos()[1] let curline = getcurpos()[1]
@@ -30,6 +36,10 @@ function s:CacheRstFold()
endfunction endfunction
function RstFold#GetRstFold() function RstFold#GetRstFold()
if !g:rst_fold_enabled
return
endif
if !has_key(b:, 'RstFoldCache') if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold() call s:CacheRstFold()
endif endif
@@ -41,6 +51,10 @@ function RstFold#GetRstFold()
endfunction endfunction
function RstFold#GetRstFoldText() function RstFold#GetRstFoldText()
if !g:rst_fold_enabled
return
endif
if !has_key(b:, 'RstFoldCache') if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold() call s:CacheRstFold()
endif endif
@@ -50,5 +64,3 @@ 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

View File

@@ -1,5 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
finish
endif
function! cargo#Load() function! cargo#Load()
" Utility call to get this script loaded, for debugging " Utility call to get this script loaded, for debugging
endfunction endfunction
@@ -115,5 +117,3 @@ 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

View File

@@ -1,5 +1,7 @@
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'
" Preserve the current directory, and 'lcd' to the nearest Cargo file. " Preserve the current directory, and 'lcd' to the nearest Cargo file.
@@ -26,5 +28,3 @@ 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

View File

@@ -1,5 +1,7 @@
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
" Maintainer: Sung Pae <self@sungpae.com> " Maintainer: Sung Pae <self@sungpae.com>
@@ -22,5 +24,3 @@ function! clojurecomplete#Complete(findstart, base)
endfunction endfunction
" vim:sts=8:sw=8:ts=8:noet " vim:sts=8:sw=8:ts=8:noet
endif

View File

@@ -1,5 +1,7 @@
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>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
@@ -54,5 +56,3 @@ function! coffee#CoffeeSetUpErrorFormat()
\%f:%l:%c:\ error:\ %m, \%f:%l:%c:\ error:\ %m,
\%-G%.%# \%-G%.%#
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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
@@ -35,21 +37,45 @@ function! s:run_cmd(cmd) abort
return s:P.system(a:cmd) return s:P.system(a:cmd)
endfunction endfunction
function! s:find_root_by_spec(d) abort function! s:find_root_by(search_dir, d) abort
let dir = finddir('spec', a:d . ';') let found_dir = finddir(a:search_dir, a:d . ';')
if dir ==# '' if found_dir ==# ''
return '' return ''
endif endif
" Note: ':h:h' for {root}/spec/ -> {root}/spec -> {root} " Note: ':h:h' for {root}/{search_dir}/ -> {root}/{search_dir} -> {root}
return fnamemodify(dir, ':p:h:h') return fnamemodify(found_dir, ':p:h:h')
endfunction
" Search the root directory containing a 'spec/' and a 'src/' directories.
"
" Searching for the 'spec/' directory is not enough: for example the crystal
" compiler has a 'cr_sources/src/spec/' directory that would otherwise give the root
" directory as 'cr_source/src/' instead of 'cr_sources/'.
function! s:find_root_by_spec_and_src(d) abort
" Search for 'spec/'
let root = s:find_root_by('spec', a:d)
" Check that 'src/' is also there
if root !=# '' && isdirectory(root . '/src')
return root
endif
" Search for 'src/'
let root = s:find_root_by('src', a:d)
" Check that 'spec/' is also there
if root !=# '' && isdirectory(root . '/spec')
return root
endif
" Cannot find a directory containing both 'src/' and 'spec/'
return ''
endfunction endfunction
function! crystal_lang#entrypoint_for(file_path) abort function! crystal_lang#entrypoint_for(file_path) abort
let parent_dir = fnamemodify(a:file_path, ':p:h') let parent_dir = fnamemodify(a:file_path, ':p:h')
let root_dir = s:find_root_by_spec(parent_dir) let root_dir = s:find_root_by_spec_and_src(parent_dir)
if root_dir ==# '' if root_dir ==# ''
" No spec diretory found. No need to make temporary file " No spec directory found. No need to make temporary file
return a:file_path return a:file_path
endif endif
@@ -230,7 +256,7 @@ endfunction
function! crystal_lang#run_all_spec(...) abort function! crystal_lang#run_all_spec(...) abort
let path = a:0 == 0 ? expand('%:p:h') : a:1 let path = a:0 == 0 ? expand('%:p:h') : a:1
let root_path = s:find_root_by_spec(path) let root_path = s:find_root_by_spec_and_src(path)
if root_path ==# '' if root_path ==# ''
return s:echo_error("'spec' directory is not found") return s:echo_error("'spec' directory is not found")
endif endif
@@ -248,9 +274,9 @@ function! crystal_lang#run_current_spec(...) abort
let source_dir = fnamemodify(path, ':h') let source_dir = fnamemodify(path, ':h')
" /foo/bar " /foo/bar
let root_dir = s:find_root_by_spec(source_dir) let root_dir = s:find_root_by_spec_and_src(source_dir)
if root_dir ==# '' if root_dir ==# ''
return s:echo_error("'spec' directory is not found") return s:echo_error("Root directory with 'src/' and 'spec/' not found")
endif endif
" src " src
@@ -316,5 +342,3 @@ endfunction
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
endif

3191
autoload/csv.vim Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,7 @@
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
echohl Error echohl Error
@@ -7,22 +9,35 @@ function! s:error(text) abort
echohl None echohl None
endfunction endfunction
function! s:cexpr(errorformat, joined_lines) abort function! s:cexpr(errorformat, lines, reason) abort
let temp_errorfomat = &errorformat call setqflist([], ' ', {
try \ 'lines': a:lines,
let &errorformat = a:errorformat \ 'efm': a:errorformat,
cexpr a:joined_lines \ 'context': {'reason': a:reason},
copen \})
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') if executable('dartfmt')
let buffer_content = join(getline(1, '$'), "\n") let buffer_content = join(getline(1, '$'), "\n")
let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content) let args = '--stdin-name '.expand('%').' '.a:q_args
if buffer_content ==# joined_lines[:-2] | return | endif let joined_lines = system(printf('dartfmt %s', args), buffer_content)
if buffer_content ==# joined_lines[:-2]
call s:clearQfList('dartfmt')
return
endif
if 0 == v:shell_error if 0 == v:shell_error
let win_view = winsaveview() let win_view = winsaveview()
let lines = split(joined_lines, "\n") let lines = split(joined_lines, "\n")
@@ -31,12 +46,11 @@ function! dart#fmt(q_args) abort
silent keepjumps execute string(len(lines)+1).',$ delete' silent keepjumps execute string(len(lines)+1).',$ delete'
endif endif
call winrestview(win_view) call winrestview(win_view)
call s:clearQfList('dartfmt')
else else
let errors = split(joined_lines, "\n")[2:] let errors = split(joined_lines, "\n")[2:]
let file_path = expand('%') let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
call map(errors, 'file_path.":".v:val') call s:cexpr(error_format, errors, 'dartfmt')
let error_format = '%A%f:line %l\, column %c of stdin: %m,%C%.%#'
call s:cexpr(error_format, join(errors, "\n"))
endif endif
else else
call s:error('cannot execute binary file: dartfmt') call s:error('cannot execute binary file: dartfmt')
@@ -47,8 +61,9 @@ function! dart#analyzer(q_args) abort
if executable('dartanalyzer') if executable('dartanalyzer')
let path = expand('%:p:gs:\:/:') let path = expand('%:p:gs:\:/:')
if filereadable(path) if filereadable(path)
let joined_lines = system(printf('dartanalyzer %s %s', a:q_args, shellescape(path))) let command = printf('dartanalyzer %s %s', a:q_args, shellescape(path))
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines) let lines = systemlist(command)
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dartanalyzer')
else else
call s:error(printf('cannot read a file: "%s"', path)) call s:error(printf('cannot read a file: "%s"', path))
endif endif
@@ -61,8 +76,9 @@ function! dart#tojs(q_args) abort
if executable('dart2js') if executable('dart2js')
let path = expand('%:p:gs:\:/:') let path = expand('%:p:gs:\:/:')
if filereadable(path) if filereadable(path)
let joined_lines = system(printf('dart2js %s %s', a:q_args, shellescape(path))) let command = printf('dart2js %s %s', a:q_args, shellescape(path))
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines) let lines = systemlist(command)
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dart2js')
else else
call s:error(printf('cannot read a file: "%s"', path)) call s:error(printf('cannot read a file: "%s"', path))
endif endif
@@ -170,5 +186,3 @@ function! dart#setModifiable() abort
setlocal nomodifiable setlocal nomodifiable
endif endif
endfunction endfunction
endif

View File

@@ -0,0 +1,24 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'elixir') != -1
finish
endif
let s:path = expand('<sfile>:h')
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
function! s:repo_list() abort
return map(systemlist(s:cmd), 'split(v:val)')
endfunction
function! db#adapter#ecto#canonicalize(url) abort
for l:item in s:repo_list()
let l:name = get(l:item, 0)
let l:url = get(l:item, 1)
if !empty(l:name) && 'ecto:'.l:name ==# a:url
return l:url
endif
endfor
endfunction
function! db#adapter#ecto#complete_opaque(url) abort
return map(s:repo_list(), 'v:val[0]')
endfunction

View File

@@ -1,5 +1,7 @@
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
endif endif
@@ -23,6 +25,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',
@@ -33,9 +36,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
@@ -100,7 +108,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
@@ -156,6 +168,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
@@ -267,7 +287,7 @@ function! elixir#indent#handle_inside_block(context)
let config = { let config = {
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, \'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, \'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after'), 'pattern_match_clauses': s:keyword('catch\|rescue')}, \'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')},
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')}, \'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},
\'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match}, \'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match},
\'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match}, \'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match},
@@ -343,5 +363,3 @@ function! elixir#indent#handle_inside_generic_block(context)
return -1 return -1
endif endif
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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
@@ -24,5 +26,3 @@ function! elixir#util#get_filename(word) abort
return word return word
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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 = []
function! s:elmOracle(...) abort function! s:elmOracle(...) abort
@@ -381,5 +383,3 @@ function! s:ExecuteInRoot(cmd) abort
return l:out return l:out
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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
let l:win = ['win16', 'win32', 'win32unix', 'win64', 'win95'] let l:win = ['win16', 'win32', 'win32unix', 'win64', 'win95']
@@ -134,7 +136,13 @@ function! elm#util#GoToModule(name)
endfunction endfunction
function! s:findLocalModule(rel_path, root) function! s:findLocalModule(rel_path, root)
let l:package_json = a:root . '/elm-package.json' let l:old_match = findfile('elm-package.json', a:root . ';')
let l:new_match = findfile('elm.json', a:root . ';')
if !empty(l:new_match)
let l:package_json = l:new_match
elseif !empty(l:old_match)
let l:package_json = l:old_match
endif
if exists('*json_decode') if exists('*json_decode')
let l:package = json_decode(readfile(l:package_json)) let l:package = json_decode(readfile(l:package_json))
let l:source_roots = l:package['source-directories'] let l:source_roots = l:package['source-directories']
@@ -174,5 +182,3 @@ function! s:error(msg)
echohl NONE echohl NONE
let v:errmsg = a:msg let v:errmsg = a:msg
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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()
let l:prevlnum = prevnonblank(v:lnum - 1) let l:prevlnum = prevnonblank(v:lnum - 1)
@@ -9,15 +11,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
@@ -67,5 +69,3 @@ 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

View File

@@ -1,5 +1,7 @@
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
set cpo&vim set cpo&vim
@@ -23,10 +25,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
@@ -49,8 +53,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
@@ -116,7 +128,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
@@ -176,12 +188,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
@@ -212,6 +227,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
@@ -237,19 +262,27 @@ function! go#config#SetTemplateAutocreate(value) abort
endfunction endfunction
function! go#config#MetalinterCommand() abort function! go#config#MetalinterCommand() abort
return get(g:, "go_metalinter_command", "") return get(g:, "go_metalinter_command", "gometalinter")
endfunction endfunction
function! go#config#MetalinterAutosaveEnabled() abort function! go#config#MetalinterAutosaveEnabled() abort
return get(g:, 'go_metalinter_autosave_enabled', ['vet', 'golint']) let l:default_enabled = ["vet", "golint"]
if go#config#MetalinterCommand() == "golangci-lint"
let l:default_enabled = ["govet", "golint"]
endif
return get(g:, "go_metalinter_autosave_enabled", default_enabled)
endfunction endfunction
function! go#config#MetalinterEnabled() abort function! go#config#MetalinterEnabled() abort
return get(g:, "go_metalinter_enabled", ['vet', 'golint', 'errcheck']) let l:default_enabled = ["vet", "golint", "errcheck"]
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
@@ -390,8 +423,9 @@ function! go#config#HighlightFunctions() abort
return get(g:, 'go_highlight_functions', 0) return get(g:, 'go_highlight_functions', 0)
endfunction endfunction
function! go#config#HighlightFunctionArguments() abort function! go#config#HighlightFunctionParameters() abort
return get(g:, 'go_highlight_function_arguments', 0) " fallback to highlight_function_arguments for backwards compatibility
return get(g:, 'go_highlight_function_parameters', get(g:, 'go_highlight_function_arguments', 0))
endfunction endfunction
function! go#config#HighlightFunctionCalls() abort function! go#config#HighlightFunctionCalls() abort
@@ -441,6 +475,14 @@ function! go#config#FoldEnable(...) abort
return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment']) return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
endfunction endfunction
function! go#config#EchoGoInfo() abort
return get(g:, "go_echo_go_info", 1)
endfunction
function! go#config#CodeCompletionEnabled() abort
return get(g:, "go_code_completion_enabled", 1)
endfunction
" Set the default value. A value of "1" is a shortcut for this, for " Set the default value. A value of "1" is a shortcut for this, for
" compatibility reasons. " compatibility reasons.
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1 if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
@@ -452,5 +494,3 @@ 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
View File

@@ -0,0 +1,16 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'graphql') != -1
finish
endif
" 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

View File

@@ -1,5 +1,7 @@
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
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
@@ -841,5 +843,3 @@ function! htmlcomplete#CheckDoctype() " {{{
endfunction endfunction
" }}} " }}}
" vim:set foldmethod=marker: " vim:set foldmethod=marker:
endif

View 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)
finish
endif
function! jsx_pretty#comment#update_commentstring(original)
let syn_current = s:syn_name(line('.'), col('.'))
let syn_start = s:syn_name(line('.'), 1)
let save_cursor = getcurpos()
if syn_start =~? '^jsx'
let line = getline(".")
let start = len(matchstr(line, '^\s*'))
let syn_name = s:syn_name(line('.'), start + 1)
if line =~ '^\s*//'
let &l:commentstring = '// %s'
elseif s:syn_contains(line('.'), col('.'), 'jsxTaggedRegion')
let &l:commentstring = '<!-- %s -->'
elseif syn_name =~? '^jsxAttrib'
let &l:commentstring = '// %s'
else
let &l:commentstring = '{/* %s */}'
endif
else
let &l:commentstring = a:original
endif
" Restore the cursor position
call setpos('.', save_cursor)
endfunction
function! s:syn_name(lnum, cnum)
let syn_id = get(synstack(a:lnum, a:cnum), -1)
return synIDattr(syn_id, "name")
endfunction
function! s:syn_contains(lnum, cnum, syn_name)
let stack = synstack(a:lnum, a:cnum)
let syn_names = map(stack, 'synIDattr(v:val, "name")')
return index(syn_names, a:syn_name) >= 0
endfunction

View File

@@ -0,0 +1,218 @@
if exists('g:polyglot_disabled') && (index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
finish
endif
if exists('*shiftwidth')
function! s:sw()
return shiftwidth()
endfunction
else
function! s:sw()
return &sw
endfunction
endif
" Get the syntax group of start of line
function! s:syn_sol(lnum)
let line = getline(a:lnum)
let sol = matchstr(line, '^\s*')
return map(synstack(a:lnum, len(sol) + 1), 'synIDattr(v:val, "name")')
endfunction
" Get the syntax group of end of line
function! s:syn_eol(lnum)
let lnum = prevnonblank(a:lnum)
let col = strlen(getline(lnum))
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
endfunction
function! s:prev_indent(lnum)
let lnum = prevnonblank(a:lnum - 1)
return indent(lnum)
endfunction
function! s:prev_line(lnum)
let lnum = prevnonblank(a:lnum - 1)
return substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
endfunction
function! s:syn_attr_jsx(synattr)
return a:synattr =~? "^jsx"
endfunction
function! s:syn_xmlish(syns)
return s:syn_attr_jsx(get(a:syns, -1))
endfunction
function! s:syn_jsx_element(syns)
return get(a:syns, -1) =~? 'jsxElement'
endfunction
function! s:syn_js_comment(syns)
return get(a:syns, -1) =~? 'Comment$'
endfunction
function! s:syn_jsx_escapejs(syns)
return get(a:syns, -1) =~? '\(\(js\(Template\)\?\|javaScript\(Embed\)\?\|typescript\)Braces\|javascriptTemplateSB\|typescriptInterpolationDelimiter\)' &&
\ (get(a:syns, -2) =~? 'jsxEscapeJs' ||
\ get(a:syns, -3) =~? 'jsxEscapeJs')
endfunction
function! s:syn_jsx_attrib(syns)
return len(filter(copy(a:syns), 'v:val =~? "jsxAttrib"'))
endfunction
let s:start_tag = '<\s*\([-:_\.\$0-9A-Za-z]\+\|>\)'
" match `/end_tag>` and `//>`
let s:end_tag = '/\%(\s*[-:_\.\$0-9A-Za-z]*\s*\|/\)>'
let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
function! jsx_pretty#indent#get(js_indent)
let lnum = v:lnum
let line = substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
let current_syn = s:syn_sol(lnum)
let current_syn_eol = s:syn_eol(lnum)
let prev_line_num = prevnonblank(lnum - 1)
let prev_syn_sol = s:syn_sol(prev_line_num)
let prev_syn_eol = s:syn_eol(prev_line_num)
let prev_line = s:prev_line(lnum)
let prev_ind = s:prev_indent(lnum)
if s:syn_xmlish(current_syn)
if !s:syn_xmlish(prev_syn_sol)
\ && !s:syn_jsx_escapejs(prev_syn_sol)
\ && !s:syn_jsx_escapejs(prev_syn_eol)
\ && !s:syn_js_comment(prev_syn_sol)
if line =~ '^/\s*>' || line =~ '^<\s*' . s:end_tag
return prev_ind
else
return prev_ind + s:sw()
endif
elseif !s:syn_xmlish(prev_syn_sol) && !s:syn_js_comment(prev_syn_sol) && s:syn_jsx_attrib(current_syn)
" For #79
return prev_ind + s:sw()
" {
" <div></div>
" ##} <--
elseif s:syn_jsx_element(current_syn) && line =~ '}$'
let pair_line = searchpair('{', '', '}', 'b')
return indent(pair_line)
elseif line =~ '^-->$'
if prev_line =~ '^<!--'
return prev_ind
else
return prev_ind - s:sw()
endif
elseif prev_line =~ '-->$'
return prev_ind
" close tag </tag> or /> including </>
elseif prev_line =~ s:end_tag . '$'
if line =~ '^<\s*' . s:end_tag
return prev_ind - s:sw()
elseif s:syn_jsx_attrib(prev_syn_sol)
return prev_ind - s:sw()
else
return prev_ind
endif
elseif line =~ '^\(>\|/\s*>\)'
if prev_line =~ '^<'
return prev_ind
else
return prev_ind - s:sw()
endif
elseif prev_line =~ '^\(<\|>\)' &&
\ (s:syn_xmlish(prev_syn_eol) || s:syn_js_comment(prev_syn_eol))
if line =~ '^<\s*' . s:end_tag
return prev_ind
else
return prev_ind + s:sw()
endif
elseif line =~ '^<\s*' . s:end_tag
if !s:syn_xmlish(prev_syn_sol)
if s:syn_jsx_escapejs(prev_syn_eol)
\ || s:syn_jsx_escapejs(prev_syn_sol)
return prev_ind - s:sw()
else
return prev_ind
endif
elseif prev_line =~ '^\<return'
return prev_ind
else
return prev_ind - s:sw()
endif
elseif !s:syn_xmlish(prev_syn_eol)
if prev_line =~ '\(&&\|||\|=>\|[([{]\|`\)$'
" <div>
" {
" }
" </div>
if line =~ '^[)\]}]'
return prev_ind
else
return prev_ind + s:sw()
endif
else
return prev_ind
endif
else
return prev_ind
endif
elseif s:syn_jsx_escapejs(current_syn)
if line =~ '^}'
let char = getline('.')[col('.') - 1]
" When pressing enter after the }, keep the indent
if char != '}' && search('}', 'b', lnum)
return indent(lnum)
else
let pair_line = searchpair('{', '', '}', 'bW')
return indent(pair_line)
endif
elseif line =~ '^{' || line =~ '^\${'
if s:syn_jsx_escapejs(prev_syn_eol)
\ || s:syn_jsx_attrib(prev_syn_sol)
return prev_ind
elseif s:syn_xmlish(prev_syn_eol) && (prev_line =~ s:end_tag || prev_line =~ '-->$')
return prev_ind
else
return prev_ind + s:sw()
endif
endif
elseif line =~ '^`' && s:syn_jsx_escapejs(current_syn_eol)
" For `} of template syntax
let pair_line = searchpair('{', '', '}', 'bW')
return indent(pair_line)
elseif line =~ '^/[/*]' " js comment in jsx tag
if get(prev_syn_sol, -1) =~ 'Punct'
return prev_ind + s:sw()
elseif synIDattr(synID(lnum - 1, 1, 1), 'name') =~ 'jsxTag'
return prev_ind
else
return a:js_indent()
endif
else
let ind = a:js_indent()
" Issue #68
" return (<div>
" |<div>)
if (line =~ '^/\s*>' || line =~ '^<\s*' . s:end_tag)
\ && !s:syn_xmlish(prev_syn_sol)
return prev_ind
endif
" If current syntax is not a jsx syntax group
if s:syn_xmlish(prev_syn_eol) && line !~ '^[)\]}]'
let sol = matchstr(line, s:opfirst)
if sol is ''
" Fix javascript continue indent
return ind - s:sw()
else
return ind
endif
endif
return ind
endif
endfunction

View File

@@ -1,5 +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
function! julia#set_syntax_version(jvers) function! julia#set_syntax_version(jvers)
if &filetype != "julia" if &filetype != "julia"
echo "Not a Julia file" echo "Not a Julia file"
@@ -184,5 +186,3 @@ function! julia#gotodefinition()
return return
endfunction endfunction
endif

View File

@@ -1,5 +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
" 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')
if exists('g:julia#doc#juliapath') if exists('g:julia#doc#juliapath')
@@ -242,5 +244,3 @@ 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

View File

@@ -1,5 +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
" 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)
@@ -794,5 +796,3 @@ 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

View File

@@ -1,7 +1,9 @@
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
@@ -390,6 +392,7 @@ function! julia_latex_symbols#get_dict()
\ '\trademark': '™', \ '\trademark': '™',
\ '\:tm:': '™', \ '\:tm:': '™',
\ '\bbZ': '', \ '\bbZ': '',
\ '\ohm': 'Ω',
\ '\mho': '℧', \ '\mho': '℧',
\ '\frakZ': '', \ '\frakZ': '',
\ '\turnediota': '℩', \ '\turnediota': '℩',
@@ -496,8 +499,8 @@ function! julia_latex_symbols#get_dict()
\ '\circlearrowright': '↻', \ '\circlearrowright': '↻',
\ '\leftharpoonup': '↼', \ '\leftharpoonup': '↼',
\ '\leftharpoondown': '↽', \ '\leftharpoondown': '↽',
\ '\upharpoonleft': '↾', \ '\upharpoonright': '↾',
\ '\upharpoonright': '↿', \ '\upharpoonleft': '↿',
\ '\rightharpoonup': '⇀', \ '\rightharpoonup': '⇀',
\ '\rightharpoondown': '⇁', \ '\rightharpoondown': '⇁',
\ '\downharpoonright': '⇂', \ '\downharpoonright': '⇂',
@@ -3329,5 +3332,3 @@ function! julia_latex_symbols#get_dict()
\ '\:baggage_claim:': '🛄', \ '\:baggage_claim:': '🛄',
\ '\:left_luggage:': '🛅'} \ '\:left_luggage:': '🛅'}
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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
" Maintainer: Jak Wings " Maintainer: Jak Wings
@@ -532,5 +534,3 @@ 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
View File

@@ -0,0 +1,72 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'puppet') != -1
finish
endif
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

40
autoload/puppet/ctags.vim Normal file
View File

@@ -0,0 +1,40 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'puppet') != -1
finish
endif
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

View File

@@ -0,0 +1,61 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'puppet') != -1
finish
endif
"
" 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
call puppet#format#Indention(l:start_lnum, l:end_lnum)
call puppet#format#Hashrocket(l:start_lnum, l:end_lnum)
call puppet#format#Fallback(l:start_lnum, l:end_lnum)
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
" 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

View File

@@ -1,5 +1,7 @@
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
" this function filters these messages " this function filters these messages
@@ -17,5 +19,3 @@ function! python#utils#fix_qflist() " {{{
call setqflist(l:traceback) call setqflist(l:traceback)
endif endif
endfunction " }}} endfunction " }}}
endif

View File

@@ -1,7 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
if !exists("g:raco_command")
let g:raco_command = system("which raco")
endif
endif

View File

@@ -1,11 +1,12 @@
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
" Maintainer: Mark Guzman <segfault@hasno.info> " Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Maintainer Version: 0.8.1
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
" "
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@@ -55,6 +56,23 @@ if !exists("g:rubycomplete_include_objectspace")
endif endif
" }}} configuration failsafe initialization " }}} configuration failsafe initialization
" {{{ regex patterns
" Regex that defines the start-match for the 'end' keyword.
let s:end_start_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
" Regex that defines the end-match for the 'end' keyword.
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
" }}} regex patterns
" {{{ vim-side support functions " {{{ vim-side support functions
let s:rubycomplete_debug = 0 let s:rubycomplete_debug = 0
@@ -105,7 +123,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
endif endif
let curpos = getpos(".") let curpos = getpos(".")
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' ) let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' )
call cursor(lastpos[1], lastpos[2]) call cursor(lastpos[1], lastpos[2])
if lnum > enum if lnum > enum
@@ -130,19 +148,28 @@ function! s:IsPosInClassDef(pos)
return ret return ret
endfunction endfunction
function! s:IsInComment(pos)
let stack = synstack(a:pos[0], a:pos[1])
if !empty(stack)
return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)'
else
return 0
endif
endfunction
function! s:GetRubyVarType(v) function! s:GetRubyVarType(v)
let stopline = 1 let stopline = 1
let vtp = '' let vtp = ''
let pos = getpos('.') let curpos = getpos('.')
let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$' let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$'
let [lnum,lcol] = searchpos(sstr,'nb',stopline) let [lnum,lcol] = searchpos(sstr,'nb',stopline)
if lnum != 0 && lcol != 0 if lnum != 0 && lcol != 0
call setpos('.',pos) call setpos('.',curpos)
let str = getline(lnum) let str = getline(lnum)
let vtp = substitute(str,sstr,'\1','') let vtp = substitute(str,sstr,'\1','')
return vtp return vtp
endif endif
call setpos('.',pos) call setpos('.',curpos)
let ctors = '\(now\|new\|open\|get_instance' let ctors = '\(now\|new\|open\|get_instance'
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1 if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
let ctors = ctors.'\|find\|create' let ctors = ctors.'\|find\|create'
@@ -152,9 +179,13 @@ function! s:GetRubyVarType(v)
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
let [lnum,lcol] = searchpos(sstr,'nb',stopline) let pos = searchpos(sstr,'bW')
if lnum != 0 && lcol != 0 while pos != [0,0] && s:IsInComment(pos)
let str = matchstr(getline(lnum),fstr,lcol) let pos = searchpos(sstr,'bW')
endwhile
if pos != [0,0]
let [lnum, col] = pos
let str = matchstr(getline(lnum),fstr,col)
let str = substitute(str,'^=\s*','','') let str = substitute(str,'^=\s*','','')
call setpos('.',pos) call setpos('.',pos)
@@ -176,7 +207,7 @@ function! s:GetRubyVarType(v)
end end
return '' return ''
endif endif
call setpos('.',pos) call setpos('.',curpos)
return '' return ''
endfunction endfunction
@@ -673,11 +704,10 @@ class VimRubyCompletion
methods.delete_if { |c| c.match( /'/ ) } methods.delete_if { |c| c.match( /'/ ) }
end end
when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods
dprint "const or cls" dprint "const or cls"
receiver = $1 receiver = $1
methods = Object.constants methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/)
methods.grep(/^#{receiver}/).collect{|e| "::" + e}
when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
receiver = $1 receiver = $1
@@ -686,13 +716,13 @@ class VimRubyCompletion
load_buffer_class( receiver ) load_buffer_class( receiver )
load_buffer_module( receiver ) load_buffer_module( receiver )
begin begin
classes = eval("#{receiver}.constants") constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/)
#methods = eval("#{receiver}.methods") methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/)
rescue Exception rescue Exception
dprint "exception: %s" % $! dprint "exception: %s" % $!
constants = []
methods = [] methods = []
end end
methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
when /^(:[^:.]+)\.([^.]*)$/ # Symbol when /^(:[^:.]+)\.([^.]*)$/ # Symbol
dprint "symbol" dprint "symbol"
@@ -848,5 +878,3 @@ 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

View File

@@ -1,27 +1,65 @@
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
" Last Modified: May 27, 2014 " Last Modified: May 27, 2014
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim " For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" Jump {{{1 function! rust#Load()
function! rust#Load()
" Utility call to get this script loaded, for debugging " Utility call to get this script loaded, for debugging
endfunction endfunction
function! rust#GetConfigVar(name, default) function! rust#GetConfigVar(name, default)
" Local buffer variable with same name takes predeence over global " Local buffer variable with same name takes predeence over global
if has_key(b:, a:name) if has_key(b:, a:name)
return get(b:, a:name) return get(b:, a:name)
endif endif
if has_key(g:, a:name) if has_key(g:, a:name)
return get(g:, a:name) return get(g:, a:name)
endif endif
return a:default return a:default
endfunction endfunction
" Include expression {{{1
function! rust#IncludeExpr(fname) abort
" Remove leading 'crate::' to deal with 2018 edition style 'use'
" statements
let l:fname = substitute(a:fname, '^crate::', '', '')
" Remove trailing colons arising from lines like
"
" use foo::{Bar, Baz};
let l:fname = substitute(l:fname, ':\+$', '', '')
" Replace '::' with '/'
let l:fname = substitute(l:fname, '::', '/', 'g')
" When we have
"
" use foo::bar::baz;
"
" we can't tell whether baz is a module or a function; and we can't tell
" which modules correspond to files.
"
" So we work our way up, trying
"
" foo/bar/baz.rs
" foo/bar.rs
" foo.rs
while l:fname !=# '.'
let l:path = findfile(l:fname)
if !empty(l:path)
return l:fname
endif
let l:fname = fnamemodify(l:fname, ':h')
endwhile
return l:fname
endfunction
" Jump {{{1
function! rust#Jump(mode, function) range function! rust#Jump(mode, function) range
let cnt = v:count1 let cnt = v:count1
@@ -471,7 +509,7 @@ 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') || has('nvim')
let cmd = 'terminal ' let cmd = 'terminal '
else else
let cmd = '!' let cmd = '!'
@@ -487,28 +525,19 @@ function! rust#Test(all, options) abort
return return
endif endif
let mod_name = expand('%:t:r')
if mod_name ==# ''
echohl ErrorMsg
echo 'Cannot extract a module name from file name. Please add ! to command if you want to run all tests'
echohl None
return
endif
let saved = getpos('.') let saved = getpos('.')
try try
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
let spec = mod_name . '::' . func_name
if a:options ==# '' if a:options ==# ''
execute cmd . 'cargo test --manifest-path' manifest spec execute cmd . 'cargo test --manifest-path' manifest func_name
else else
execute cmd . 'cargo test --manifest-path' manifest spec a:options execute cmd . 'cargo test --manifest-path' manifest func_name a:options
endif endif
return return
finally finally
@@ -519,5 +548,3 @@ endfunction
" }}}1 " }}}1
" vim: set et sw=4 sts=4 ts=8: " vim: set et sw=4 sts=4 ts=8:
endif

View File

@@ -1,8 +1,11 @@
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',
@@ -30,7 +33,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',
@@ -46,7 +48,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]))
@@ -101,5 +105,3 @@ 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

View File

@@ -1,5 +1,7 @@
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'
" For this buffer, when delimitMate issues the `User delimitMate_map` " For this buffer, when delimitMate issues the `User delimitMate_map`
@@ -44,5 +46,3 @@ endfunction
" vim: set et sw=4 sts=4 ts=8: " vim: set et sw=4 sts=4 ts=8:
endif

21
autoload/rust/tags.vim Normal file
View File

@@ -0,0 +1,21 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'rust') != -1
finish
endif
" 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
if system('ctags --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:

View File

@@ -1,5 +1,7 @@
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>
" "
" Adapted from https://github.com/fatih/vim-go " Adapted from https://github.com/fatih/vim-go
@@ -147,6 +149,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
call delete(l:stderr_tmpname) call delete(l:stderr_tmpname)
let l:open_lwindow = 0
if v:shell_error == 0 if v:shell_error == 0
" remove undo point caused via BufWritePre " remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry try | silent undojoin | catch | endtry
@@ -167,7 +170,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
if s:got_fmt_error if s:got_fmt_error
let s:got_fmt_error = 0 let s:got_fmt_error = 0
call setloclist(0, []) call setloclist(0, [])
lwindow let l:open_lwindow = 1
endif endif
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0 elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
" otherwise get the errors and put them in the location list " otherwise get the errors and put them in the location list
@@ -199,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
@@ -211,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
@@ -232,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
@@ -248,5 +264,3 @@ endfunction
" vim: set et sw=4 sts=4 ts=8: " vim: set et sw=4 sts=4 ts=8:
endif

View File

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

34
autoload/smt2.vim Normal file
View File

@@ -0,0 +1,34 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'smt2') != -1
finish
endif
" Invokes the solver on current file
function! smt2#RunSolver()
silent !clear
execute "!" . g:smt2_solver_command . " " . bufname("%")
endfunction
" Puts the solver's output in new split (replaces old split)
function! smt2#RunSolverAndShowResult()
let output = system(g:smt2_solver_command . " " . bufname("%") . " 2>&1")
" Create split (or reuse existent)
if exists("s:outputbufnr") && bufwinnr(s:outputbufnr) > 0
execute bufwinnr(s:outputbufnr) . 'wincmd w'
else
silent! vnew
let s:outputbufnr=bufnr('%')
endif
" Clear & (re-)fill contents
silent! normal! ggdG
setlocal filetype=smt2 buftype=nofile nobuflisted noswapfile
call append(0, split(output, '\v\n'))
normal! gg
endfunction
" Requests the solver's version
function! smt2#PrintSolverVersion()
silent !clear
execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch
endfunction

60
autoload/terraform.vim Normal file
View File

@@ -0,0 +1,60 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
finish
endif
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(A, L, P)
return [
\ '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'
\ ]
endfunction

View File

@@ -1,5 +1,7 @@
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>
" Last Change: August 18, 2013 " Last Change: August 18, 2013
@@ -14,5 +16,3 @@ function! vifm#edit#Init()
" Start buffer editing in insert mode " Start buffer editing in insert mode
startinsert startinsert
endfunction endfunction
endif

View File

@@ -1,5 +1,7 @@
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>
" Last Change: November 03, 2018 " Last Change: November 03, 2018
@@ -31,5 +33,3 @@ 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

View File

@@ -1,5 +1,7 @@
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')
function! vital#{s:_plugin_name}#new() abort function! vital#{s:_plugin_name}#new() abort
@@ -9,5 +11,3 @@ 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

View File

@@ -1,5 +1,7 @@
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.
" Do not mofidify the code nor insert new lines before '" ___vital___' " Do not mofidify the code nor insert new lines before '" ___vital___'
@@ -187,5 +189,3 @@ endfunction
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
endif

View File

@@ -1,5 +1,7 @@
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.
" Do not mofidify the code nor insert new lines before '" ___vital___' " Do not mofidify the code nor insert new lines before '" ___vital___'
@@ -464,5 +466,3 @@ 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

View File

@@ -1,5 +1,7 @@
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.
" Do not mofidify the code nor insert new lines before '" ___vital___' " Do not mofidify the code nor insert new lines before '" ___vital___'
@@ -627,5 +629,3 @@ 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

View File

@@ -1,5 +1,7 @@
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.
" Do not mofidify the code nor insert new lines before '" ___vital___' " Do not mofidify the code nor insert new lines before '" ___vital___'
@@ -173,5 +175,3 @@ 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

View File

@@ -1,5 +1,7 @@
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.
" Do not mofidify the code nor insert new lines before '" ___vital___' " Do not mofidify the code nor insert new lines before '" ___vital___'
@@ -178,5 +180,3 @@ 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

View File

@@ -1,5 +1,7 @@
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')
let s:project_root = expand('<sfile>:h:h:h') let s:project_root = expand('<sfile>:h:h:h')
@@ -328,5 +330,3 @@ else
return a:list return a:list
endfunction endfunction
endif endif
endif

View File

@@ -1,10 +1,10 @@
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
Process Process
Web.JSON Web.JSON
ColorEcho ColorEcho
endif

View File

@@ -1,5 +1,7 @@
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
" Maintainer: othree <othree@gmail.com> " Maintainer: othree <othree@gmail.com>
@@ -457,5 +459,3 @@ let g:xmldata_aria = {
\ 'default_role': default_role, \ 'default_role': default_role,
\ 'vimariaattrinfo': aria_attributes_value \ 'vimariaattrinfo': aria_attributes_value
\ } \ }
endif

View File

@@ -1,5 +1,7 @@
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)
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com ) " Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
@@ -870,5 +872,3 @@ let g:xmldata_html5 = {
\ 'wbr': ['/>', ''], \ 'wbr': ['/>', ''],
\ }, \ },
\ } \ }
endif

43
autoload/zig/config.vim Normal file
View File

@@ -0,0 +1,43 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
finish
endif
function! zig#config#ListTypeCommands() abort
return get(g:, 'zig_list_type_commands', {})
endfunction
function! zig#config#ListType() abort
return get(g:, 'zig_list_type', '')
endfunction
function! zig#config#ListAutoclose() abort
return get(g:, 'zig_list_autoclose', 1)
endfunction
function! zig#config#ListHeight() abort
return get(g:, "zig_list_height", 0)
endfunction
function! zig#config#FmtAutosave() abort
return get(g:, "zig_fmt_autosave", 0)
endfunction
function! zig#config#SetFmtAutosave(value) abort
let g:zig_fmt_autosave = a:value
endfunction
function! zig#config#FmtCommand() abort
return get(g:, "zig_fmt_command", ['zig', 'fmt', '--color', 'off'])
endfunction
function! zig#config#FmtFailSilently() abort
return get(g:, "zig_fmt_fail_silently", 0)
endfunction
function! zig#config#FmtExperimental() abort
return get(g:, "zig_fmt_experimental", 0)
endfunction
function! zig#config#Debug() abort
return get(g:, 'zig_debug', [])
endfunction

170
autoload/zig/fmt.vim Normal file
View File

@@ -0,0 +1,170 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'zig') != -1
finish
endif
" Adapted from fatih/vim-go: autoload/go/fmt.vim
"
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
function! zig#fmt#Format() abort
if zig#config#FmtExperimental()
" Using winsaveview to save/restore cursor state has the problem of
" closing folds on save:
" https://github.com/fatih/vim-go/issues/502
" One fix is to use mkview instead. Unfortunately, this sometimes causes
" other bad side effects:
" https://github.com/fatih/vim-go/issues/728
" and still closes all folds if foldlevel>0:
" https://github.com/fatih/vim-go/issues/732
let l:curw = {}
try
mkview!
catch
let l:curw = winsaveview()
endtry
" save our undo file to be restored after we are done. This is needed to
" prevent an additional undo jump due to BufWritePre auto command and also
" restore 'redo' history because it's getting being destroyed every
" BufWritePre
let tmpundofile = tempname()
exe 'wundo! ' . tmpundofile
else
" Save cursor position and many other things.
let l:curw = winsaveview()
endif
" Save cursor position and many other things.
let l:curw = winsaveview()
let bin_name = zig#config#FmtCommand()
" Get current position in file
let current_col = col('.')
let orig_line_count = line('$')
" Save current buffer first, else fmt will run on the original file and we
" will lose our changes.
silent! execute 'write' expand('%')
let [l:out, l:err] = zig#fmt#run(bin_name, expand('%'))
if l:err == 0
call zig#fmt#update_file(expand('%'))
elseif !zig#config#FmtFailSilently()
let errors = s:parse_errors(expand('%'), out)
call s:show_errors(errors)
endif
let diff_offset = line('$') - orig_line_count
if zig#config#FmtExperimental()
" restore our undo history
silent! exe 'rundo ' . tmpundofile
call delete(tmpundofile)
" Restore our cursor/windows positions, folds, etc.
if empty(l:curw)
silent! loadview
else
call winrestview(l:curw)
endif
else
" Restore our cursor/windows positions.
call winrestview(l:curw)
endif
" be smart and jump to the line the new statement was added/removed
call cursor(line('.') + diff_offset, current_col)
" Syntax highlighting breaks less often.
syntax sync fromstart
endfunction
" update_file updates the target file with the given formatted source
function! zig#fmt#update_file(target)
" remove undo point caused via BufWritePre
try | silent undojoin | catch | endtry
" reload buffer to reflect latest changes
silent edit!
let l:listtype = zig#list#Type("ZigFmt")
" the title information was introduced with 7.4-2200
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
if has('patch-7.4.2200')
" clean up previous list
if l:listtype == "quickfix"
let l:list_title = getqflist({'title': 1})
else
let l:list_title = getloclist(0, {'title': 1})
endif
else
" can't check the title, so assume that the list was for go fmt.
let l:list_title = {'title': 'Format'}
endif
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
call zig#list#Clean(l:listtype)
endif
endfunction
" run runs the gofmt/goimport command for the given source file and returns
" the output of the executed command. Target is the real file to be formatted.
function! zig#fmt#run(bin_name, target)
let l:cmd = []
call extend(cmd, a:bin_name)
call extend(cmd, [a:target])
return zig#util#Exec(l:cmd)
endfunction
" parse_errors parses the given errors and returns a list of parsed errors
function! s:parse_errors(filename, content) abort
let splitted = split(a:content, '\n')
" list of errors to be put into location list
let errors = []
for line in splitted
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
if !empty(tokens)
call add(errors,{
\"filename": a:filename,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4],
\ })
endif
endfor
return errors
endfunction
" show_errors opens a location list and shows the given errors. If the given
" errors is empty, it closes the the location list
function! s:show_errors(errors) abort
let l:listtype = zig#list#Type("ZigFmt")
if !empty(a:errors)
call zig#list#Populate(l:listtype, a:errors, 'Format')
echohl Error | echomsg "zig fmt returned error" | echohl None
endif
" this closes the window if there are no errors or it opens
" it if there is any
call zig#list#Window(l:listtype, len(a:errors))
endfunction
function! zig#fmt#ToggleFmtAutoSave() abort
if zig#config#FmtAutosave()
call zig#config#SetFmtAutosave(0)
call zig#util#EchoProgress("auto fmt disabled")
return
end
call zig#config#SetFmtAutosave(1)
call zig#util#EchoProgress("auto fmt enabled")
endfunction
" vim: sw=2 ts=2 et

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