Ajout : vim/install : plugin recover.
[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 ctrlp https://github.com/kien/ctrlp.vim.git
34 install_plugin gundo https://github.com/sjl/gundo.vim.git
35 install_plugin neocomplcache https://github.com/Shougo/neocomplcache.vim.git
36 install_plugin recover https://github.com/chrisbra/Recover.vim.git
37 install_plugin vim-easy-align https://github.com/junegunn/vim-easy-align.git
38
39 cat <<-EOF
40 \e[7mLignes de configuration pouvant être mises
41 dans votre ~/.vimrc selon vos goûts :\e[0m
42 $(
43 cd "$tool"
44 find config -name '*.vim' \
45 -exec echo 'source $HOME/.vim/'{} \;
46 )
47 EOF