#!/bin/bash

VIM_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

VIM_DOTFILE_DIR="$VIM_SCRIPT_DIR/../../dotfiles/vim"
VIM_DOTFILE_VIMRC="$VIM_DOTFILE_DIR/.vimrc"
VIM_DOTFILE_FTPLUGIN="$VIM_DOTFILE_DIR/ftplugin"
VIM_DOTFILE_SMIPPETS="$VIM_DOTFILE_DIR/snippets"

USER_DOFILE_VIMRC="/home/$USER/.vimrc"
USER_VIM_DIR="/home/$USER/.vim"

CURDATE=$(date +%m%d%Y%H%M%S)

echo $CURDATE

install_vim()
{
	graphics_install_prompt "Vim Will be installed"
	install_from_repo "vim"

	cp $VIM_DOTFILE_VIMRC $USER_DOFILE_VIMRC
	cp -r $VIM_DOTFILE_FTPLUGIN $VIM_DOTFILE_SMIPPETS $USER_VIM_DIR
	
	curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

	vim -c "PlugInstall | q | q"
	graphics_install_prompt "Vim installation complete"
}
