-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·39 lines (33 loc) · 1 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
if command -v apt >/dev/null 2>&1; then
sudo apt install -y exuberant-ctags cscope vim git
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y ctags cscope vim git
else
echo " * Error: unknown system. Skip pkg install"
fi
if [ ! -f vim.tar.bz2 ]; then
GITDIR="/tmp/yifengyou-vim-$RANDOM"
# git config --global url."git@github.com:".insteadOf https://github.com/
git clone https://github.com/yifengyou/vim.git ${GITDIR}
if [ $? -ne 0 ]; then
echo " * Download vim.git failed!Make sure your network is ok"
exit 1
else
echo " * Git clone success!"
fi
cd ${GITDIR}
fi
cp -a vimrc ~/.vimrc
echo " * Install vimrc success!"
if [ -d ~/.vim ]; then
BACKUPVIM="/tmp/.vim-$RANDOM"
mv ~/.vim ${BACKUPVIM}
echo " * Backup .vim to ${BACKUPVIM}"
fi
tar -xf vim.tar.bz2 -C ~/
echo " * Install vim plugins success!"
sudo cp -a `readlink -f $0` /bin/update-vim
sudo chmod +x /bin/update-vim
echo " * Install update-vim success!"
echo " * All done! Enjoy ٩(•̤̀ᵕ•̤́๑)ᵒᵏᵎᵎᵎᵎ "