274 lines · 8.2 KB

# 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
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

# 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\]"
GREEN="\[\e[0;32m\]"
YELLOW="\[\e[0;33m\]"
BLUE="\[\e[0;34m\]"
PURPLE="\[\e[0;35m\]"
CYAN="\[\e[0;36m\]"
LIGHT_GREEN="\[\e[1;32m\]"
WHITE="\[\e[1;37m\]"
LIGHT_GRAY="\[\e[0;37m\]"
COLOR_NONE="\[\e[0m\]"

# Format the prompt
function prompt_func() {

    # Show Git branch in prompt