nvchad/install.sh

56 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/sh
2021-03-18 21:42:44 -04:00
get_platform() {
case "$(uname -s)" in
2021-04-07 21:59:39 -04:00
Linux*) platform=Linux ;;
Darwin*) platform=Mac ;;
*) platform="UNKNOWN:${unameOut}" ;;
2021-03-18 21:42:44 -04:00
esac
echo $platform
}
echo "installing packer"
2021-03-28 13:50:53 -04:00
if [ -d ~/.local/share/nvim/site/pack/packer ]; then
echo "Clearning previous packer installs"
rm -rf ~/.local/share/nvim/site/pack
2021-03-28 13:50:53 -04:00
fi
echo -e "\n=> Installing packer"
git clone https://github.com/wbthomason/packer.nvim \
~/.local/share/nvim/site/pack/packer/start/packer.nvim
echo -e "=> packer installed!"
echo "Linking config"
echo "old nvim config will be changed to nvim.bak if exists! :0"
2021-03-26 22:50:15 -04:00
2021-04-07 21:59:39 -04:00
# copying config
if [ -d ~/.config/nvim ]; then
echo "Nvim Directory exists"
echo "Changing nvim to nvim.bak"
mv ~/.config/nvim/ ~/.config/nvim.bak/
echo "Creating new nvim directory"
mkdir -p ~/.config/nvim
else
echo "Nvim Config doesn't exist so creating one"
mkdir -p ~/.config/nvim/
fi
2021-03-26 22:50:15 -04:00
cp -r init.lua ~/.config/nvim/ && cp -r lua ~/.config/nvim/
2021-03-26 22:50:15 -04:00
# change shell in nvim config
2021-04-06 00:05:22 -04:00
read -p "which shell do you use?: " shellname
echo "$shellname"
2021-04-24 08:51:13 -04:00
if [ "$(get_platform)" = "Mac" ]; then
gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
2021-04-24 08:51:13 -04:00
else
sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
2021-04-24 08:51:13 -04:00
fi
echo -e "\n=> shell changed to $shellname on nvim successfully!"
echo -e "\n=> neovim will open with some errors , just press enter" && sleep 1
2021-03-18 21:42:44 -04:00
2021-06-25 22:05:33 -04:00
# install all plugins + compile them
nvim +PackerSync