blob: ff3b420c62dba9686596405dccddb74b34f7f718 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
#!/usr/bin/env bash
set -E
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
DIRS_JAVASCRIPT="${DIRS} extras"
DIRS_RM="$DIRS_JAVASCRIPT"
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"
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)"
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
output "${subdirs##, })\n"
done
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)"
if [ -d "$dir${subtree:-/}plugin" ]; then
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")
done
}
concat_ftdetect() {
echo "augroup filetypedetect" > tmp/polyglot.vim
cat config.vim >> tmp/polyglot.vim
for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done
echo "augroup END" >> tmp/polyglot.vim
rm -f ftdetect/*
mv tmp/polyglot.vim ftdetect/
}
update_readme() {
OLD_README="$(cat README.md)"
ed README.md <<- EOF
/Language packs
+2kb
/##
'b,-2c
$(printf -- "$OUTPUT")
.
w
q
EOF
}
PACKS="
applescript:vim-scripts/applescript.vim
ansible:pearofducks/ansible-vim
arduino:sudar/vim-arduino-syntax
blade:jwalton512/vim-blade
c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/vim-cpp
cjsx:mtscout6/vim-cjsx
clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script
cryptol:victoredwardocallaghan/cryptol.vim
crystal:rhysd/vim-crystal
cql:elubow/cql-vim
css:JulesWang/css.vim
cucumber:tpope/vim-cucumber
dart:dart-lang/dart-vim-plugin
dockerfile:honza/dockerfile.vim
elixir:elixir-lang/vim-elixir
elm:lambdatoast/elm.vim
emberscript:yalesov/vim-ember-script
emblem:yalesov/vim-emblem
erlang:vim-erlang/vim-erlang-runtime
fish:dag/vim-fish
git:tpope/vim-git
glsl:tikhomirov/vim-glsl
go:fatih/vim-go:_BASIC
groovy:vim-scripts/groovy.vim
haml:sheerun/vim-haml
handlebars:mustache/vim-mustache-handlebars
haskell:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe
html5:othree/html5.vim
i3:PotatoesMaster/i3-vim-syntax
jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript:_JAVASCRIPT
json:elzr/vim-json
jst:briancollins/vim-jst
jsx:mxw/vim-jsx:_ALL
julia:dcjones/julia-minimalist-vim
kotlin:udalov/kotlin-vim
latex:LaTeX-Box-Team/LaTeX-Box
less:groenewege/vim-less
liquid:tpope/vim-liquid
livescript:gkz/vim-ls
lua:tbastos/vim-lua
mako:sophacles/vim-bundle-mako
markdown:plasticboy/vim-markdown:_SYNTAX
nginx:othree/nginx-contrib-vim
nim:zah/nim.vim:_BASIC
nix:spwhitt/vim-nix
objc:b4winckler/vim-objc
ocaml:jrk/vim-ocaml
octave:vim-scripts/octave.vim--
opencl:petRUShka/vim-opencl
perl:vim-perl/vim-perl
pgsql:exu/pgsql.vim
php:StanAngeloff/php.vim
plantuml:aklt/plantuml-syntax
powershell:PProvost/vim-ps1
protobuf:uarun/vim-protobuf
pug:digitaltoad/vim-pug
puppet:voxpupuli/vim-puppet
purescript:raichoo/purescript-vim
python:mitsuhiko/vim-python-combined
python-compiler:aliev/vim-compiler-python
qml:peterhoeg/vim-qml
r-lang:vim-scripts/R.vim
raml:IN3D/vim-raml
ragel:jneen/ragel.vim
rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby
rust:rust-lang/rust.vim
sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala
scss:cakebaker/scss-syntax.vim
slim:slim-template/vim-slim
solidity:ethereum/vim-solidity
stylus:wavded/vim-stylus
swift:keith/swift.vim
systemd:kurayama/systemd-vim-syntax
terraform:hashivim/vim-terraform
textile:timcharper/textile.vim
thrift:solarnz/thrift.vim
tmux:keith/tmux.vim
tomdoc:wellbredgrapefruit/tomdoc.vim
toml:cespare/vim-toml
twig:lumiliet/vim-twig
typescript:leafgarland/typescript-vim
vala:arrufat/vala.vim
vbnet:vim-scripts/vbnet.vim
vcl:smerrill/vcl-vim-plugin
vue:posva/vim-vue
vm:lepture/vim-velocity
xls:vim-scripts/XSLT-syntax
yaml:stephpy/vim-yaml
yard:sheerun/vim-yardoc
"
rm -rf tmp
rm -rf $DIRS_RM
mkdir tmp
printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"
concat_ftdetect
update_readme
rm -rf tmp
|