Skip to content

Instantly share code, notes, and snippets.

@hectorcorrea hectorcorrea/.bashrc
Last active Jul 21, 2017

Embed
What would you like to do?
My .bashrc
# On a Mac, make sure to source this file from .bash_profile
# source ~/.bashrc
#
PS1="\w \$ "
alias ls='ls -G -la'
alias st='git status'
alias br='git branch'
alias co='git checkout'
alias lg='git log'
alias df='git diff'
alias grlast='git reset HEAD~1'
alias be='bundle exec'
alias rr='bundle exec rails server'
alias tt='go test ./...'
alias gg='go build && ./ldpserver'
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
alias atom='/Applications/Atom.app/Contents/Resources/app/atom.sh'
# eval "$(rbenv init -)"
export GOPATH=~/dev/go
export PATH=/usr/local/fits-0.6.2:/usr/local/bin:/usr/bin:/Applications/LibreOffice.app/Contents/MacOS:$PATH
# To compile Fedora 4 source code
# export PATH=/usr/local/maven/bin:$PATH
# export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
cd ~/dev
# tabname
# http://thelucid.com/2012/01/04/naming-your-terminal-tabs-in-osx-lion/
function tn {
printf "\e]1;${1:-bash}\a"
}
# bundle grep
function bgrep {
if [ -z "$1" ]; then
echo "usage: bgrep text-to-search"
return 1
fi
echo "Searching for $1"
grep -r $1 $(bundle show --paths) .
}
# bundle find
function bfind {
if [ -z "$1" ]; then
echo "usage: bfind file-name-to-search"
return 1
fi
find $(bundle show --paths) -iname "*$1*"
}
# job grep
function jgrep {
if [ -z "$1" ]; then
echo "usage: jgrep job-to-search"
return 1
fi
echo "Searching for $1"
ps aux | grep $1
}
function ff {
if [ -z "$1" ]; then
echo "usage: ff name-of-file"
return 1
fi
find ./ -iname "*$1*"
}
function gf {
if [ -z "$1" ]; then
echo "usage: gf string-to-search"
return 1
fi
git log -S"$1" -- .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.