# THIS IS CURRENTLY EXPERIMENTAL. REVIEW AND TEST FIRST. NEVER RUN ON MAIN # MACHINE WITHOUT A BACKUP OF VIMFILES AND DOTFILES # Links configuration files to the ones listed here. Backup and remove your's # and then run this script while inside repo directory. # # In Windows it has to be run with git-bash. # # Note: This solution is lazy and causes some problems. Like not being able to # track vim pluggins. # Config # ====== platform="linux" # linux,windows mode="copy" # copy,slink # Auto config # =========== if [[ $platform = "linux" ]]; then VIMFILES="~/.vim" elif [[ $platform = "windows" ]]; then VIMFILES="~/vimfiles" fi [[ $mode = "copy" ]] && cp_or_ln="cp" [[ $mode = "slink" ]] && cp_or_ln="ln -s" # Commands # ======== # bash ( eval concatenates and executes) eval $cp_or_ln " ${PWD}/profile ~/.profile" eval $cp_or_ln " ${PWD}/bash_aliases ~/.bash_aliases" eval $cp_or_ln " ${PWD}/bashrc ~/.bashrc" eval $cp_or_ln " ${PWD}/inputrc ~/.inputrc" # vim # ~/.vimrc takes priority over ~/.vim/vimrc, so remove the former first mkdir -p $VIMFILES/{undo,swap,backup,pack} eval $cp_or_ln " ${PWD}/vim/vimrc $VIMFILES/vimrc" eval $cp_or_ln " ${PWD}/vim/fun.vim $VIMFILES/fun.vim" # done echo "all done :)"