vim-polyglot/build

133 lines
3.2 KiB
Plaintext
Raw Normal View History

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
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
2013-09-12 09:50:45 -04:00
download() {
for pack in $1; do
path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
rm -rf "$dir"
(git clone -q --recursive "https://github.com/$path.git" "$dir" && 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)"
printf -- "- [$name](https://github.com/$path) ("
subdirs=""
for subdir in $DIRS; do
if [ -d "$dir/$subdir" ]; then
base="$(basename "$subdir")"
if [[ "$subdirs" != *"$base"* ]]; then
subdirs="$subdirs, $base"
fi
copy_dir "$dir" "$subdir"
fi
done
2013-09-16 19:53:14 -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)"
if [ -d "$dir/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")"
cat $file >> $file_path/$(basename "$file")
2013-09-12 09:50:45 -04:00
done
}
concat_ftdetect() {
cat ftdetect/* | grep -E '^[^"]' > tmp/polyglot.vim
rm -f ftdetect/*
mv tmp/polyglot.vim ftdetect/
}
PACKS="
arduino:sudar/vim-arduino-syntax
c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/cpp-vim
clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script
csv:chrisbra/csv.vim
cucumber:tpope/vim-cucumber
2013-09-26 06:48:01 -04:00
dockerfile:honza/dockerfile.vim
elixir:elixir-lang/vim-elixir
2014-04-14 19:14:47 -04:00
emberscript:heartsentwined/vim-ember-script
erlang:oscarh/vimerl
git:tpope/vim-git
go:jnwhiteh/vim-golang
haml:tpope/vim-haml
handlebars:mustache/vim-mustache-handlebars
haskell:travitch/hasksyn
html5:othree/html5.vim
jade:digitaltoad/vim-jade
2014-04-14 19:12:18 -04:00
jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript
json:leshill/vim-json
jst:briancollins/vim-jst
latex:LaTeX-Box-Team/LaTeX-Box
less:groenewege/vim-less
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
php:StanAngeloff/php.vim
2014-04-14 19:26:34 -04:00
puppet:rodjek/vim-puppet
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
rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby
2013-09-26 06:44:31 -04:00
rust:wting/rust.vim
sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala
slim:slim-template/vim-slim
stylus:wavded/vim-stylus
textile:timcharper/textile.vim
tmux:acustodioo/vim-tmux
tomdoc:duwanis/tomdoc.vim
2013-09-26 06:41:08 -04:00
typescript:leafgarland/typescript-vim
vbnet:vim-scripts/vbnet.vim
2014-04-14 19:16:56 -04:00
toml:cespare/vim-toml
twig:beyondwords/vim-twig
xls:vim-scripts/XSLT-syntax
2014-03-17 20:27:17 -04:00
yard:sheerun/vim-yardoc
2014-04-14 19:23:13 -04:00
css-color:ap/vim-css-color
"
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
printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"
concat_ftdetect
rm -rf tmp