Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

112 lines (93 sloc) 3.108 kb
export EDITOR=vim
export TZ="/usr/share/zoneinfo/America/Los_Angeles"
NM="\[\033[0;38m\]" #means no background and white lines
HI="\[\033[0;37m\]" #change this for letter colors
HII="\[\033[0;31m\]" #change this for letter colors
SI="\[\033[0;33m\]" #this is for the current directory
IN="\[\033[0m\]"
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
if [[ -f /etc/DIR_COLORS ]] ; then
match_lhs=$(</etc/DIR_COLORS)
elif type -p dircolors >/dev/null ; then
match_lhs=$(dircolors --print-database)
else
match_lhs=""
fi
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
source ~/.bashrc.d/gitcompletion.bash
function __git_prompt {
GIT_PS1_SHOWDIRTYSTATE=1
[ `git config user.pair` ] && GIT_PS1_PAIR="`git config user.pair`@"
__git_ps1 " $GIT_PS1_PAIR%s" | sed 's/ \([+*]\{1,\}\)$/\1/'
}
bash_prompt() {
# regular colors
local K="\[\033[0;30m\]" # black
local R="\[\033[0;31m\]" # red
local G="\[\033[0;32m\]" # green
local Y="\[\033[0;33m\]" # yellow
local B="\[\033[0;34m\]" # blue
local M="\[\033[0;35m\]" # magenta
local C="\[\033[0;36m\]" # cyan
local W="\[\033[0;37m\]" # white
# emphasized (bolded) colors
local BK="\[\033[1;30m\]"
local BR="\[\033[1;31m\]"
local BG="\[\033[1;32m\]"
local BY="\[\033[1;33m\]"
local BB="\[\033[1;34m\]"
local BM="\[\033[1;35m\]"
local BC="\[\033[1;36m\]"
local BW="\[\033[1;37m\]"
# reset
local RESET="\[\033[0;37m\]"
if ${use_color} ; then
if [[ ${EUID} == 0 ]] ; then
PS1='$BR\H$BB \W $(__git_ps1 " (%s) " )$RESET$ '
else
PS1='$BG\u@\H$BB \w $(__git_ps1 " (%s) ")$RESET$ '
fi
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1='\u@\h \W \$ '
else
PS1='\u@\h \w \$ '
fi
fi
}
bash_prompt
unset bash_prompt
export LS_OPTIONS='--color=always'
eval `dircolors ~/.dir_colors`
# Useful aliases
alias ls='ls $LS_OPTIONS -hF'
alias ll='ls $LS_OPTIONS -lhF'
alias l='ls $LS_OPTIONS -lAhF'
alias cd..="cd .."
alias c="clear"
alias e="exit"
alias ssh="ssh -X"
alias ..="cd .."
HISTFILESIZE=50000000
HISTSIZE=500
#export HISTTIMEFORMAT='%a, %d %b %Y %l:%M:%S%p %z '
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
alias df='df -h' # '19G' instead of '19228276'
alias du='du -h' # '501M' instead of '512116'
shopt -s cdspell
shopt -s cmdhist
shopt -s lithist
shopt -s histappend
complete -o default -A hostname ssh ftp ping telnet traceroute
# Returns a listing of processes I own
function psme ( ) { ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command; }
# Show my processes with tree like structure of threads
function psmep ( ) { psme f | awk '!/awk/ && $0~var' var=${1:-".*"}; }
# colordiff is hella nice. Let's use it with some SCM tools
cvsdiff () { cvs diff -u "${@}" | colordiff; }
svndiff () { svn diff "${@}" | colordiff; }
gitdiff () { git diff "${@}" | colordiff; } # git can do it's own, but heck.
export TERM=xterm-256color
export EDITOR PATH CVSROOT CVS_RSH HISTCONTROL HISTIGNORE HISTSIZE HISTFILESIZE PS1 PS2 LSCOLORS GREP_OPTIONS
source ~/.bashrc
Jump to Line
Something went wrong with that request. Please try again.