-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup_nvim
executable file
·41 lines (33 loc) · 1.03 KB
/
setup_nvim
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
#!/bin/bash
set -euo pipefail
if !(which nvim > /dev/null)
then
echo "Install nvim before continuing"
exit 1
fi
echo ""
read -n 1 -s -r -p "WARNING: This will replace your existing init.lua, colors, and ALL lua files under ~/.config/nvim/{config,plugins}. Press any key to continue..."
rm -rf ~/.config/nvim/init.lua
ln -s $(pwd)/nvim/init.lua ~/.config/nvim/.
mkdir -p ~/.config/nvim/colors
mkdir -p ~/.config/nvim/lua
rm -rf ~/.config/nvim/lua/config
rm -rf ~/.config/nvim/lua/plugins
# Only replace colorschemes that are in this repo
for colorscheme in $(pwd)/nvim/colors/*.vim; do
path=~/.config/nvim/colors/$(basename "$colorscheme")
if [ -e "$path" ]; then
if [ ! -L "$path" ]; then
rm -rf "$path"
ln -s "$colorscheme" ~/.config/nvim/colors/.
fi
else
ln -s "$colorscheme" ~/.config/nvim/colors/.
fi
done
ln -s $(pwd)/nvim/lua/config ~/.config/nvim/lua/config
ln -s $(pwd)/nvim/lua/plugins ~/.config/nvim/lua/plugins
nvim +MasonInstallAll +qall
echo -e "\n\n"
echo "nvim setup complete ✓"
echo -e "\n"