dotfiles/initialize_script

36 lines
874 B
Bash
Executable file

#!/bin/bash
# Setup script for vim & tmux
if [ $EUID != 0 ]; then
echo "This script needs sudo priveleges in order to install Curl"
echo "Exiting..."
exit 1
fi
function get_path {
SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
}
function user_config {
CURL='dpkg-query -l | grep curl | wc -l'
if [ "$CURL" > 0 ]; then
echo 'Curl not installed, installing....'
apt-get install -y curl
fi
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Create symlinks
get_path
echo 'Creating systemlinks'
ln -s $SCRIPTPATH/vim/.vimrc /home/$SUDO_USER/;
ln -s $SCRIPTPATH/tmux/.tmux.conf /home/$SUDO_USER/;
ln -s $SCRIPTPATH/vim/colors /home/$SUDO_USER/.vim/
}
user_config
echo 'Dont forget to run :PlugInstall inside vim!'