Skip to content

Commit

Permalink
gives much needed love
Browse files Browse the repository at this point in the history
  • Loading branch information
arron-green committed Jun 8, 2022
1 parent 4fb78d0 commit 5171897
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 23 deletions.
12 changes: 3 additions & 9 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common
Original file line number Diff line number Diff line change
@@ -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; }
Expand Down
1 change: 1 addition & 0 deletions ideavimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source ~/.vimrc
30 changes: 17 additions & 13 deletions profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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 )
Expand Down Expand Up @@ -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')
}

Expand All @@ -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 {
Expand All @@ -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
}
Expand All @@ -175,7 +179,7 @@ function docker-image-grep {
QUIET=true
;;
-*)
echo >&2 "Invalid option: $@";
echo >&2 "Invalid option: $*";
return 1;;
*)
IMAGE+=("${1}");
Expand Down
17 changes: 17 additions & 0 deletions vim-plugins
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5171897

Please sign in to comment.