Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created October 27, 2009 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennethreitz/219725 to your computer and use it in GitHub Desktop.
Save kennethreitz/219725 to your computer and use it in GitHub Desktop.
My .bashrc configuration
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth
export EDITOR=vim
export VISUAL=vim
export PATH=/usr/local/mysql/bin:/Applications/MAMP/bin/php5/bin:/opt/local/bin:/opt/local/sbin:/Developer/usr/bin:$PATH
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
unset color_prompt force_color_prompt
# Hehe, neat.
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# alias me
alias ll='ls -l'
alias la='ls -A'
alias l='ls -lrtha'
alias dnsflush='dscacheutil -flushcache'
alias yt='youtube_dl -bt'
alias push='git commit -a -m "Update" & git push'
alias yuic='java -jar /Library/yuicompressor.jar'
# yay completion
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
export PATH=/opt/local/bin:/opt/local/sbin:$PATH # MacPorts
export GRAILS_HOME=/System/Library/Frameworks/Grails.framework/Current/ # Grails
export PATH=/System/Library/Frameworks/Grails.framework/Current/bin:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment