Skip to content

Instantly share code, notes, and snippets.

@sleicester
Created January 25, 2014 17:30
Show Gist options
  • Save sleicester/49fafb7d7018504c1527 to your computer and use it in GitHub Desktop.
Save sleicester/49fafb7d7018504c1527 to your computer and use it in GitHub Desktop.
.bash_profile that includes more colour, maintains history between tabs by writing each prompt display, also allows the user of up to traverse through items that start with x
source ~/.profile
# Setup binary path locations
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
# Make Bash append rather than overwrite the history on disk:
shopt -s histappend
# Whenever displaying the prompt, write the previous line to disk:
PROMPT_COMMAND='history -a'
eval "$(rbenv init -)"
# Part of git completion
# brew install git bash-completion
# https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# brew install grc
# https://github.com/mifix/homebrew-grc
source "`brew --prefix`/etc/grc.bashrc"
# Tell ls to be colourful
export CLICOLOR=1
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# Automatically assign proxy settings within terminal (http://blog.willcannings.com/2011/08/17/automatically-assign-http_proxy-in-os-x-lion/)
export http_proxy=`networksetup -getwebproxy Wi-Fi | awk '{ if(NR == 1) enabled=$2; else if(NR == 2) server=$2; else if(NR == 3) port=$2;} END {if(enabled == "Yes") print "http://" server ":" port}'`
export https_proxy=`networksetup -getsecurewebproxy Wi-Fi | awk '{ if(NR == 1) enabled=$2; else if(NR == 2) server=$2; else if(NR == 3) port=$2;} END {if(enabled == "Yes") print "http://" server ":" port}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment