Move packages to yaml file

This commit is contained in:
Adam Stankiewicz
2020-08-23 19:39:42 +02:00
parent bc3b36088e
commit f3ab28a287
6 changed files with 1086 additions and 666 deletions

View File

@@ -100,7 +100,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin) - [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin) - [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin) - [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
- [icalenadr](https://github.com/chutzpah/icalendar.vim) (syntax) - [icalendar](https://github.com/chutzpah/icalendar.vim) (syntax)
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin) - [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin) - [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras) - [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
@@ -191,8 +191,8 @@ If you need full functionality of any plugin, please use it directly with your p
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin) - [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax) - [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax) - [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
- [velocity](https://github.com/lepture/vim-velocity) (syntax, indent)
- [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)
- [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) - [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)
@@ -225,13 +225,8 @@ Note that disabling languages won't make in general your vim startup any faster
Language packs are periodically updated using automated `build` script. Language packs are periodically updated using automated `build` script.
Feel free to add your language, and send pull-request. In your pull request, please include: Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `./build` and include that in your PR, send just changes to `packages.yaml` and `build` script if really necessary.
1. How you chose the particular repo from which to pull support for this language.
2. An updated https://github.com/sheerun/vim-polyglot/blob/master/build .
3. If at all possible, absolutely nothing else (in particular, please don't run `build` and include that in your PR).
The easier it is to validate that the new language won't do anything wacky, the faster it'll be merged. In particular, languages that utilize global plugins (loaded for every filetype), or plugins with dangerous features (like `call` based on the contents of a file being edited), will never be merged, as they will be slow or dangerous, respectively.
## License ## License
See linked repositories for detailed license information. See linked repositories for detailed license information. This repository is MIT-licensed.

664
build
View File

@@ -7,6 +7,8 @@ require 'fileutils'
Dir.chdir(__dir__) Dir.chdir(__dir__)
PACKAGES = YAML.load_stream(File.read('packages.yaml'))
BASE_URL = 'https://raw.githubusercontent.com/github/linguist/master' BASE_URL = 'https://raw.githubusercontent.com/github/linguist/master'
DIRS = { DIRS = {
@@ -19,654 +21,6 @@ DIRS = {
go: %w(autoload/go/config.vim syntax compiler indent after/syntax after/indent) go: %w(autoload/go/config.vim syntax compiler indent after/syntax after/indent)
} }
PACKAGES = [
{
name: "acpiasl",
remote: "martinlroth/vim-acpi-asl",
},
{
name: "ansible",
remote: "pearofducks/ansible-vim",
},
{
name: "apiblueprint",
remote: "sheerun/apiblueprint.vim",
},
{
name: "applescript",
remote: "mityu/vim-applescript",
dirs: DIRS[:syntax]
},
{
name: "arduino",
remote: "sudar/vim-arduino-syntax",
},
{
name: "asciidoc",
remote: "asciidoc/vim-asciidoc",
},
{
name: "autohotkey",
remote: "hnamikaw/vim-autohotkey",
},
{
name: "blade",
remote: "jwalton512/vim-blade",
},
{
name: "brewfile",
remote: "bfontaine/Brewfile.vim",
},
{
name: "c++11",
remote: "octol/vim-cpp-enhanced-highlight",
},
{
name: "c/c++",
remote: "vim-jp/vim-cpp",
},
{
name: "caddyfile",
remote: "isobit/vim-caddyfile",
},
{
name: "carp",
remote: "hellerve/carp-vim",
},
{
name: "cjsx",
remote: "mtscout6/vim-cjsx",
},
{
name: "clojure",
remote: "guns/vim-clojure-static",
},
{
name: "cmake",
remote: "pboettch/vim-cmake-syntax",
},
{
name: "coffee-script",
remote: "kchmck/vim-coffee-script",
dirs: DIRS[:noafter]
},
{
name: "cql",
remote: "elubow/cql-vim",
},
{
name: "cryptol",
remote: "victoredwardocallaghan/cryptol.vim",
},
{
name: "crystal",
remote: "rhysd/vim-crystal",
},
{
name: "csv",
remote: "chrisbra/csv.vim",
},
{
name: "cucumber",
remote: "tpope/vim-cucumber",
},
{
name: "cue",
remote: "mgrabovsky/vim-cuesheet",
},
{
name: "dart",
remote: "dart-lang/dart-vim-plugin",
},
{
name: "dhall",
remote: "vmchale/dhall-vim",
},
{
name: "dlang",
remote: "JesseKPhillips/d.vim",
},
{
name: "dockerfile",
remote: "ekalinin/Dockerfile.vim",
},
{
name: "elixir",
remote: "elixir-lang/vim-elixir",
},
{
name: "elm",
remote: "andys8/vim-elm-syntax",
},
{
name: "emberscript",
remote: "yalesov/vim-ember-script",
},
{
name: "emblem",
remote: "yalesov/vim-emblem",
},
{
name: "erlang",
remote: "vim-erlang/vim-erlang-runtime",
},
{
name: "fennel",
remote: "bakpakin/fennel.vim",
},
{
name: "ferm",
remote: "vim-scripts/ferm.vim",
},
{
name: "fish",
remote: "georgewitteman/vim-fish",
},
{
name: "flatbuffers",
remote: "dcharbon/vim-flatbuffers",
},
{
name: "fsharp",
remote: "ionide/Ionide-vim",
dirs: DIRS[:basic]
},
{
name: "gdscript",
remote: "calviken/vim-gdscript3",
dirs: DIRS[:syntax]
},
{
name: "git",
remote: "tpope/vim-git",
},
{
name: "glsl",
remote: "tikhomirov/vim-glsl",
dirs: DIRS[:noafter]
},
{
name: "gmpl",
remote: "maelvalais/gmpl.vim",
},
{
name: "gnuplot",
remote: "vim-scripts/gnuplot-syntax-highlighting",
},
{
name: "go",
remote: "fatih/vim-go",
dirs: DIRS[:go]
},
{
name: "graphql",
remote: "jparise/vim-graphql",
dirs: DIRS[:all]
},
{
name: "gradle",
remote: "tfnico/vim-gradle",
},
{
name: "haml",
remote: "sheerun/vim-haml",
},
{
name: "handlebars",
remote: "sheerun/vim-mustache-handlebars",
},
{
name: "haproxy",
remote: "CH-DanReif/haproxy.vim",
},
{
name: "haskell",
remote: "neovimhaskell/haskell-vim",
},
{
name: "haxe",
remote: "yaymukund/vim-haxe",
},
{
name: "hcl",
remote: "b4b4r07/vim-hcl",
},
{
name: "helm",
remote: "towolf/vim-helm",
},
{
name: "hive",
remote: "zebradil/hive.vim",
},
{
name: "html5",
remote: "othree/html5.vim",
},
{
name: "i3",
remote: "mboughaba/i3config.vim",
},
{
name: "icalenadr",
remote: "chutzpah/icalendar.vim",
},
{
name: "idris",
remote: "idris-hackers/idris-vim",
},
{
name: "ion",
remote: "vmchale/ion-vim",
},
{
name: "javascript",
remote: "pangloss/vim-javascript",
dirs: DIRS[:javascript]
},
{
name: "jenkins",
remote: "martinda/Jenkinsfile-vim-syntax",
},
{
name: "jinja",
remote: "lepture/vim-jinja",
},
{
name: "jq",
remote: "vito-c/jq.vim",
},
{
name: "json5",
remote: "GutenYe/json5.vim",
},
{
name: "json",
remote: "elzr/vim-json",
},
{
name: "jsonnet",
remote: "google/vim-jsonnet",
},
{
name: "jst",
remote: "briancollins/vim-jst",
},
{
name: "jsx",
remote: "MaxMEllon/vim-jsx-pretty",
dirs: DIRS[:all]
},
{
name: "julia",
remote: "JuliaEditorSupport/julia-vim",
},
{
name: "kotlin",
remote: "udalov/kotlin-vim",
},
{
name: "ledger",
remote: "ledger/vim-ledger",
dirs: DIRS[:basic]
},
{
name: "less",
remote: "groenewege/vim-less",
dirs: DIRS[:noafter]
},
{
name: "lilypond",
remote: "anowlcalledjosh/vim-lilypond",
},
{
name: "livescript",
remote: "gkz/vim-ls",
},
{
name: "llvm",
remote: "rhysd/vim-llvm",
},
{
name: "log",
remote: "MTDL9/vim-log-highlighting",
},
{
name: "lua",
remote: "tbastos/vim-lua",
},
{
name: "mako",
remote: "sophacles/vim-bundle-mako",
},
{
name: "markdown",
remote: "plasticboy/vim-markdown",
dirs: DIRS[:noafter]
},
{
name: "mathematica",
remote: "voldikss/vim-mma",
},
{
name: "mdx",
remote: "jxnblk/vim-mdx-js",
},
{
name: "meson",
remote: "mesonbuild/meson:data/syntax-highlighting/vim",
dirs: DIRS[:all]
},
{
name: "moonscript",
remote: "leafo/moonscript-vim",
},
{
name: "nginx",
remote: "chr4/nginx.vim",
},
{
name: "nim",
remote: "zah/nim.vim",
dirs: DIRS[:basic]
},
{
name: "nix",
remote: "LnL7/vim-nix",
},
{
name: "objc",
remote: "b4winckler/vim-objc",
},
{
name: "ocaml",
remote: "rgrinberg/vim-ocaml",
},
{
name: "octave",
remote: "McSinyx/vim-octave",
},
{
name: "opencl",
remote: "petRUShka/vim-opencl",
},
{
name: "perl",
remote: "vim-perl/vim-perl",
},
{
name: "pgsql",
remote: "lifepillar/pgsql.vim",
},
{
name: "php",
remote: "StanAngeloff/php.vim",
},
{
name: "plantuml",
remote: "aklt/plantuml-syntax",
},
{
name: "pony",
remote: "jakwings/vim-pony",
},
{
name: "powershell",
remote: "PProvost/vim-ps1",
},
{
name: "protobuf",
remote: "uarun/vim-protobuf",
},
{
name: "pug",
remote: "digitaltoad/vim-pug",
},
{
name: "puppet",
remote: "rodjek/vim-puppet",
},
{
name: "purescript",
remote: "purescript-contrib/purescript-vim",
},
{
name: "python-compiler",
remote: "aliev/vim-compiler-python",
},
{
name: "python-indent",
remote: "Vimjas/vim-python-pep8-indent",
},
{
name: "python",
remote: "vim-python/python-syntax",
},
{
name: "qmake",
remote: "artoj/qmake-syntax-vim",
},
{
name: "qml",
remote: "peterhoeg/vim-qml",
},
{
name: "r-lang",
remote: "vim-scripts/R.vim",
dirs: DIRS[:basic]
},
{
name: "racket",
remote: "wlangstroth/vim-racket",
},
{
name: "ragel",
remote: "jneen/ragel.vim",
},
{
name: "raku",
remote: "Raku/vim-raku",
},
{
name: "raml",
remote: "IN3D/vim-raml",
},
{
name: "razor",
remote: "adamclerk/vim-razor",
},
{
name: "reason",
remote: "reasonml-editor/vim-reason-plus",
},
{
name: "requirements",
remote: "raimon49/requirements.txt.vim",
},
{
name: "rspec",
remote: "keith/rspec.vim",
},
{
name: "rst",
remote: "marshallward/vim-restructuredtext",
},
{
name: "ruby",
remote: "vim-ruby/vim-ruby",
},
{
name: "rust",
remote: "rust-lang/rust.vim",
},
{
name: "sbt",
remote: "derekwyatt/vim-sbt",
},
{
name: "scala",
remote: "derekwyatt/vim-scala",
},
{
name: "scss",
remote: "cakebaker/scss-syntax.vim",
},
{
name: "sh",
remote: "arzg/vim-sh",
},
{
name: "slim",
remote: "slim-template/vim-slim",
},
{
name: "slime",
remote: "slime-lang/vim-slime-syntax",
},
{
name: "smt2",
remote: "bohlender/vim-smt2",
},
{
name: "solidity",
remote: "tomlion/vim-solidity",
},
{
name: "sql",
remote: "shmup/vim-sql-syntax",
},
{
name: "stylus",
remote: "wavded/vim-stylus",
},
{
name: "svelte",
remote: "evanleck/vim-svelte@main",
},
{
name: "svg-indent",
remote: "jasonshell/vim-svg-indent",
},
{
name: "svg",
remote: "vim-scripts/svg.vim",
},
{
name: "swift",
remote: "keith/swift.vim",
},
{
name: "sxhkd",
remote: "baskerville/vim-sxhkdrc",
},
{
name: "systemd",
remote: "wgwoods/vim-systemd-syntax",
},
{
name: "terraform",
remote: "hashivim/vim-terraform",
},
{
name: "textile",
remote: "timcharper/textile.vim",
},
{
name: "thrift",
remote: "solarnz/thrift.vim",
},
{
name: "tmux",
remote: "ericpruitt/tmux.vim:vim",
dirs: DIRS[:all]
},
{
name: "tomdoc",
remote: "wellbredgrapefruit/tomdoc.vim",
},
{
name: "toml",
remote: "cespare/vim-toml",
},
{
name: "tptp",
remote: "c-cube/vim-tptp",
},
{
name: "twig",
remote: "lumiliet/vim-twig",
},
{
name: "typescript",
remote: "HerringtonDarkholme/yats.vim",
},
{
name: "unison",
remote: "unisonweb/unison@trunk:editor-support/vim",
dirs: DIRS[:all]
},
{
name: "v",
remote: "ollykel/v-vim",
},
{
name: "vala",
remote: "arrufat/vala.vim",
},
{
name: "vbnet",
remote: "vim-scripts/vbnet.vim",
},
{
name: "vcl",
remote: "smerrill/vcl-vim-plugin",
},
{
name: "vifm",
remote: "vifm/vifm.vim",
},
{
name: "vm",
remote: "lepture/vim-velocity",
},
{
name: "vue",
remote: "posva/vim-vue",
},
{
name: "xdc",
remote: "amal-khailtash/vim-xdc-syntax",
},
{
name: "xml",
remote: "amadeus/vim-xml",
},
{
name: "xls",
remote: "vim-scripts/XSLT-syntax",
},
{
name: "yaml",
remote: "stephpy/vim-yaml",
},
{
name: "yard",
remote: "sheerun/vim-yardoc",
},
{
name: "zephir",
remote: "xwsoul/vim-zephir",
},
{
name: "zig",
remote: "ziglang/zig.vim",
},
{
name: "zinit",
remote: "zinit-zsh/zplugin-vim-syntax",
}
]
def parallel(*procs) def parallel(*procs)
threads = procs.map { |p| Thread.new { method(p).call } } threads = procs.map { |p| Thread.new { method(p).call } }
threads.map(&:join).map(&:value) threads.map(&:join).map(&:value)
@@ -751,12 +105,14 @@ end
def copy_file(package, src, dest) def copy_file(package, src, dest)
return unless [".vim", ".ctags", ".vital"].include?(File.extname(src)) return unless [".vim", ".ctags", ".vital"].include?(File.extname(src))
FileUtils.mkdir_p(File.dirname(dest)) FileUtils.mkdir_p(File.dirname(dest))
name = package.fetch("name")
open(src, "r") do |input| open(src, "r") do |input|
open(dest, "a+") do |output| open(dest, "a+") do |output|
if package[:name] == "jsx" if name == "jsx"
output << "if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n\n" output << "if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n\n"
else else
output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{package[:name]}') == -1\n\n" output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{name}') == -1\n\n"
end end
IO.copy_stream(input, output) IO.copy_stream(input, output)
output << "\nendif\n" output << "\nendif\n"
@@ -769,7 +125,7 @@ def download
PACKAGES.map do |package| PACKAGES.map do |package|
Thread.new do Thread.new do
repo, branch, path = parse_remote(package[:remote]) repo, branch, path = parse_remote(package.fetch("remote"))
dir = "tmp/" + repo.split('/')[1] dir = "tmp/" + repo.split('/')[1]
FileUtils.mkdir_p(dir) FileUtils.mkdir_p(dir)
url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}" url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}"
@@ -798,10 +154,10 @@ def extract
output = [] output = []
PACKAGES.map do |package| PACKAGES.map do |package|
repo, branch, path = parse_remote(package[:remote]) repo, branch, path = parse_remote(package["remote"])
dir = "tmp/" + repo.split('/')[1] dir = "tmp/" + repo.split('/')[1]
subdirs = [] subdirs = []
for subdir in package.fetch(:dirs, DIRS[:default]) for subdir in DIRS.fetch(package.fetch("dirs", "default").to_sym)
subtree = "#{dir}/#{path ? path + "/" : ""}" subtree = "#{dir}/#{path ? path + "/" : ""}"
subpath = "#{subtree}#{subdir}" subpath = "#{subtree}#{subdir}"
if FileTest.directory?(subpath) if FileTest.directory?(subpath)
@@ -816,7 +172,7 @@ def extract
end end
end end
output << "- [#{package[:name]}](https://github.com/#{repo}) (#{subdirs.uniq.join(", ")})" output << "- [#{package["name"]}](https://github.com/#{repo}) (#{subdirs.uniq.join(", ")})"
progress progress
end end

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'velocity') == -1
if exists("b:did_indent") if exists("b:did_indent")
finish finish

1069
packages.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'icalenadr') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'icalendar') == -1
" Vim syntax file " Vim syntax file
" Language: icalendar <http://www.ietf.org/rfc/rfc2445.txt> " Language: icalendar <http://www.ietf.org/rfc/rfc2445.txt>

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'velocity') == -1
" Vim syntax file " Vim syntax file
" Language: Velocity HTML template " Language: Velocity HTML template