-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·49 lines (39 loc) · 1.17 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
#!/bin/bash
# neovim configuration file
NEOVIM_CNF_FILE=~/.config/nvim/init.vim
YES=false
# Install Neovim with Python support
if ! type nvim > /dev/null; then
sudo add-apt-repository -y ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get -y install neovim python-dev python-pip python3-dev python3-pip
sudo pip install --upgrade pip
sudo pip3 install --upgrade pip3
sudo pip install --user neovim
sudo pip3 install --user neovim
fi
# Install Plug plugin manager
if [ ! -e "~/.local/share/nvim/site/autoload/plug.vim" ]; then
if ! type curl > /dev/null; then
sudo apt-get -y install curl
fi
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Setup the configuration
for arg in "$@"
do
if [ "$arg" == "--yes" ] || [ "$arg" == "-y" ]; then
echo "Replacing the installed configuration"
YES=true
fi
done
if [ "$YES" == false ] && [ -f "$FILE" ]; then
echo "$FILE already exist, should we replace it ? (y/N)"
read resp1
if [ "$resp1" != y ]; then
echo "Ok, bye!"
exit
fi
rm -rf $NEOVIM_CNF_FILE
fi
cp init.vim $NEOVIM_CNF_FILE