Ajout : rangement.
[tool/hledger.git] / vim / install
1 #!/bin/sh -eux
2 test -L "$0" && tool="$(readlink -e "$0")" || tool=$0
3 tool=$(readlink -e "${tool%/*}"/.)
4
5 install -d -D -m 700 \
6 ~/.vim \
7 ~/.vim/swap \
8 ~/.vim/view \
9 ~/.vim/undo
10
11 (
12 cd ~/.vim &&
13 for d in autoload config ftdetect syntax
14 do cp -frs "$tool"/$d .
15 done
16 )
17
18 install_plugin () {
19 dst=~/.vim/git/$1
20 url=$2
21 if test -d "$dst"
22 then ( cd "$dst" && git pull -v )
23 else git clone --depth 1 "$url" "$dst"
24 fi &&
25 (
26 cd ~/.vim &&
27 for d in autoload plugin
28 do cp -frs "$dst"/$d .
29 done
30 )
31 }
32
33 install_plugin gundo https://github.com/sjl/gundo.vim.git
34 install_plugin vim-easy-align https://github.com/junegunn/vim-easy-align.git
35 install_plugin neocomplcache https://github.com/Shougo/neocomplcache.vim.git
36
37 cat <<-EOF
38 \e[7mLignes de configuration pouvant être mises
39 dans votre ~/.vimrc selon vos goûts :\e[0m
40 $(
41 cd "$tool"
42 find config -name '*.vim' \
43 -exec echo 'source '{} \;
44 )
45 EOF