vim-polyglot/build

228 lines
5.8 KiB
Plaintext
Raw Normal View History

2013-09-14 20:48:46 +02:00
#!/usr/bin/env bash
2013-09-12 15:50:45 +02:00
2013-09-12 16:12:52 +02:00
set -E
2013-09-12 15:50:45 +02:00
DIRS="syntax indent compiler autoload ftplugin after/syntax after/indent after/ftplugin"
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
DIRS_ALL="syntax indent compiler autoload ftplugin after"
DIRS_SYNTAX="syntax after/syntax"
DIRS_JAVASCRIPT="${DIRS} extras"
2016-09-11 13:42:21 +02:00
DIRS_RM="$DIRS_JAVASCRIPT"
2013-09-12 15:50:45 +02:00
2015-07-18 22:34:26 +02:00
OUTPUT=""
output() {
OUTPUT="$OUTPUT$1"
printf -- "$1"
}
download() {
for pack in $1; do
path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
rm -rf "$dir"
(mkdir -p "$dir" && curl --silent -L https://codeload.github.com/$path/tar.gz/master | tar -zx -C "$dir" --strip 1 && printf '.') &
done
wait
}
extract() {
printf "\n"
cat config.vim >> tmp/polyglot.vim
for pack in $1; do
name="$(printf "$pack" | cut -d ':' -f 1)"
path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
subtree="$(printf "$pack" | cut -d ':' -f 4)"
2015-07-18 22:34:26 +02:00
output "- [$name](https://github.com/$path) ("
subdirs=""
for subdir in ${!directories}; do
if [ -d "${dir}${subtree:-/}${subdir}" ]; then
base="$(basename "$subdir")"
if [[ "$subdirs" != *"$base"* ]]; then
subdirs="$subdirs, $base"
fi
copy_dir "${dir}${subtree}" "$subdir" "$name"
fi
done
for f in ${dir}/ftdetect/*; do
(
echo "augroup filetypedetect";
echo '" '"$pack";
cat "${f}";
echo "augroup END";
echo
) >> tmp/polyglot.vim;
done
2013-09-17 01:53:14 +02:00
2015-07-18 22:34:26 +02:00
output "${subdirs##, })\n"
done
2013-09-17 01:53:14 +02:00
mv tmp/polyglot.vim ftdetect/
2013-09-17 01:53:14 +02:00
for pack in $1; do
name="$(printf "$pack" | cut -d ':' -f 1)"
path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
subtree="$(printf "$pack" | cut -d ':' -f 4)"
2013-09-17 01:53:14 +02:00
if [ -d "$dir${subtree:-/}plugin" ]; then
2013-09-17 01:53:14 +02:00
printf "Possible error (plugin directory exists): $path\n"
fi
done
}
copy_dir() {
for file in $(find "$1/$2" -name '*.vim'); do
file_path="$(dirname "${file##$1/}")"
mkdir -p "$file_path"
touch "$file_path/$(basename "$file")"
# Use comma instead of / to handle cases like c/c++
sed -e "s,%%PACK%%,$3," -e "/%%CONTENT%%/{r $file" -e "d;}" plugin_guard.vim.template >> $file_path/$(basename "$file")
2013-09-12 15:50:45 +02:00
done
}
2015-07-18 22:34:26 +02:00
update_readme() {
OLD_README="$(cat README.md)"
ed README.md <<- EOF
/Language packs
+2kb
/##
'b,-2c
$(printf -- "$OUTPUT" | sort)
2015-07-18 22:34:26 +02:00
.
w
q
EOF
}
PACKS="
2017-03-23 13:21:01 +01:00
apiblueprint:sheerun/apiblueprint.vim
2016-07-26 14:08:59 +02:00
applescript:vim-scripts/applescript.vim
2017-05-17 11:18:30 +02:00
asciidoc:asciidoc/vim-asciidoc
yaml:stephpy/vim-yaml
2015-12-17 10:48:07 +01:00
ansible:pearofducks/ansible-vim
arduino:sudar/vim-arduino-syntax
2017-09-27 20:14:30 +02:00
autohotkey:hnamikaw/vim-autohotkey
2015-12-06 11:31:01 +01:00
blade:jwalton512/vim-blade
c++11:octol/vim-cpp-enhanced-highlight
2015-12-06 11:31:01 +01:00
c/c++:vim-jp/vim-cpp
caddyfile:isobit/vim-caddyfile
2015-10-24 13:06:19 +03:00
cjsx:mtscout6/vim-cjsx
clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script
2016-05-02 10:44:59 +02:00
cryptol:victoredwardocallaghan/cryptol.vim
2016-05-02 10:49:45 +02:00
crystal:rhysd/vim-crystal
2015-12-28 14:58:35 +01:00
cql:elubow/cql-vim
cucumber:tpope/vim-cucumber
2015-12-06 11:38:02 +01:00
dart:dart-lang/dart-vim-plugin
dockerfile:docker/docker::/contrib/syntax/vim/
elixir:elixir-lang/vim-elixir
2017-09-27 20:52:13 +02:00
elm:ElmCast/elm-vim
emberscript:yalesov/vim-ember-script
2016-07-05 02:55:06 -05:00
emblem:yalesov/vim-emblem
erlang:vim-erlang/vim-erlang-runtime
2016-05-02 10:46:45 +02:00
fish:dag/vim-fish
2017-09-27 20:19:38 +02:00
fsharp:fsharp/vim-fsharp:_BASIC
git:tpope/vim-git
gmpl:maelvalais/gmpl.vim
glsl:tikhomirov/vim-glsl
2017-03-23 11:49:10 +01:00
gnuplot:vim-scripts/gnuplot-syntax-highlighting
go:fatih/vim-go:_BASIC
2015-10-10 17:17:57 +02:00
groovy:vim-scripts/groovy.vim
haml:sheerun/vim-haml
handlebars:mustache/vim-mustache-handlebars
haskell:neovimhaskell/haskell-vim
2014-06-08 13:22:29 +02:00
haxe:yaymukund/vim-haxe
html5:othree/html5.vim
2017-02-02 21:54:55 +01:00
i3:PotatoesMaster/i3-vim-syntax
2014-04-15 01:12:18 +02:00
jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript:_JAVASCRIPT
jenkins:martinda/Jenkinsfile-vim-syntax
json:elzr/vim-json
jst:briancollins/vim-jst
2015-07-18 23:00:08 +02:00
jsx:mxw/vim-jsx:_ALL
2015-10-24 13:06:19 +03:00
julia:dcjones/julia-minimalist-vim
kotlin:udalov/kotlin-vim
latex:LaTeX-Box-Team/LaTeX-Box
less:groenewege/vim-less
2014-06-08 19:38:42 +02:00
liquid:tpope/vim-liquid
2016-07-26 14:06:32 +02:00
livescript:gkz/vim-ls
2016-07-26 13:58:55 +02:00
lua:tbastos/vim-lua
2016-05-13 15:56:51 +02:00
mako:sophacles/vim-bundle-mako
2016-06-26 18:13:30 +02:00
markdown:plasticboy/vim-markdown:_SYNTAX
2017-03-23 12:11:44 +01:00
mathematica:rsmenon/vim-mathematica
nginx:chr4/nginx.vim
2016-01-22 09:12:18 +01:00
nim:zah/nim.vim:_BASIC
2017-11-19 21:34:38 +01:00
nix:LnL7/vim-nix
objc:b4winckler/vim-objc
ocaml:jrk/vim-ocaml
octave:vim-scripts/octave.vim--
2014-03-16 14:52:12 +01:00
opencl:petRUShka/vim-opencl
2013-09-17 17:37:59 +02:00
perl:vim-perl/vim-perl
2016-05-02 10:52:01 +02:00
pgsql:exu/pgsql.vim
php:StanAngeloff/php.vim
2016-05-02 10:50:59 +02:00
plantuml:aklt/plantuml-syntax
powershell:PProvost/vim-ps1
2013-09-14 11:36:13 +02:00
protobuf:uarun/vim-protobuf
2016-05-02 11:52:54 +02:00
pug:digitaltoad/vim-pug
puppet:voxpupuli/vim-puppet
purescript:purescript-contrib/purescript-vim
2014-04-15 01:18:16 +02:00
python:mitsuhiko/vim-python-combined
2016-09-11 13:25:03 +02:00
python-compiler:aliev/vim-compiler-python
2015-10-10 17:25:38 +02:00
qml:peterhoeg/vim-qml
2015-10-24 13:06:19 +03:00
r-lang:vim-scripts/R.vim
2017-05-17 11:46:19 +02:00
racket:wlangstroth/vim-racket
raml:IN3D/vim-raml
2015-12-31 18:27:37 +01:00
ragel:jneen/ragel.vim
rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby
2015-11-20 15:47:50 +01:00
rust:rust-lang/rust.vim
sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala
scss:cakebaker/scss-syntax.vim
slim:slim-template/vim-slim
2017-09-27 20:08:01 +02:00
solidity:tomlion/vim-solidity
stylus:wavded/vim-stylus
2015-12-05 21:05:04 -04:00
swift:keith/swift.vim
2017-03-23 12:48:17 +01:00
sxhkd:baskerville/vim-sxhkdrc
2015-10-24 13:06:19 +03:00
systemd:kurayama/systemd-vim-syntax
2017-02-02 21:44:42 +01:00
terraform:hashivim/vim-terraform
textile:timcharper/textile.vim
2015-10-24 13:06:19 +03:00
thrift:solarnz/thrift.vim
2016-06-26 18:03:28 +02:00
tmux:keith/tmux.vim
2015-12-06 11:31:01 +01:00
tomdoc:wellbredgrapefruit/tomdoc.vim
2014-04-15 01:16:56 +02:00
toml:cespare/vim-toml
2016-09-11 13:50:56 +02:00
twig:lumiliet/vim-twig
2015-10-24 13:06:19 +03:00
typescript:leafgarland/typescript-vim
vala:arrufat/vala.vim
2015-10-24 13:06:19 +03:00
vbnet:vim-scripts/vbnet.vim
2015-12-06 11:34:19 +01:00
vcl:smerrill/vcl-vim-plugin
2017-09-27 20:23:42 +02:00
vifm:vifm/vifm.vim
2017-02-02 21:49:51 +01:00
vue:posva/vim-vue
2014-12-22 22:01:38 +01:00
vm:lepture/vim-velocity
2015-10-24 13:06:19 +03:00
xls:vim-scripts/XSLT-syntax
yard:sheerun/vim-yardoc
"
2013-09-14 20:10:55 +02:00
rm -rf tmp
2016-09-11 13:42:21 +02:00
rm -rf $DIRS_RM
2013-09-16 17:46:24 +02:00
mkdir tmp
2013-09-14 20:10:55 +02:00
printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"
2015-07-18 22:34:26 +02:00
update_readme
rm -rf tmp