#!/bin/bash
# -------------------------------------------------------------------
# ~/.bash_app.rc:Bash aliases for application defaults and overrides 
# vim: set filetype=sh: (vim modeline for syntax of this file)
# (c) Copyright 2008 _m (http://eccentrix.com/misc/mammon)
# -------------------------------------------------------------------

# -------------------------------------------------------------------
[ "$TERM" != "dumb" ] && eval "`dircolors -b`"


# -------------------------------------------------------------------
# Application overrides

alias ls='ls -Aq --color'		# default to color ls

alias vi=`which vim`			# always use vim!

alias du='du -sh'			# disk usage is human
alias df='df -h'			# disk freespace is human

alias objdump='objdump -DRTgrstx'	# sane disassembly
alias hexdump='hexdump -C'		# canonical hex dump


# Override lame default apps with useful 3rd-party ones if they exist
[ "" != "`which pinfo`" ] && alias info=`which pinfo`
[ "" != "`which colormake`" ] && alias make=`which colormake`
[ "" != "`which colordiff`" ] && alias diff=`which colordiff`
[ "" != "`which colorgcc`" ] && alias gcc=`which colorgcc`
[ "" != "`which colorsvn`" ] && alias svn=`which colorsvn`


# -------------------------------------------------------------------
# (Bash) Shell options

shopt -s no_empty_cmd_completion 
shopt -s cdspell        # fix dir-name typos in cd
shopt -s checkwinsize   # handle xterm resizing
shopt -s cmdhist        # save multi-line commands as one line
shopt -s dotglob        # allow tab-completion of '.' filenames
shopt -s extglob        # bonus regex globbing!
shopt -s hostcomplete   # tab-complete words containing @ as hostnames
shopt -s execfail	# failed execs don't exit shell
set -o notify           # show status of terminated programs immediately

ulimit -c 0		# create no core files
stty -ixon		# disable Ctrl-S and Ctrl-Q, which suck!

# Tab (readline) completion settings
set completion-ignore-case on
set match-hidden-files on
set show-all-if-ambiguous on

# History settings
HISTSIZE=256
HISTIGNORE="[   ]*:&:bg:fg:ls:exit:ls *:find ."	
HISTCONTROL=ignoredups:erasedups

export HISTSIZE HISTIGNORE HISTCONTROL 

MAILCHECK=              # no checking mail

export MAILCHECK

# -------------------------------------------------------------------
# Default applications

PAGER=`which less`		# for man pages
BROWSER=`which firefox`		# for xdg-open
EDITOR=`which vim`		# for visudo, crontab -e, etc
CVS_RSH=`which ssh`		# for cvs!
export PAGER BROWSER EDITOR CVS_RSH
 
