-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_nvim.sh
executable file
·40 lines (32 loc) · 1.16 KB
/
setup_nvim.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
#!/usr/bin/env bash
# Setup Config
echo "Making a .config/nvim/ for configuration"
if [ -d ~/.config/nvim ]; then
echo '~/.config/nvim already exists. Moving to /tmp . Review it before next shutdown!'
# required
mv ~/.config/nvim{,.bak}
# optional but recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
else
echo '~/.config/nvim does not exist or is not a directory.'
fi
if [ ! -d ~/.config ]; then
mkdir ~/.config
fi
git clone https://github.com/tlelson/nvim.git ~/.config/nvim
if [[ $OSTYPE == "linux"* ]]; then
echo 'Downloading latest stable release of neo-vim .... '
sudo curl -fLo /etc/alternatives/nvim https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
sudo chmod +x /etc/alternatives/nvim
echo "Call with 'nvim' or relink manually ..."
#rm $(which vim)
sudo ln -s /etc/alternatives/nvim /usr/local/bin/nvim
sudo ln -s "$(which nvim)" "$(which vim)"
elif [[ $OSTYPE == "darwin"* ]]; then
echo 'Neo-vim alread downloaded by `setup.sh`. Linking `vim` to `nvim` ...'
sudo ln -s "$(which nvim)" "$(brew --prefix)/bin/vim"
fi
echo "3. Open vim and install plugins with:"
echo " :Lazy"