Ajout : rangement.
[tool/hledger.git] / vim / install
diff --git a/vim/install b/vim/install
new file mode 100755 (executable)
index 0000000..fa5aa88
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh -eux
+test -L "$0" && tool="$(readlink -e "$0")" || tool=$0
+tool=$(readlink -e "${tool%/*}"/.)
+
+install -d -D -m 700 \
+ ~/.vim \
+ ~/.vim/swap \
+ ~/.vim/view \
+ ~/.vim/undo
+
+(
+cd ~/.vim &&
+for d in autoload config ftdetect syntax
+ do cp -frs "$tool"/$d .
+ done
+)
+
+install_plugin () {
+       dst=~/.vim/git/$1
+       url=$2
+       if test -d "$dst"
+        then ( cd "$dst" && git pull -v )
+        else git clone --depth 1 "$url" "$dst"
+        fi &&
+       (
+       cd ~/.vim &&
+       for d in autoload plugin
+        do cp -frs "$dst"/$d .
+        done
+       )
+ }
+
+install_plugin gundo https://github.com/sjl/gundo.vim.git
+install_plugin vim-easy-align https://github.com/junegunn/vim-easy-align.git
+install_plugin neocomplcache https://github.com/Shougo/neocomplcache.vim.git
+
+cat <<-EOF
+       \e[7mLignes de configuration pouvant être mises
+       dans votre ~/.vimrc selon vos goûts :\e[0m
+       $(
+       cd "$tool"
+       find config -name '*.vim' \
+        -exec echo 'source '{} \;
+       )
+       EOF