dotfiles/.bashrc
2024-05-16 11:45:45 -05:00

52 lines
1.1 KiB
Bash

# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# color table:
# Black 0;30
# Blue 0;34
# Green 0;32
# Cyan 0;36
# Red 0;31
# Purple 0;35
# Brown 0;33
# [Note: Replace 0 with 1 for dark color]
export bash_rc_files=$(find -L ~/.bash_rc.d/ -type f | grep -v '\.swp$' | sort)
for rc_file in $bash_rc_files; do
#echo "sourcing ${rc_file}"
source $rc_file;
done
# User specific aliases and functions go here (override system defaults)
if [[ $TERM == "dumb" ]]; then
PS1='\u@\h$ '
else
PS1='[\e[1;36m$(date +%H:%M)\e[m] [\e[01;32m\u@\h\e[m] (\e[01;32m\]$(pwd)\e[m\])\n\$> '
fi
insert_path_element_before /opt/brew/bin
insert_path_element_before ~/bin
function re_source() {
source ~/.bashrc
}
export PAGER="less -R"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
if [ -f "$HOME/Library/Application Support/dnvm/env" ]; then
. "$HOME/Library/Application Support/dnvm/env"
fi