-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·68 lines (65 loc) · 1.78 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
SCRIPT_DIR=$(cd $(dirname $0); pwd)
if [ "$(uname)" = "Linux" ]; then
source /etc/os-release
OS_NAME=$(echo $ID)
elif [ "$(uname)" = "Darwin" ]; then
OS_NAME="mac"
else
echo "This OS is not supported."
exit 1
fi
echo ""
echo "install prerequisites..."
if [ $OS_NAME = "ubuntu" ]; then
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
curl \
vim-gtk
elif [ $OS_NAME = "debian" ]; then
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
curl \
vim-gtk3
elif [ $OS_NAME = "alpine" ]; then
sudo apk update && sudo apk add --no-cache \
curl \
vim
elif [ $OS_NAME = "fedora" ]; then
sudo dnf check-update || true && sudo dnf install -y --setopt=install_weak_deps=False \
curl \
vim
elif [ $OS_NAME = "centos" ]; then
sudo dnf check-update || true && sudo dnf install -y --setopt=install_weak_deps=False \
curl-minimal \
vim
elif [ $OS_NAME = "opensuse-leap" ]; then
sudo zypper refresh && sudo zypper install -y --no-recommends \
curl \
vim
elif [ $OS_NAME = "arch" ]; then
sudo pacman -Sy --noconfirm \
curl \
vim
elif [ $OS_NAME = "mac" ]; then
brew install \
vim
fi
echo ">>> Done"
echo ""
echo ""
echo "setting Vim... "
if [ -d ~/.vim/plugged ]; then
rm -rf ~/.vim/plugged
fi
if [ -d ~/.vim/undo ]; then
rm -rf ~/.vim/undo
fi
if [ ! -d ~/.vim/undo ]; then
mkdir -pv ~/.vim/undo
fi
ln -sfv $SCRIPT_DIR/vimrc ~/.vimrc
ln -sfv $SCRIPT_DIR/basic-settings.vim ~/.vim/basic-settings.vim
ln -sfv $SCRIPT_DIR/keymap.vim ~/.vim/keymap.vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo ">>> Done"
echo ""