From 5171897f92cf57ae8474cf1f72905ade1c966975 Mon Sep 17 00:00:00 2001 From: Arron Green Date: Wed, 8 Jun 2022 09:49:24 -0400 Subject: [PATCH] gives much needed love --- bootstrap | 12 +++--------- common | 2 +- ideavimrc | 1 + profile.sh | 30 +++++++++++++++++------------- vim-plugins | 17 +++++++++++++++++ 5 files changed, 39 insertions(+), 23 deletions(-) create mode 100644 ideavimrc create mode 100755 vim-plugins diff --git a/bootstrap b/bootstrap index 52c1613..93d9d6c 100755 --- a/bootstrap +++ b/bootstrap @@ -18,6 +18,7 @@ brew bundle --file="${REPO_PATH}/brew/Brewfile" # setup environment links symlink-src-to-target "${REPO_PATH}/vimrc" "${HOME}/.vimrc" +symlink-src-to-target "${REPO_PATH}/ideavimrc" "${HOME}/.ideavimrc" symlink-src-to-target "${REPO_PATH}/bash_profile" "${HOME}/.bash_profile" symlink-src-to-target "${REPO_PATH}/profile.sh" "${HOME}/.profile" symlink-src-to-target "${REPO_PATH}/gitconfig" "${HOME}/.gitconfig" @@ -46,15 +47,8 @@ source "${REPO_PATH}/profile.sh" # setup ruby environment # ./rbenv-versions -# setup vim-plug -[ -d "${VIMPLUG_HOME}" ] || mkdir -p "${VIMPLUG_HOME}" -[ -f "${VIMPLUG_HOME}/plug.vim" ] || curl -Lo "${VIMPLUG_HOME}/plug.vim" "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" - -# ensure vim plugin deps are installed -vim +PlugInstall +qall -vim +PlugClean! +qall -vim +PlugUpdate +qall -vim +PlugUpgrade +qall +# setup vim environment +./vim-plugins # install vscode extensions if [[ -e ${REPO_PATH}/vscode.extensions ]]; then diff --git a/common b/common index fde514d..bd28788 100755 --- a/common +++ b/common @@ -1,7 +1,7 @@ #!/usr/bin/env bash export VIMPLUG_HOME=${HOME}/.vim/autoload export DEV_HOME=${HOME}/dev -export REPO_PATH=$(git rev-parse --show-toplevel) +export REPO_PATH="$(git rev-parse --show-toplevel)" export MY_BIN=${HOME}/.bin function echo-err { echo "$@" 1>&2; } diff --git a/ideavimrc b/ideavimrc new file mode 100644 index 0000000..553c06c --- /dev/null +++ b/ideavimrc @@ -0,0 +1 @@ +source ~/.vimrc \ No newline at end of file diff --git a/profile.sh b/profile.sh index bf981cc..28d16ab 100644 --- a/profile.sh +++ b/profile.sh @@ -20,7 +20,8 @@ export COLOR_RED='\[\033[31m\]' export COLOR_GREEN='\[\033[32m\]' export COLOR_BLUE='\[\033[34m\]' export COLOR_CYAN='\[\033[36m\]' -export EDITOR=$(command -v vim) +EDITOR="$(command -v vim)" +export EDITOR if [[ -d /opt/homebrew/bin ]]; then export PATH="/opt/homebrew/bin:$PATH" @@ -53,7 +54,7 @@ function ps1-prompt() { # python specific VENV="" - if [[ ! -z $VIRTUAL_ENV ]]; then + if [[ -n $VIRTUAL_ENV ]]; then VENV=" [${COLOR_BLUE}${PYENV_VERSION-V}${COLOR_NIL}]" fi @@ -76,10 +77,13 @@ type -p aws_completer > /dev/null 2>&1 && complete -C "$(type -p aws_completer)" # utility functions function find-scala-home { - local source="`type -p scala`" + local source + source="$(type -p scala)" while [ -h "$source" ] ; do - local linked="$(readlink "$source")" - local dir="$( cd -P $(dirname "$source") && cd -P $(dirname "$linked") && pwd )" + local linked + linked="$(readlink "$source")" + local dir + dir="$( cd -P "$(dirname "$source")" && cd -P "$(dirname "$linked")" && pwd )" source="$dir/$(basename "$linked")" done ( cd -P "$(dirname "$source")/.." && pwd ) @@ -114,15 +118,15 @@ function git-branch { } function git-branch-cp { - BN=`git-branch` + BN=$(git-branch) if [ "$?" == "0" ]; then echo "$BN" | tr -d '\n' | pbcopy fi } function pip-remove-globals { - while read P; do - pip uninstall -y $P; + while read -r P; do + pip uninstall -y "${P}"; done < <(pip list --format=json | jq -rc '.[] .name' | egrep -v 'pip|setuptools|wheel|six') } @@ -139,7 +143,7 @@ function minikube-dns { sudo route -n delete 10/24 > /dev/null 2>&1 # Create route - sudo route -n add 10.0.0.0/24 $(minikube ip) + sudo route -n add 10.0.0.0/24 "$(minikube ip)" } function kube-dashboard { @@ -151,15 +155,15 @@ function docker-init { NAME="$1" MEMORY="${2-1024}" if [ ! -z $NAME ]; then - STATUS=`docker-machine status $NAME` + STATUS=$(docker-machine status "$NAME") if [ "$?" == "0" ]; then if [ "$STATUS" == "Stopped" ]; then - docker-machine start $NAME + docker-machine start "$NAME" fi else docker-machine create -d virtualbox --virtualbox-disk-size "40000" --virtualbox-memory "$MEMORY" $NAME fi - docker-machine env $NAME + docker-machine env "$NAME" # eval "$(docker-machine env $NAME)" fi } @@ -175,7 +179,7 @@ function docker-image-grep { QUIET=true ;; -*) - echo >&2 "Invalid option: $@"; + echo >&2 "Invalid option: $*"; return 1;; *) IMAGE+=("${1}"); diff --git a/vim-plugins b/vim-plugins new file mode 100755 index 0000000..a214a3b --- /dev/null +++ b/vim-plugins @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +source ./common + +# +# Manages Vim Plugins +# Installs and Updates vim plugins defined within vimrc file +# + +# setup vim-plug +[ -d "${VIMPLUG_HOME}" ] || mkdir -p "${VIMPLUG_HOME}" +[ -f "${VIMPLUG_HOME}/plug.vim" ] || curl -Lo "${VIMPLUG_HOME}/plug.vim" "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" + +# ensure vim plugin deps are installed +vim +PlugInstall +qall +vim +PlugClean! +qall +vim +PlugUpdate +qall +vim +PlugUpgrade +qall \ No newline at end of file