vim-polyglot/build

106 lines
2.4 KiB
Plaintext
Raw Normal View History

2013-09-13 10:08:00 -04:00
#!/bin/sh
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
# Fetches syntax files from given Github repo
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) ("
# which tree > /dev/null && tree tmp
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
printf "${subdirs##, })\n"
done
}
copy_dir() {
for file in $(find "$1/$2" -name '*.vim'); do
file_path="$(dirname "${file##$1/}")"
mkdir -p "$file_path"
cp $file $file_path/
2013-09-12 09:50:45 -04:00
done
}
2013-09-12 10:12:52 -04:00
rm -rf tmp
2013-09-12 09:50:45 -04:00
rm -rf $DIRS
2013-09-12 10:12:52 -04:00
mkdir -p tmp
2013-09-12 09:50:45 -04:00
PACKS="
arduino:sudar/vim-arduino-syntax
bundler:tpope/vim-bundler
c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/cpp-vim
clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script
css-color:ap/vim-css-color
csv:chrisbra/csv.vim
cucumber:tpope/vim-cucumber
elixir:elixir-lang/vim-elixir
erlang:jimenezrick/vimerl
git:tpope/vim-git
go:jnwhiteh/vim-golang
haml:tpope/vim-haml
handlebars:nono/vim-handlebars
haskell:travitch/hasksyn
html5:othree/html5.vim
javascript:pangloss/vim-javascript
json:leshill/vim-json
jst:briancollins/vim-jst
latex:jcf/vim-latex
less:groenewege/vim-less
markdown:tpope/vim-markdown
nginx:mutewinter/nginx.vim
ocaml:jrk/vim-ocaml
octave:vim-scripts/octave.vim--
php:spf13/PIV
puppet:ajf/puppet-vim
python:vim-scripts/python.vim--Vasiliev
rspec:skwp/vim-rspec
ruby:vim-ruby/vim-ruby
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:mutewinter/tomdoc.vim
vbnet:vim-scripts/vbnet.vim
twig:beyondwords/vim-twig
xls:vim-scripts/XSLT-syntax
"
printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"
rm -rf tmp