#!/bin/sh # TODO: modularize zsh configuration and vim configuration #@info #@strict #@include core #@include punani #@include vim # vim +python _punanidb_pacman_vim_python=gvim _punanidb_yum_vim_python=vim-enhanced _punanidb_aptget_vim_python=vim # TODO pull out youcompleteme into a vim function # cmake ,make,g++,python-dev for youcompleteme _punanidb_pacman_cmake=cmake _punanidb_yum_cmake=cmake _punanidb_aptget_cmake=cmake #@mainifyme info "Configuring environment for $(id -un)" cd $(readlink -f $(dirname $0)) info "Using punani to install git vim and zsh" punani install git vim_python zsh gpp cmake make python2_dev || die "cannot install some shit" info "writing dotfiles" # deploying zshrc # TODO modularize zshrc cat > $HOME/.zshrc </dev/null && fortune -a which task >/dev/null && task echo "--" test -r ~/TODO && cat ~/TODO setopt menu_complete unsetopt correct_all EOF info "deploying vim config" if [ -e $HOME/.vim ] ; then oldvim=$HOME/.vim.`date +%Y%M%d` info "Backing up old vim folder to $oldvim" mv -v $HOME/.vim $oldvim fi mkdir -p $HOME/.vim # TODO modilarize vimconfig cat > $HOME/.vim/vimrc < :set invpaste paste? set pastetoggle= set showmode " save on focus lost au FocusLost * :wa set spelllang=en set textwidth=9001 autocmd BufRead *.json set filetype=json EOF if [ -e $HOME/.vimrc ] ; then oldvim=$HOME/.vimrc.`date +%Y%M%d` info "Backing up old vimrc file to $oldvim" mv -v $HOME/.vimrc $oldvim fi info "Symlinking .vimrc to .vim/vimrc" ln -vs $HOME/.vim/vimrc $HOME/.vimrc vim_conf_sane_defaults #install all the vim stuff with the help of vundle cd $HOME/.vim mkdir -p bundle info "Fetching vim-vundle" git clone https://github.com/gmarik/vundle.git bundle/vundle > /dev/null && \ info "Vim Vundle deployed" info "Installing Vundle Bundles" vim "+:BundleInstall" "+:qall" info "building youcompleteme libs" cd $HOME/.vim/bundle/YouCompleteMe ./install.sh cd - info "configuring zsh" if exists zsh; then if [ "$SHELL" != "`which zsh`" ] ;then info "setting zsh as new shell,please enter your user password" chsh -s `which zsh` else info "zsh already set as default shell" fi if [ ! -d ~/.oh-my-zsh ] ; then git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh > /dev/null && info "oh-my-zsh deployed" else info "oh-my-zsh already installed" fi else error "cannot find zsh :(" fi