Following snippet is not by my hand but I am posting it anyway as I am unable to find the original reference to it.

stty kill "^U" intr "^C" erase "^?" eof "^D" susp "^Z" dsusp "^Y" \
hupcl ixon ixoff cs8 -istrip
umask 027
export PATH=$PATH:/sbin
EDITOR=vi ; export EDITOR
# Enable usage of arrow keys in command line
# If not set, use (Esc-K/Esc-J for command repeat)
set -o emacs
alias __A=`echo "\020"` # up arrow = back a command
alias __B=`echo "\016"` # down arrow = down a command
alias __C=`echo "\006"` # right arrow = forward a character
alias __D=`echo "\002"` # left arrow = back a character
alias __H=`echo "\001"` # home = start of line; work with Putty -> Function Keys=SCO
alias __Q=`echo "\005"` # end = end of line - does not work for me
# Some sets for vi & avoid exit on Ctrl-d
set -o ignoreeof