forked from ets-labs/python-vimrc
-
Notifications
You must be signed in to change notification settings - Fork 87
/
setup.sh
101 lines (85 loc) · 3.93 KB
/
setup.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env bash
wrapper() {
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
BLUE="\033[0;36m"
NORMAL="\033[0m"
REPO_HTTPS="https://github.com/jarolrod/vim-python-ide.git"
VUNDLE_HTTPS="https://github.com/VundleVim/Vundle.vim.git"
echo "${BLUE}"
cat << "HELLO_TEXT"
..
.::::.
___________ :;;;;:`____________
\_________/ ?????L \__________/
|.....| ????????> :.......'
|:::::| $$$$$$"`.:::::::' ,
,|:::::| $$$$"`.:::::::' .OOS.
,7D|;;;;;| $$"`.;;;;;;;' .OOO888S.
.GDDD|;;;;;| ?`.;;;;;;;' .OO8DDDDDNNS.
'DDO|IIIII| .7IIIII7' .DDDDDDDDNNNF`
'D|IIIIII7IIIII7' .DDDDDDDDNNNF`
|EEEEEEEEEE7' .DDDDDDDNNNNF`
|EEEEEEEEZ' .DDDDDDDDNNNF`
|888888Z' .DDDDDDDDNNNF`
|8888Z' ,DDDDDDDNNNNF`
|88Z' "DNNNNNNN"
'"' "MMMM"
""
___ ____ __ _ _ ________ ___
/ | / / / __ ______ __ __ ____ ___ ___ ____/ / (_)____ | | / / _/ |/ /
/ /| | / / / / / / / __ \/ / / / / __ \/ _ \/ _ \/ __ / / / ___/ | | / // // /|_/ /
/ ___ |/ / / / /_/ / /_/ / /_/ / / / / / __/ __/ /_/ / / (__ ) | |/ // // / / /
/_/ |_/_/_/ \__, /\____/\__,_/ /_/ /_/\___/\___/\__,_/ /_/____/ |___/___/_/ /_/
/_/
HELLO_TEXT
echo "${NORMAL}"
if [ ! -n "$VIM" ]; then
VIM=~/.vim
fi
if [ -d "$VIM" ]; then
printf "${YELLOW}%s${NORMAL}\n" "You already have $VIM directory."
printf "${YELLOW}%s${NORMAL}\n" "You have to remove $VIM if you want to re-install."
exit 0
fi
# Prevent the cloned repository from having insecure permissions. Failing to do
# so causes compinit() calls to fail with "command not found: compdef" errors
# for users with insecure umasks (e.g., "002", allowing group writability). Note
# that this will be ignored under Cygwin by default, as Windows ACLs take
# precedence over umasks except for filesystems mounted with option "noacl".
umask g-w,o-w
printf "${BLUE}%s${NORMAL}\n" "Cloning vimrc from ${REPO_HTTPS}"
hash git >/dev/null 2>&1 || {
printf "${RED}%s${NORMAL}\n" "Error: git is not installed."
exit 1
}
env git clone --depth=1 $REPO_HTTPS $VIM || {
printf "${RED}%s${NORMAL}\n" "Error: git clone of vimrc repo failed."
exit 1
}
printf "${BLUE}%s${NORMAL}\n" "Looking for an existing vim config..."
if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then
printf "${YELLOW}%s${NORMAL}\n" "Found ~/.vimrc."
printf "${BLUE}%s${NORMAL}\n" "You will see your old ~/.vimrc as $VIM/vimrc.bak"
mv ~/.vimrc $VIM/vimrc.bak
fi
printf "${BLUE}%s${NORMAL}\n" "Symlinking $VIM/vimrc with ~/.vimrc..."
ln -fs $VIM/vimrc ~/.vimrc
if [ ! -d "$VIM/bundle/Vundle.vim" ]; then
printf "${BLUE}%s${NORMAL}\n" "Installing Vundle..."
env git clone --depth=1 $VUNDLE_HTTPS "$VIM/bundle/Vundle.vim"
git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
fi
if [ ! -f $VIM/colors/wombat256mod.vim ]; then
if [ ! -d $VIM/colors/ ]; then
mkdir -p $VIM/colors
fi
wget 'http://www.vim.org/scripts/download_script.php?src_id=13400' -O $VIM/colors/wombat256mod.vim
fi
printf "${GREEN}%s${NORMAL}\n" "Vimrc has been configured ;)"
printf "${YELLOW}%s${NORMAL}\n" "Do not worry about error messages. When it occurs just press enter and wait till all plugins are installed."
printf "${BLUE}%s${NORMAL}\n" "Keep calm and use VIM!"
}
wrapper
vim +PluginInstall