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
|
|
|
|
2013-09-13 16:12:52 -04:00
|
|
|
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
2014-08-12 18:55:50 -04:00
|
|
|
DIRS_BASIC="syntax indent ftdetect after/syntax after/indent after/ftdetect"
|
2013-09-12 09:50:45 -04:00
|
|
|
|
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"
|
2013-09-13 16:12:52 -04:00
|
|
|
(git clone -q --recursive "https://github.com/$path.git" "$dir" && printf '.') &
|
2013-09-13 10:18:38 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
wait
|
|
|
|
}
|
|
|
|
|
|
|
|
extract() {
|
2013-09-13 16:12:52 -04:00
|
|
|
printf "\n"
|
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)"
|
2013-09-13 16:12:52 -04:00
|
|
|
printf -- "- [$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
|
|
|
|
|
2014-12-22 15:56:09 -05:00
|
|
|
copy_dir "${dir}${subtree}" "$subdir"
|
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
|
|
|
|
2013-09-16 19:53:14 -04:00
|
|
|
|
2013-09-13 16:12:52 -04:00
|
|
|
printf "${subdirs##, })\n"
|
|
|
|
done
|
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() {
|
|
|
|
for file in $(find "$1/$2" -name '*.vim'); do
|
|
|
|
file_path="$(dirname "${file##$1/}")"
|
|
|
|
mkdir -p "$file_path"
|
2013-12-26 15:09:58 -05:00
|
|
|
touch "$file_path/$(basename "$file")"
|
2013-12-25 22:05:26 -05:00
|
|
|
cat $file >> $file_path/$(basename "$file")
|
2013-09-12 09:50:45 -04:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
concat_ftdetect() {
|
|
|
|
cat ftdetect/* | grep -E '^[^"]' > tmp/polyglot.vim
|
|
|
|
rm -f ftdetect/*
|
|
|
|
mv tmp/polyglot.vim ftdetect/
|
|
|
|
}
|
|
|
|
|
2013-09-13 10:18:38 -04:00
|
|
|
PACKS="
|
2013-09-13 15:35:46 -04:00
|
|
|
arduino:sudar/vim-arduino-syntax
|
2014-08-12 18:10:32 -04:00
|
|
|
blade:xsbeats/vim-blade
|
2013-09-13 15:35:46 -04:00
|
|
|
c++11:octol/vim-cpp-enhanced-highlight
|
|
|
|
c/c++:vim-jp/cpp-vim
|
|
|
|
clojure:guns/vim-clojure-static
|
|
|
|
coffee-script:kchmck/vim-coffee-script
|
2014-08-12 18:14:53 -04:00
|
|
|
css:JulesWang/css.vim
|
2013-09-13 15:35:46 -04:00
|
|
|
cucumber:tpope/vim-cucumber
|
2013-09-26 06:48:01 -04:00
|
|
|
dockerfile:honza/dockerfile.vim
|
2013-09-13 15:35:46 -04:00
|
|
|
elixir:elixir-lang/vim-elixir
|
2014-04-14 19:14:47 -04:00
|
|
|
emberscript:heartsentwined/vim-ember-script
|
2014-08-12 18:03:22 -04:00
|
|
|
emblem:heartsentwined/vim-emblem
|
2014-12-11 16:58:14 -05:00
|
|
|
erlang:hcs42/vim-erlang-runtime
|
2013-09-13 15:35:46 -04:00
|
|
|
git:tpope/vim-git
|
2014-08-12 18:55:50 -04:00
|
|
|
go:fatih/vim-go:_BASIC
|
2013-09-13 15:35:46 -04:00
|
|
|
haml:tpope/vim-haml
|
2014-02-04 13:15:58 -05:00
|
|
|
handlebars:mustache/vim-mustache-handlebars
|
2013-09-13 15:35:46 -04:00
|
|
|
haskell:travitch/hasksyn
|
2014-06-08 07:22:29 -04:00
|
|
|
haxe:yaymukund/vim-haxe
|
2013-09-13 15:35:46 -04:00
|
|
|
html5:othree/html5.vim
|
2013-09-14 05:38:54 -04:00
|
|
|
jade:digitaltoad/vim-jade
|
2014-04-14 19:12:18 -04:00
|
|
|
jasmine:glanotte/vim-jasmine
|
2013-09-13 15:35:46 -04:00
|
|
|
javascript:pangloss/vim-javascript
|
2015-03-09 00:50:10 -04:00
|
|
|
json:sheerun/vim-json
|
2013-09-13 15:35:46 -04:00
|
|
|
jst:briancollins/vim-jst
|
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
|
2013-09-13 15:35:46 -04:00
|
|
|
markdown:tpope/vim-markdown
|
|
|
|
nginx:mutewinter/nginx.vim
|
|
|
|
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
|
2013-09-14 12:11:57 -04:00
|
|
|
php:StanAngeloff/php.vim
|
2014-04-14 19:26:34 -04:00
|
|
|
puppet:rodjek/vim-puppet
|
2014-12-11 17:16:49 -05:00
|
|
|
powershell:Persistent13/vim-ps1
|
2013-09-14 05:36:13 -04:00
|
|
|
protobuf:uarun/vim-protobuf
|
2014-04-14 19:18:16 -04:00
|
|
|
python:mitsuhiko/vim-python-combined
|
2013-09-30 06:04:53 -04:00
|
|
|
r-lang:vim-scripts/R.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
|
2013-09-26 06:44:31 -04:00
|
|
|
rust:wting/rust.vim
|
2013-09-13 15:35:46 -04:00
|
|
|
sbt:derekwyatt/vim-sbt
|
|
|
|
scala:derekwyatt/vim-scala
|
|
|
|
slim:slim-template/vim-slim
|
|
|
|
stylus:wavded/vim-stylus
|
2014-06-08 07:57:13 -04:00
|
|
|
systemd:kurayama/systemd-vim-syntax
|
2014-08-12 18:17:05 -04:00
|
|
|
swift:toyamarinyon/vim-swift
|
2013-09-13 15:35:46 -04:00
|
|
|
textile:timcharper/textile.vim
|
2014-12-11 17:11:43 -05:00
|
|
|
tmux:tejr/vim-tmux
|
2013-09-14 12:22:55 -04:00
|
|
|
tomdoc:duwanis/tomdoc.vim
|
2013-09-26 06:41:08 -04:00
|
|
|
typescript:leafgarland/typescript-vim
|
2013-09-13 15:35:46 -04:00
|
|
|
vbnet:vim-scripts/vbnet.vim
|
2014-12-11 17:02:50 -05:00
|
|
|
thrift:solarnz/thrift.vim
|
2014-04-14 19:16:56 -04:00
|
|
|
toml:cespare/vim-toml
|
2013-09-13 15:35:46 -04:00
|
|
|
twig:beyondwords/vim-twig
|
|
|
|
xls:vim-scripts/XSLT-syntax
|
2014-03-17 20:27:17 -04:00
|
|
|
yard:sheerun/vim-yardoc
|
2014-12-11 17:09:07 -05:00
|
|
|
vala:tkztmk/vim-vala
|
2014-12-22 16:01:38 -05:00
|
|
|
vm:lepture/vim-velocity
|
2014-04-14 19:23:13 -04:00
|
|
|
css-color:ap/vim-css-color
|
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
|
|
|
|
rm -rf $DIRS
|
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"
|
2013-09-16 10:53:38 -04:00
|
|
|
concat_ftdetect
|
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
|