Skip to content

Instantly share code, notes, and snippets.

@curiouslychase
Created March 20, 2013 22:40
Show Gist options
  • Save curiouslychase/5209212 to your computer and use it in GitHub Desktop.
Save curiouslychase/5209212 to your computer and use it in GitHub Desktop.
General bashrc sourced from my bash_profile
#!/bin/bash
# This is my general bashrc that I source into bash_profile.
# Why you ask? Good question: Because I have more than one computer that
# I use terminal and vim on and the bash_profiles on both of them have totally
# different aliases for directory hotswitching and other commands.
# For some reason this is required for the PS1 to work with __git_ps1
PATH="/usr/local/bin:${PATH}"
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
print_pre_prompt ()
{
# Make that Command Prompt look good
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWSTASHSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
usrcolor='\e[0;34m'
dircolor='\e[m:\e[1;36m'
gitcolor='\e[1;32m'
closer='\e[m'
gitstatus='$(__git_ps1 " %s")'
PS1L="[\[$usrcolor\]\u\[$dircolor\]\w"
PS1="$PS1L\[$closer\]]\[$gitcolor\]\[$gitstatus\]\[$closer\]\n> "
}
print_pre_prompt
# General Terminal Aliases
alias ls='ls -G -a'
alias l='ls -al'
alias lp='ls -p'
alias h='history'
# MacVim/Sublime Aliases
alias vi='/Applications/MacVim.app/Contents/MacOS/Vim -g -p'
alias vit='/Applications/MacVim.app/Contents/MacOS/Vim -g -p --remote-tab-silent'
alias svit='sudo /Applications/MacVim.app/Contents/MacOS/Vim -g -p'
alias subl="sublime $1"
# ZOMG Colors!
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagacad
alias rbash='. ~/.bash_profile'
alias ebash='subl ~/.bash_profile'
alias cbash='subl ~/cbin/bash/chase.bashrc'
# Lets be honest, we all need a little chase bin in our live's.
alias cbin='cd ~/cbin/'
# Git
alias st='git status'
alias df='git diff'
alias gl='git log'
alias gitclean='git checkout -f --'
alias gitdirty='git reset --hard'
# Make Terminal JSON repsonses pretty
alias pp='python -mjson.tool'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment