-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·45 lines (37 loc) · 1.23 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
40
41
42
43
44
45
#!/bin/bash
# Vimconfig installation variables
vimc__install_home=~/
vimc__install_cwd="$(pwd)"
# check if .vimrc already exists
if [ -f "$vimc__install_home"/.vimrc ]; then
while true; do
read -p "~/.vimrc already exists -- Overwrite? (y/n) " choice
case "$choice" in
y|Y ) cp -f "$vimc__install_cwd"/vimrc "$vimc__install_home"/.vimrc; break;;
n|N ) exit;;
* ) echo "Please answer y or n";;
esac
done
else
echo "Copying vimconfig's .vimrc to ~/.vimrc"
cp "$vimc__install_cwd"/vimrc "$vimc__install_home"/.vimrc
fi
echo ".. Successfully copied vimrc to ~/.vimrc"
# check if .vim folder already exists
if [ -d "$vimc__install_home"/.vim ]; then
while true; do
read -p "~/.vim directory already exists -- Overwrite? (y/n) " choice
case "$choice" in
y|Y ) cp -rf "$vimc__install_cwd"/vim/ "$vimc__install_home"/.vim/; break;;
n|N ) exit;;
* ) echo "Please answer y or n";;
esac
done
else
echo "Copying vimconfig's .vim/ to ~/.vim/"
cp -r "$vimc__install_cwd"/vim/ "$vimc__install_home"/.vim/
fi
echo ".. Successfully copied vim/ to ~/.vim/"
echo ""
echo "Your config has successfully been installed. Restart all Vim instances."
echo "Thank you for using VimConfig based on vimc"