Thursday, January 17, 2008

Enabling the Home/End/Delete Keys on a *nix Machine

Make the Home/End/Delete key function like you would assume that they would!

In your .profile file (create it if necessary in your home directory), if you add the following to the bottom (or top), you can enable the Home/End/Delete keys:

case $TERM in
xterm*)
bind '"\e[1~": beginning-of-line'
bind '"\e[3~": delete-char'
bind '"\e[4~": end-of-line'
bind '"\177": backward-delete-char'
;;
esac
This would enable the hot keys for your profile.

If you want to set them up system wide, then (as root) add the following to the end of your /etc/inputrc file:

"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[3~": delete-char
"\177": backward-delete-char