diff --git a/setup.sh b/setup.sh index 8bed1d4..5aa5fcf 100755 --- a/setup.sh +++ b/setup.sh @@ -1,13 +1,45 @@ -ln -s ~/.vim/vimrc ~/.vimrc +#!/usr/bin/env bash +# Prereqs + + +if [ ! -x "$(command -v vim)" ]; then + echo you need vim installed + exit 1 +fi + +if [ ! -x "$(command -v go)" ]; then + echo you might want to install golang +fi + +if [ ! -x "$(command -v npm)" ]; then + echo you will need npm + exit 1 +fi + + if [ ! -x "$(command -v apt-vim)" ]; then + echo Installing apt-vim; + curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh; + fi; + +cp ~/.vimrc ~/.vimrc.bac.$(date +%d) +cp vimrc ~/.vimrc cd ~/.vim mkdir -p backup mkdir -p plugged mkdir -p autoload +mkdir -p colors +mkdir -p swapfiles +mkdir -p scripts curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim vim +PlugInstall +qall +cd - cd ~/.vim/plugged/YouCompleteMe ./install.sh --go-completer +cd - cd ~/.vim/plugged/tern_for_vim npm install +cd - +curl -fLo ~/.vim/colors/srcery.vim https://raw.githubusercontent.com/srcery-colors/srcery-vim/master/colors/srcery.vim +cp ./scripts/* ~/.vim/scripts