153 lines · 4.5 KB
set -o vi

tty=$(tty)
export GPG_TTY=$tty

# Path
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH="/usr/local/share/npm/bin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/python/libexec/bin:$PATH" # Homebrew Python (typically 3)
export PATH="$HOME/Library/Python/3.6/bin:$PATH" # Python 3 bin
export PATH="$HOME/.local/bin:$PATH" # Stack (Haskell) puts stuff here
export PATH="$HOME/.cabal/bin:$PATH" # Cabal (Haskell) puts stuff here
ruby_prefix=$(brew --prefix ruby)/bin
export PATH=$ruby_prefix/bin:$PATH # rubygems

# Bash completion
bash_completion=/usr/local/etc/profile.d/bash_completion.sh
# shellcheck disable=1090
[[ -r $bash_completion ]] && . $bash_completion

# Set the terminal into 256 color mode
export TERM=xterm-256color

# Shorten the pwd in the prompt to show only the n number of characters
# NOTE: Bash 4+ only
PROMPT_DIRTRIM=2

# Ascii color escape codes
# Note that 256 color foreground codes follow the following format:
# SAMPLE_256_COLOR="\[\e[38;05;255m\]"
RED="\[\e[0;31m\]"
YELLOW="\[\e[0;33m\]"
CYAN="\[\e[0;36m\]"
COLOR_NONE="\[\e[0m\]"

# Show Git branch in prompt
git_completion=/usr/local/etc/bash_completion.d/git-completion.bash
if [ -f $git_completion ]; then
    export GIT_PS1_SHOWDIRTYSTATE=true