# ~/.bashrc file by luc #+ many thanks to the people from #+ http://crunchbanglinux.org/forums/topic/1093/post-your-bashrc/ #+ http://wiki.archlinux.org/index.php/Color_Bash_Prompt ############################################################################## # If not running interactively, don't do anything if [[ -z $PS1 ]] ; then return ; fi ############################################################################## # PROMPT ############################################################################## RS='\[\033[m\]' # reset all plain HI='\[\033[1m\]' # hicolor UL='\[\033[4m\]' # underline # foreground # backgroung # color FN='\[\033[30m\]' BN='\[\033[40m\]' # black FR='\[\033[31m\]' BR='\[\033[41m\]' # red FG='\[\033[32m\]' BG='\[\033[42m\]' # green FY='\[\033[33m\]' BY='\[\033[43m\]' # yellow FB='\[\033[34m\]' BB='\[\033[44m\]' # blue FP='\[\033[35m\]' BP='\[\033[45m\]' # purple FC='\[\033[36m\]' BC='\[\033[46m\]' # cyan FW='\[\033[37m\]' BW='\[\033[47m\]' # white PROMPT_COMMAND='ret=$?' # for the PS1 prompt. PS1="[ $FG\u$FC@$FB\h $RS| $FC\W $RS| \t | \`[[ \$? -ne 0 ]]&&echo '$FR'\`\$ret $RS] " unset PL HI UL {F,B}{N,R,G,Y,B,P,C,W} # dont clutter env ############################################################################## # ENVIREMENT VARIABLES ############################################################################## ## PATH should already be exported to the envirement. if [[ -d $HOME/bin ]]; then PATH=$HOME/bin:$PATH ; fi if [[ -x /usr/local/bin/brew ]]; then PATH=/usr/local/sbin:/usr/local/bin:$PATH; fi if [[ -x /usr/texbin/pdflatex ]]; then PATH=/usr/texbin:$PATH; fi if type most >/dev/null 2>&1 ; then PAGER=most # does not need LESS_TERMCAP_* export PAGER else # default pager program should be "less" LESS_TERMCAP_mb=$'\033[01;31m' # begin blinking LESS_TERMCAP_md=$'\033[01;31m' # begin bold LESS_TERMCAP_me=$'\033[0m' # end mode LESS_TERMCAP_se=$'\033[0m' # end standout-mode LESS_TERMCAP_so=$'\033[01;44;33m' # begin standout-mode - info box LESS_TERMCAP_ue=$'\033[0m' # end underline LESS_TERMCAP_us=$'\033[01;32m' # begin underline export LESS_TERMCAP_{mb,md,me,se,so,ue,us} fi ## ALL SYSTEMS EDITOR=vi # for command line editing with ^x+e IGNOREEOF=1 # type ^D twice to logout HISTCONTROL=erasedups # save same line to history only once HISTSIZE=2000 FIGNORE='~:.o:.bak:.swp' # also see "shopt -u force_fignore" #export PAGER=vimpager # does not use LESS_TERMCAP_* (from brew) ## SYSTEM SPECIFIC case `uname` in LINUX|Linux|linux) ;; Darwin) # MacOS X # do not work with ._* files COPY_EXTENDED_ATTRIBUTES_DISABLE=true BROWSER=browser # script installed with brew (uses "open") HTMLPAGER="elinks --dump" export COPY_EXTENDED_ATTRIBUTES_DISABLE BROWSER HTMLPAGER ;; OpenBSD) export PKG_PATH=ftp://ftp.spline.de/pub/OpenBSD/`uname -r`/packages/`machine -a`/ ;; esac # export all important vars to the envirement (add others if neccessary) export PATH ############################################################################# # SHELL OPTIONS ############################################################################## shopt -s checkwinsize # check window size after a process completes shopt -u force_fignore # don't complete w/ iff other files available shopt -s extglob # ?: "<=1", *: "any", +: "<0", @: "=", !: "not" #shopt -s gnu_errfmt # what would it do?? #shopt -s hostcomplete # why is this sop buggy?? ############################################################################## # ALIAS & FILES TO SOUCE ############################################################################## # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [[ -f $HOME/.aliases ]] ; then . $HOME/.aliases ; fi # enable programmable completion features (you don't need to enable this, if # it's already enabled in /etc/bashrc and /etc/profile sources /etc/bashrc). if [[ -r /etc/bash_completion ]]; then . /etc/bash_completion # default elif [[ -r /usr/local/etc/bash_completion ]]; then . /usr/local/etc/bash_completion # brew fi # make less more friendly for non-text input files, see lesspipe(1) if [[ -x /usr/bin/lesspipe ]]; then eval "$(lesspipe)" elif [[ -x /usr/local/bin/lesspipe.sh ]]; then eval "$(lesspipe.sh)" #mac os x fi ############################################################################## # TODO ############################################################################## # this and dircolors in general #if [ "$TERM" != "dumb" ]; then eval "`dircolors -b`"; fi