Find file
9ebcfc9 Jan 14, 2016
69 lines (60 sloc) 1.79 KB
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/
# Local, unversioned init.
if [ -f $DIR/ ]
source $DIR/
# Aliases.
alias ..="cd .."
alias cd..="cd .."
alias sr="screen -r"
alias ll="ls -alF"
alias la="ls -A"
alias l="ls -CF"
alias gr="egrep -r"
alias brc="vim ~/src/bashrc/"
alias brcl="vim ~/src/bashrc/"
alias src="source ~/.bashrc"
alias k="kill %%"
alias r="bundle exec rspec"
alias beg="bundle exec guard"
# Git.
alias gca="git commit -a"
alias gb="git branch"
alias gd="git diff"
alias gch="git checkout"
alias gpom="git pull origin master"
alias gp="git pull"
alias gs="git status"
alias gbddd="git branch --merged | grep -v '\*' | grep -v '^ master$' | xargs -n 1 git branch -d"
# Common repos.
alias s="cd ~/src"
alias sb="cd ~/src/bashrc"
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
export HISTFILE=~/.bash_eternal_history
# Force prompt to write history after every command.
shopt -s histappend
stophistory () {
echo 'History recording stopped.'
# Go path.
export GOPATH=$HOME/go/
export PATH=$PATH:$GOPATH/bin
# Setup ssh-agent.
if [[ $OSTYPE == 'linux-gnu' ]]; then
pgrep -f ssh-agent > /dev/null || ssh-agent > ~/.ssh/
eval `cat ~/.ssh/`