From 597e81182d6c7d74ae9039404ca9c1a8cae94d36 Mon Sep 17 00:00:00 2001 From: Dan Fredell Date: Thu, 9 Jan 2020 12:00:34 -0600 Subject: [PATCH 1/6] Update setup.sh Add a few checks to the setup --- setup.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/setup.sh b/setup.sh index 8bed1d4..eb78439 100755 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,35 @@ +#!/usr/bin/env bash +# Prereqs + + +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; + + +if [ ! -d ~/.vim/bundle/Vundle.vim ]; then + echo installing Vundle + git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim +fi + +if [ ! -d ~/.vim/plugged/YouCompleteMe ]; then + echo installing YouCompleteMe + git clone https://github.com/ycm-core/YouCompleteMe.git ~/.vim/plugged/YouCompleteMe + cd ~/.vim/plugged/YouCompleteMe + git submodule update --init --recursive + cd - +fi + ln -s ~/.vim/vimrc ~/.vimrc cd ~/.vim mkdir -p backup From 7cabb856c4099f20409bc0c621c35f531cb5cf9d Mon Sep 17 00:00:00 2001 From: Dan Fredell Date: Thu, 9 Jan 2020 12:59:24 -0600 Subject: [PATCH 2/6] Update setup.sh Remove Vundle install. YouCompleteMe is installing via git clone. --- setup.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.sh b/setup.sh index eb78439..6dd7f60 100755 --- a/setup.sh +++ b/setup.sh @@ -16,12 +16,6 @@ fi curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh; fi; - -if [ ! -d ~/.vim/bundle/Vundle.vim ]; then - echo installing Vundle - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -fi - if [ ! -d ~/.vim/plugged/YouCompleteMe ]; then echo installing YouCompleteMe git clone https://github.com/ycm-core/YouCompleteMe.git ~/.vim/plugged/YouCompleteMe From 83bed2dba7ca240c9e79a0407759e02c17ebf388 Mon Sep 17 00:00:00 2001 From: Dan Fredell Date: Thu, 9 Jan 2020 13:20:19 -0600 Subject: [PATCH 3/6] Update setup.sh Install srcery.vim --- setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.sh b/setup.sh index 6dd7f60..6bedad5 100755 --- a/setup.sh +++ b/setup.sh @@ -29,6 +29,7 @@ cd ~/.vim mkdir -p backup mkdir -p plugged mkdir -p autoload +mkdir -p colors curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim vim +PlugInstall +qall @@ -37,3 +38,5 @@ cd ~/.vim/plugged/YouCompleteMe cd ~/.vim/plugged/tern_for_vim npm install +curl -fLo ~/.vim/colors/srcery.vim https://raw.githubusercontent.com/srcery-colors/srcery-vim/master/colors/srcery.vim + From 4bac746724d702173682b70f618cc9c082d3a3a9 Mon Sep 17 00:00:00 2001 From: Dan Fredell Date: Thu, 9 Jan 2020 13:30:29 -0600 Subject: [PATCH 4/6] Update setup.sh Copy scripts dir, make swapfiles dir --- setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 6bedad5..c88c4eb 100755 --- a/setup.sh +++ b/setup.sh @@ -30,13 +30,17 @@ 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 From cd0f2e4174b7fdf63b5024d83f588f8cb26a1be7 Mon Sep 17 00:00:00 2001 From: Dan Fredell Date: Thu, 9 Jan 2020 14:06:15 -0600 Subject: [PATCH 5/6] Update setup.sh I guess I have some leaning to do with apt-vim. PlugInstall installs YouCompleteMe --- setup.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index c88c4eb..7b7563a 100755 --- a/setup.sh +++ b/setup.sh @@ -15,15 +15,7 @@ fi echo Installing apt-vim; curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh; fi; - -if [ ! -d ~/.vim/plugged/YouCompleteMe ]; then - echo installing YouCompleteMe - git clone https://github.com/ycm-core/YouCompleteMe.git ~/.vim/plugged/YouCompleteMe - cd ~/.vim/plugged/YouCompleteMe - git submodule update --init --recursive - cd - -fi - + ln -s ~/.vim/vimrc ~/.vimrc cd ~/.vim mkdir -p backup @@ -44,3 +36,4 @@ 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 + From 2fd01d4fef9c6705ef36477a5958c86f08c1a24a Mon Sep 17 00:00:00 2001 From: dfredell Date: Sun, 12 Jan 2020 12:31:55 -0600 Subject: [PATCH 6/6] Add check for vim, copy vimrc --- setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 7b7563a..5aa5fcf 100755 --- a/setup.sh +++ b/setup.sh @@ -2,6 +2,11 @@ # 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 @@ -15,8 +20,9 @@ fi echo Installing apt-vim; curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh; fi; - -ln -s ~/.vim/vimrc ~/.vimrc + +cp ~/.vimrc ~/.vimrc.bac.$(date +%d) +cp vimrc ~/.vimrc cd ~/.vim mkdir -p backup mkdir -p plugged @@ -35,5 +41,5 @@ 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 +cp ./scripts/* ~/.vim/scripts