neovim-confs/install.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
2021-03-19 02:42:44 +01:00
get_platform() {
case "$(uname -s)" in
2021-04-08 03:59:39 +02:00
Linux*) platform=Linux ;;
Darwin*) platform=Mac ;;
CYGWIN*) platform=Cygwin ;;
MINGW*) platform=MinGw ;;
*) platform="UNKNOWN:${unameOut}" ;;
2021-03-19 02:42:44 +01:00
esac
echo $platform
}
echo "installing packer"
2021-03-28 19:50:53 +02:00
if [ ! -d ~/.local/share/nvim/site/pack/packer ]; then
echo "Installing packer"
2021-04-08 03:59:39 +02:00
git clone https://github.com/wbthomason/packer.nvim \
2021-03-28 19:50:53 +02:00
~/.local/share/nvim/site/pack/packer/start/packer.nvim
echo
echo "packer installed!"
echo
2021-03-28 19:50:53 +02:00
fi
echo "Linking config"
echo "old nvim config will be deleted so watchout! :0"
echo
2021-03-27 03:50:15 +01:00
2021-04-08 03:59:39 +02:00
# copying config
2021-03-27 03:50:15 +01:00
2021-04-01 14:00:32 +02:00
rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim
2021-04-08 03:59:39 +02:00
cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim
2021-03-27 03:50:15 +01:00
# change shell in nvim config
2021-04-06 06:05:22 +02:00
read -p "which shell do you use?: " shellname
echo "$shellname"
2021-04-24 14:51:13 +02:00
if [ "$(get_platform)" = "Mac" ]; then
gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
2021-04-24 14:51:13 +02:00
else
sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings.lua
2021-04-24 14:51:13 +02:00
fi
2021-04-06 06:05:22 +02:00
echo "shell changed to $shellname on nvim successfully!"
2021-03-19 02:42:44 +01:00
echo
echo "neovim will open with some errors , just press enter" && sleep 1
2021-03-19 02:42:44 +01:00
# install all plugins
nvim +PackerInstall