From 4c0f1bda7f7075cb3322af78222b797d54061841 Mon Sep 17 00:00:00 2001 From: Aakash Shah Date: Tue, 2 Jun 2020 16:19:08 -0700 Subject: [PATCH] Separate bash-it specific loading of capi config * Add a "lib" directory. This is intended to only store (but not configure) capi aliases & environment-variables & scripts * Load all the lib suff in a bash-it plugin to not break existing workstations --- bash-it/shell-prompt-settings.bash | 3 +++ install.sh | 1 - lib/alias-nvim.bash | 3 --- lib/aliases.bash | 21 +++++++++++++++++ lib/always-sha2.bash | 1 - ...pi-env.bash => environment-variables.bash} | 6 ++--- lib/{capi-aliases.bash => misc.bash} | 23 ++++++------------- setup/bash-it.sh | 4 ++++ setup/custom-bash-it-plugins.sh | 9 -------- 9 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 bash-it/shell-prompt-settings.bash delete mode 100644 lib/alias-nvim.bash create mode 100644 lib/aliases.bash delete mode 100644 lib/always-sha2.bash rename lib/{capi-env.bash => environment-variables.bash} (80%) rename lib/{capi-aliases.bash => misc.bash} (66%) delete mode 100755 setup/custom-bash-it-plugins.sh diff --git a/bash-it/shell-prompt-settings.bash b/bash-it/shell-prompt-settings.bash new file mode 100644 index 0000000..293b561 --- /dev/null +++ b/bash-it/shell-prompt-settings.bash @@ -0,0 +1,3 @@ +# shell prompt settings +export HISTTIMEFORMAT="%F %T " +export THEME_CLOCK_CHAR="⛅️ " \ No newline at end of file diff --git a/install.sh b/install.sh index 74c00be..9d766c2 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,6 @@ source ./install-core.sh # bash-it / terminal source ./setup/bash.sh source ./setup/bash-it.sh -source ./setup/custom-bash-it-plugins.sh source ./setup/iterm2.sh source ./setup/vim.sh source ./setup/tmux.sh diff --git a/lib/alias-nvim.bash b/lib/alias-nvim.bash deleted file mode 100644 index a873c03..0000000 --- a/lib/alias-nvim.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -alias vim=nvim diff --git a/lib/aliases.bash b/lib/aliases.bash new file mode 100644 index 0000000..e84846d --- /dev/null +++ b/lib/aliases.bash @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +alias vim=nvim + +# fasd +alias v='fasd -e vim' +[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh + +# ruby +alias b='bundle exec' +alias bake='echo "bundling..." && bundle install --quiet && echo "done bundling" && bundle exec rake' +alias pgbake='echo "bundling..." && bundle install --quiet && echo "done bundling" && DB=postgres bundle exec rake' +alias mybake='echo "bundling..." && bundle install --quiet && echo "done bundling" && DB=mysql bundle exec rake' + +# k8s +alias k=kubectl + +# Git aliases +alias gd='git diff' +alias gdc='git diff --cached' +alias gst='git status' \ No newline at end of file diff --git a/lib/always-sha2.bash b/lib/always-sha2.bash deleted file mode 100644 index e112ecf..0000000 --- a/lib/always-sha2.bash +++ /dev/null @@ -1 +0,0 @@ -export BOSH_SHA2=true diff --git a/lib/capi-env.bash b/lib/environment-variables.bash similarity index 80% rename from lib/capi-env.bash rename to lib/environment-variables.bash index 42861d2..56deaf3 100644 --- a/lib/capi-env.bash +++ b/lib/environment-variables.bash @@ -1,6 +1,4 @@ -# shell prompt settings -export HISTTIMEFORMAT="%F %T " -export THEME_CLOCK_CHAR="⛅️ " +export BOSH_SHA2=true # Set nvim as default editor export GIT_EDITOR=nvim @@ -20,4 +18,4 @@ export PATH="/usr/local/opt/python/libexec/bin:$PATH" # specify locale so vim will stop shouting export LC_ALL=en_US.UTF-8 -launchctl setenv PATH $PATH +launchctl setenv PATH $PATH \ No newline at end of file diff --git a/lib/capi-aliases.bash b/lib/misc.bash similarity index 66% rename from lib/capi-aliases.bash rename to lib/misc.bash index 60d602f..0accbcb 100644 --- a/lib/capi-aliases.bash +++ b/lib/misc.bash @@ -1,17 +1,9 @@ -#FASD -alias v='fasd -e vim' -[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh - -alias b='bundle exec' -alias bake='echo "bundling..." && bundle install --quiet && echo "done bundling" && bundle exec rake' -alias pgbake='echo "bundling..." && bundle install --quiet && echo "done bundling" && DB=postgres bundle exec rake' -alias mybake='echo "bundling..." && bundle install --quiet && echo "done bundling" && DB=mysql bundle exec rake' -alias k=kubectl - -# Git aliases -alias gd='git diff' -alias gdc='git diff --cached' -alias gst='git status' +# I believe most of these may be specific to one CAPI member +# Holding them all here until we can figure something out +# +# For example, what if we provided folks a "user/" folder like +# Luan's vim config, where they can put their custom bits +# ------------------------------------------------------------- # capi likes `alias g="git status"`, other teams like `alias g=git`, so do both: alias g >/dev/null 2>&1 && unalias g @@ -24,7 +16,6 @@ function g() { } # Misc aliases -alias fl="fly -t ci login -c https://ci.cli.fun -n main -b" alias cfu="seed_users" alias where_my_bosh_lites_at="print_env_info" alias bosh_lites="print_env_info" @@ -55,4 +46,4 @@ function let_me_pull() { git remote set-url origin --push "${ssh_url}" git remote -v echo 'success!' -} +} \ No newline at end of file diff --git a/setup/bash-it.sh b/setup/bash-it.sh index 7608a8c..1c01dcd 100755 --- a/setup/bash-it.sh +++ b/setup/bash-it.sh @@ -36,3 +36,7 @@ enable_bash_it_completion ssh enable_bash_it_alias bundler enable_bash_it_alias git + +for filepath in ~/workspace/capi-workspace/custom-bash-it-plugins/*; do + enable_custom_bash_it_plugin $filepath +done diff --git a/setup/custom-bash-it-plugins.sh b/setup/custom-bash-it-plugins.sh deleted file mode 100755 index 9b9f98f..0000000 --- a/setup/custom-bash-it-plugins.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -source ./helpers/bash-it-helpers.sh - -for filepath in ~/workspace/capi-workspace/custom-bash-it-plugins/*; do - enable_custom_bash_it_plugin $filepath -done