For the arrow keys, you can put this into your the .kshrc file in your home directory:
set -o emacs
alias __A=`echo "20"` # up arrow = ^p = back a command
alias __B=`echo "16"` # down arrow = ^n = down a command
alias __C=`echo "06"` # right arrow = ^f = forward a character
alias __D=`echo "02"` # left arrow = ^b = back a character
alias __H=`echo "01"` # home = ^a = start of line
alias __Y=`echo "05"` # end = ^e = end of line
Note that there are two underscore characters before the letters on the left side of the equal sign. On the right-hand side of the equal, the goal is to get the proper control character assigned to the alias. The way this script does that, is by running the command (via back-tics)
echo "20"
to get the control-n character assigned to __B.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…