my-nvim-setup/install.sh
Henri 087e4e8acc
Update install.sh
Gave up and decided to clone the config and reinstall over my previous install to add later. Made the following modifications:
1 - removed the extra echos (use echo -e "\n some line " in the future)
2 - packer doesn't install if there's a previously installed packer folder. So the bash script purges the previous packer folder and starts anew.


tested the config correctly
2021-06-27 12:02:56 -07:00

57 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
get_platform() {
case "$(uname -s)" in
Linux*) platform=Linux ;;
Darwin*) platform=Mac ;;
CYGWIN*) platform=Cygwin ;;
MINGW*) platform=MinGw ;;
*) platform="UNKNOWN:${unameOut}" ;;
esac
echo $platform
}
echo "installing packer"
if [ -d ~/.local/share/nvim/site/pack/packer ]; then
echo "Clearning previous packer installs"
rm -rf ~/.local/share/nvim/site/pack
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"
# 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
cp -r init.lua ~/.config/nvim/ && cp -r lua ~/.config/nvim/
# change shell in nvim config
read -p "which shell do you use?: " shellname
echo "$shellname"
if [ "$(get_platform)" = "Mac" ]; then
gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
else
sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
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
# install all plugins + compile them
nvim +PackerSync