Skip to content

Instantly share code, notes, and snippets.

@timster
Last active June 25, 2018 17:41
Show Gist options
  • Save timster/302013aa771068588acb to your computer and use it in GitHub Desktop.
Save timster/302013aa771068588acb to your computer and use it in GitHub Desktop.
# function to add to path if it doesn't already exist.
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
export PATH="${PATH:+"$PATH:"}$1"
fi
}
# set up pretty man colors
man() {
LESS_TERMCAP_md=$'\e[1;36m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[1;92m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[1;32m' \
command man "$@"
}
# store more bash history
export HISTFILESIZE=1000
# set up git tab completion
source ~/.gitcompletion
# set up homebrew environment
pathadd "/usr/local/bin"
pathadd "/usr/local/sbin"
alias coldbrew="brew update && brew upgrade; brew cleanup; brew doctor"
# set up java environment
set-java() {
export JAVA_HOME=`/usr/libexec/java_home -v $1`
}
set-java 1.8
# set up python environment
export WORKON_HOME="/Users/tim/.virtualenvs"
export PROJECT_HOME="/Users/tim/Developer"
source /usr/local/bin/virtualenvwrapper.sh
mkmod() {
mkdir -p "$1"
touch "${1}/__init__.py"
}
# set up aliases
alias edit-profile="code /Users/tim/.bash_profile"
alias source-profile="source /Users/tim/.bash_profile"
alias develop="cd /Users/tim/Developer/"
alias hiddenshow="defaults write com.apple.finder AppleShowAllFiles YES"
alias hiddenhide="defaults write com.apple.finder AppleShowAllFiles NO"
# set up prompt
PS1='\[\e[32m\]\w \$\[\e[m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment