Skip to content

Commit

Permalink
Separate bash-it specific loading of capi config
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Aakash Shah committed Jul 8, 2020
1 parent eee1889 commit 4c0f1bd
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 34 deletions.
3 changes: 3 additions & 0 deletions bash-it/shell-prompt-settings.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# shell prompt settings
export HISTTIMEFORMAT="%F %T "
export THEME_CLOCK_CHAR="⛅️ "
1 change: 0 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/alias-nvim.bash

This file was deleted.

21 changes: 21 additions & 0 deletions lib/aliases.bash
Original file line number Diff line number Diff line change
@@ -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'
1 change: 0 additions & 1 deletion lib/always-sha2.bash

This file was deleted.

6 changes: 2 additions & 4 deletions lib/capi-env.bash → lib/environment-variables.bash
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
23 changes: 7 additions & 16 deletions lib/capi-aliases.bash → lib/misc.bash
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -55,4 +46,4 @@ function let_me_pull() {
git remote set-url origin --push "${ssh_url}"
git remote -v
echo 'success!'
}
}
4 changes: 4 additions & 0 deletions setup/bash-it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 0 additions & 9 deletions setup/custom-bash-it-plugins.sh

This file was deleted.

0 comments on commit 4c0f1bd

Please sign in to comment.