From ed06e97323f671e875802b768fb014d6f1f1e87c Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 14 Jan 2017 22:57:53 +0100 Subject: implemented bashrc, vim and git installer --- install | 40 +++++++++++++++++++++++++++++++++++++--- vimrc | 2 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/install b/install index 28a0fa2..78f050a 100755 --- a/install +++ b/install @@ -15,10 +15,21 @@ gToolsConfig=( "Xresources:xterm:xtermConfigInstaller" ) +gMagicNumber=e2718281 +ABS_BASE_DIR=$(readlink -f $(dirname $0)) + #{{{ bashrcInstaller function bashrcInstaller() { - echo "bashInstaller called!" + local bashrc=~/.bashrc + touch $bashrc + grep $gMagicNumber $bashrc > /dev/null 2>&1 + if [[ $? = 0 ]]; then + return + fi + echo -e "\n# $gMagicNumber - Auto generated, do not delete or modify!" >> $bashrc + echo -e "source $ABS_BASE_DIR/bashrc" >> $bashrc + echo "[Info]: bashrc sucessfully installed!" } #}}} @@ -39,7 +50,16 @@ function conkyrcInstaller() { #{{{ gitConfigInstaller function gitConfigInstaller() { - echo "gitConfigInstaller called" + local gitconf=~/.gitconfig + touch $gitconf + grep $gMagicNumber $gitconf > /dev/null 2>&1 + if [[ $? = 0 ]]; then + return + fi + echo -e "\n# $gMagicNumber - Auto generated, do not delete or modify!" >> $gitconf + echo -e "[include]" >> $gitconf + echo -e " path = $ABS_BASE_DIR/gitconfig" >> $gitconf + echo "[Info]: gitconfig sucessfully installed!" } #}}} @@ -53,7 +73,21 @@ function tmuxConfigInstaller() { #{{{ vimConfigInstaller function vimConfigInstaller() { - echo "vimConfigInstaller called" + local vimrc=~/.vimrc + local vim_home=~/.vim + touch $vimrc + grep $gMagicNumber $vimrc > /dev/null 2>&1 + if [[ $? = 0 ]]; then + return + fi + mkdir $vim_home > /dev/null 2>&1 + ln -s $ABS_BASE_DIR/vim/* $vim_home + echo -e "\n\" $gMagicNumber - Auto generated, do not delete or modify!" >> $vimrc + echo -e "let \$VIMHOME='$vim_home'" >> $vimrc + echo -e "source $ABS_BASE_DIR/vimrc" >> $vimrc + git clone https://github.com/VundleVim/Vundle.vim.git $vim_home/bundle/Vundle.vim + vim +PluginInstall +qall + echo "[Info]: vim config sucessfully installed!" } #}}} diff --git a/vimrc b/vimrc index 7942b7c..e00f191 100644 --- a/vimrc +++ b/vimrc @@ -8,7 +8,7 @@ let mapleader=";" nnoremap ev :edit ~/.vimrc nnoremap sv :source ~/.vimrc -let $VIMHOME='~/.vim' +"let $VIMHOME='~/.vim' "{{{ Plugin Management -- cgit v1.2.3