hardlyneutral
11/1/2013 - 1:52 PM

Customization to my bash profile.

Customization to my bash profile.

#  Description:  This file holds all my BASH configurations and aliases
#
#  Sections:
#  1.   Environment Configuration
#  2.   Make Terminal Better (remapping defaults and adding functionality)
#  3.   Web Development
#  4.   Reminders & Notes
#
#  ---------------------------------------------------------------------------

#   -------------------------------
#   1.  ENVIRONMENT CONFIGURATION
#   -------------------------------

#   Set .profile source
#   ------------------------------------------------------------
    source ~/.profile

#   Add color to terminal
    export TERM=xterm-256color

    DEFAULT=$"\e[38;5;247m"
    PINK=$"\e[38;5;163m"
    GREEN=$"\e[38;5;76m"
    ORANGE=$"\e[38;5;208m"
    RED=$"\e[38;5;160m"
    BLUE=$"\e[38;5;26m"
    RS=$"\[\033[0m\]"

#   Change Prompt
#   PS1 options:
#   n = newline
#   l = basename of the shell’s terminal device name
#   w = current working directory, with $HOME abbreviated with a tilde
#   h = hostname, up to the first ‘.’
#   u = username of the current user
#   ------------------------------------------------------------
    export PS1="${GREEN}________________________________________________________________________________\n\
${DEFAULT}\l ${GREEN}\w ${RED}@ ${ORANGE}\h ${PINK}(\u) ${BLUE}\$(parse_git_branch)\n\
${GREEN}=> $RS"

#   Add git branch information to the terminal
#   ---------------------------------------
    parse_git_branch() {
      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
    }

#   Set Paths
#   ------------------------------------------------------------
    export PATH=$PATH:/Users/hardlyneutral/Library/Android/sdk/tools:/Users/hardlyneutral/Android/sdk/platform-tools
    export PATH="/usr/local/bin:$PATH"
    export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
    export PATH="/usr/bin:/usr/sbin:~/bin:$PATH"
    export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"

#   Set Default Editor
#   ------------------------------------------------------------
    export EDITOR=/usr/bin/vi

#   Set default blocksize for ls, df, du
#   ------------------------------------------------------------
    export BLOCKSIZE=1k


#   -----------------------------
#   2.  MAKE TERMINAL BETTER
#   -----------------------------

    alias cp='cp -iv'           # -i interactive, -v verbose
    alias mv='mv -iv'           # -i interactive, -v verbose
    alias mkdir='mkdir -pv'     # -p create parent directories as necessary, -v verbose
    alias ll='ls -FGlAhp'       # Preferred 'ls' implementation


#   ---------------------------------------
#   3.  WEB DEVELOPMENT
#   ---------------------------------------

#   rbenv
#   ---------------------------------------
    if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

#   Load RVM into a shell session *as a function*
#   ---------------------------------------
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

#   Load Postgres.app command line tools
#   ---------------------------------------
    export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

#   Set a MongoDB alias that passes the correct db directory location
#   ---------------------------------------
    alias mongod="mongod --dbpath /Users/EJ/projects/mongodb/data/db"


#   ---------------------------------------
#   4.  REMINDERS & NOTES
#   ---------------------------------------

#   Add notes and stuff here
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"