Skip to content

Instantly share code, notes, and snippets.

@emson

emson/.bash_profile

Created Sep 9, 2011
Embed
What would you like to do?
My .bash_profile
# Ben's .bash_profile file
# path settings
PATH="/usr/local/bin:/usr/local/sbin:$PATH" # if not already present
PATH="$PATH:/usr/local/mysql/bin"
PATH="$PATH:/usr/local/mysql/support-files/"
PATH="$PATH:~/scripts:"
export PATH=$PATH
export EDITOR='mate'
export VISUAL=$EDITOR
# ===== Initialisations =====
# ===== includes =====
source ~/scripts/mysql_utils.sh
# ===== aliases =====
alias cd..='cd ..'
alias ls='ls -F'
alias ll='clear;pwd;ls -F'
alias path='echo -e ${PATH//\:/\\n}'
alias openrails='open http://localhost:3000'
alias term='terminitor'
alias b='bundle exec'
alias ht='cd ~/devel/rails/HouseTrip-Web-App'
# ====== functions =====
# function to change directory to the one set in the last opened finder.
cdf () {
currFolderPath=$( /usr/bin/osascript <<" EOT"
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
end tell
EOT
)
echo "cd to \"$currFolderPath\""
cd "$currFolderPath"
}
# change file to lower case
lower () {
for i in "$1"; do
mv "$i" "`echo $i| tr [A-Z] [a-z]`";
done
}
# Git branch in prompt
function parse_git_branch_appended {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo -ne "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
# PS1="\[$GREEN\]\h:\W \[$YELLOW\]\$(parse_git_branch)\[$GREEN\]\[\$\] "
# PS1='\[\033[1;34m\]\$\[\033[0m\] '
PS1="\[\033[0m\]\W:\[\033[0;33m\]\$(parse_git_branch_appended)\[\033[0;32m\]\$ "
# __git_ps1 ()
# {
# local b="$(git symbolic-ref HEAD 2>/dev/null)";
# if [ -n "$b" ]; then
# printf " (%s)" "${b##refs/heads/}";
# fi
# }
#
# PS1="\W\$(__git_ps1)$ "
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment