|
|
|
@ -8,8 +8,13 @@
|
|
|
|
|
# call script files correctly. |
|
|
|
|
symlink_dir=$( cd "$( dirname "`readlink -f ${BASH_SOURCE[0]}`" )" && pwd ) |
|
|
|
|
|
|
|
|
|
# Useful global functions |
|
|
|
|
alias cgen=$symlink_dir/scripts/cgen.sh |
|
|
|
|
# -------------------------------- SETUP -------------------------------- # |
|
|
|
|
|
|
|
|
|
# Store private information (exports, keys, etc) in .bash_private. |
|
|
|
|
if [[ -f ~/.bash_private ]]; then |
|
|
|
|
source ~/.bash_private |
|
|
|
|
echo ".bash_private loaded" |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [ -f ~/.inputrc ]; then |
|
|
|
|
bind -f ~/.inputrc |
|
|
|
@ -18,11 +23,17 @@ else
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then |
|
|
|
|
if [ -f ~/.macrc ]; then |
|
|
|
|
source ~/.macrc |
|
|
|
|
fi |
|
|
|
|
if [ -f ~/.macrc ]; then |
|
|
|
|
source ~/.macrc |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# ------------------------------ END SETUP ------------------------------ # |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# -------------------- FUNCTIONS -------------------- # |
|
|
|
|
|
|
|
|
|
parse_git_branch() { |
|
|
|
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' |
|
|
|
|
} |
|
|
|
@ -32,12 +43,49 @@ weather() {
|
|
|
|
|
curl wttr.in |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Test for the `bash-completion` package. Installing this adds better tab completion to bash. |
|
|
|
|
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" |
|
|
|
|
# ------------------ END FUNCTIONS ------------------ # |
|
|
|
|
|
|
|
|
|
# -------------- EXPORTS --------------# |
|
|
|
|
|
|
|
|
|
export CC=$(which clang) |
|
|
|
|
export CXX=$(which clang++) |
|
|
|
|
export OPENSSL_ROOT_DIR=$(which openssl) |
|
|
|
|
export PATH="/usr/local/opt/openjdk/bin:$PATH" |
|
|
|
|
|
|
|
|
|
# Ignore duplicates in history to make history less of a hassle to use. |
|
|
|
|
export HISTCONTROL=ignoredups |
|
|
|
|
|
|
|
|
|
# ------------ END EXPORTS ------------# |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---------------- ALIASES ----------------# |
|
|
|
|
|
|
|
|
|
# Useful global functions |
|
|
|
|
alias cgen=$symlink_dir/scripts/cgen.sh |
|
|
|
|
|
|
|
|
|
if [[ "$OS_TYPE" != "gnu-linux" ]]; then |
|
|
|
|
alias python='python3' |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
alias vim='nvim' |
|
|
|
|
|
|
|
|
|
# -------------- END ALIASES --------------# |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------- INITIALIZATIONS -------------------------------------- # |
|
|
|
|
|
|
|
|
|
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi |
|
|
|
|
|
|
|
|
|
eval "$(pyenv virtualenv-init -)" |
|
|
|
|
|
|
|
|
|
# Test for the `bash-completion` package. Installing this adds better tab completion to bash. |
|
|
|
|
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" |
|
|
|
|
|
|
|
|
|
# --------------------------------------- END INITIALIZATIONS ------------------------------------ # |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------ FORMATTING ------------------------------------------ # |
|
|
|
|
|
|
|
|
|
# Better color handling so scrolling doesn't get broken. |
|
|
|
|
# Note for Cygwin you need ncurses for this to work. |
|
|
|
|
reset=$(tput sgr0) |
|
|
|
|