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