#!/bin/bash VIMVER="vim" DOTCONFIG="/home/$USER/.config" LOCALVIMRC="init.vim" VIMRC="/home/$USER/.vimrc" VIMDIR="/home/$USER/" NVIMRC="/home/$USER/.config/nvim/init.vim" NVIMDIR="/home/$USER/.config/nvim/" CURDATE=$(date +%m%d%Y%H%M%S) #sudo apt install -y exuberant-ctags #sudo apt install -y curl echo $CURDATE if [[ $VIMVER = "neovim" ]] then echo Installing NEOVIM sudo apt install -y neovim curl -fLo ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim if [ -d "$DOTCONFIG" ]; then echo "$DOTCONFIG existst and will not be created" else mkdir $DOTCONFIG fi if [ -d "$NVIMDIR" ]; then echo "$NVIMDIR existst and will not be created" else mkdir $NVIMDIR fi if [ -f $NVIMRC ]; then echo Backing the old config file with the current date cp $NVIMRC "$NVIMRC"."$CURDATE" cp $LOCALVIMRC $NVIMDIR else cp $LOCALVIMRC $NVIMDIR fi else echo Installing VIM sudo apt install -y vim curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim if [ -f $VIMRC ]; then echo Backing the old config file with the current date cp $VIMRC "$VIMRC"."$CURDATE" cp $LOCALVIMRC $VIMDIR cd $VIMDIR mv $LOCALVIMRC .vimrc else cp $LOCALVIMRC $VIMDIR cd $VIMDIR mv $LOCALVIMRC .vimrc fi fi