#!/bin/ksh93
#
# .kshrc	-- Commands executed by each Korn shell at startup
#

# If there is no VISUAL or EDITOR to deduce the desired edit mode from,
# and edit mode is not currently set,
# assume emacs-style command line editing to enable arrow keys
if [[ -z $VISUAL && -z $EDITOR && ! -o vi && ! -o emacs ]]; then
	set -o emacs
#	set -o vi
fi

# Set up arrow function keys (assumes (sco)ansi or vt100 terminal)
# ksh88 alias _X  maps Esc X, alias __X maps Esc [ X
# Works only for emacs mode.
alias __A=`echo '\020'`	# Up Arrow
alias __B=`echo '\016'`	# Down Arrow
alias __C=`echo '\006'`	# Right Arrow
alias __D=`echo '\002'`	# Left Arrow
alias __H=`echo '\001'`	# Home
alias __F=`echo '\005'`	# End
_TAB_Complete=1		# enable Tab for filename completion as well as Esc+Esc
