File: keybind.txt

package info (click to toggle)
ksh93u%2Bm 1.0.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,744 kB
  • sloc: ansic: 142,757; sh: 33,435; makefile: 32
file content (14 lines) | stat: -rw-r--r-- 282 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
typeset -A Keytable
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
function keybind # key action
{ 
	typeset key=$(print -f "%q" "$2")
	case $# in
	2)	Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key"
		;;
	1)	unset Keytable[$1]
		;;
	*)	print -u2 "Usage: $0 key [action]"
		;;
	esac
}