use utf8;

my %common = (
	'H' => ["screen top"],
	'j' => ["entry $sign{down}"],
	'k' => ["entry $sign{up}"],
	'L' => ["screen bottom"],
	'^l'=> ["redraw"],
	'M' => ["screen middle"],
	'^m'=> ["select"],
	'n' => ["search $sign{down}"],
	'q' => ["exit"],
	't' => ["tag"],
	'z' => ["page $sign{down}"],
	'Z' => ["page $sign{up}"],
	'*' => ["last entry"],
	'=' => ["first entry"],
	':' => ["enter command"],
	';' => ["apply to tagged"],
	'>' => ["line $sign{down}"],
	'<' => ["line $sign{up}"],
	']' => ["half page $sign{down}"],
	'[' => ["half page $sign{up}"],
	'?' => ["help"],
	'!' => ["invoke shell"],
	'/' => ["search $sign{down}"],
	'+/'=> ["search $sign{up}"],
);

{
key => {
	%common,

	'@' => ["display sender"],
	'.' => ["list new mail"],
	'|' => ["pipe to shell"],
	'$' => ["save mailbox"],
	'#' => ["split up thread"],
	'&' => ["thread tagged"],
	'%' => ["toggle reado$sign{_}nl$sign{_}y"],

	'a' => ["create alias"],
	'b' => ["bounce"],
	'^b'=> ["url$sign{_}view"],
	'+b'=> ["search bodies"],
	'c' => ["open folder"],
	'C' => ["copy messag$sign{_}e"],
	'+c'=> ["open reado$sign{_}nly"],
	'+C'=> ["make plain copy"],
	'd' => ["delete"],
	'D' => ["delete patt$sign{_}er$sign{_}n"],
	'^d'=> ["delete thread"],
	'+d'=> ["delete subthread"],
	'e' => ["edit"],
	'^e'=> ["edit con$sign{_}tent type"],
	'+e'=> ["edit+send copy"],
	'f' => ["forward"],
	'F' => ["toggle important"],
	'^f'=> ["forget pass$sign{_}phras$sign{_}e"],
	'g' => ["reply to all", 'Group reply'],
	'G' => ["fetch POP", 'Gather new mail'],
	'h' => ["toggle headers"],
	'^i'=> ["unread msg $sign{down}"],
	'+^i'=> ["unread msg $sign{up}"],
	'j' => ["messag$sign{_}e $sign{down}"],
	'k' => ["messag$sign{_}e $sign{up}"],
	'J' => ["any $sign{down}"],
	'K' => ["any $sign{up}"],
	'^k'=> ["extract pub keys"],
	'+k'=> ["send public key"],
	'l' => ["limit pattern"],
	'L' => ["reply to list"],
	'+l'=> ["show current limit"],
	'm' => ["compo$sign{_}s$sign{_}e mail"],
	'N' => ["toggle new"],
	'^n'=> ["thread $sign{down}"],
	'+n'=> ["subthr$sign{_}ead $sign{down}"],
	'o' => ["sort"],
	'O' => ["sort reverse"],
	'p' => ["print"],
	'P' => ["to parent"],
	'^p'=> ["thread $sign{up}"],
	'+p'=> ["subthr$sign{_}ead $sign{up}"],
	'+P'=> ["check for pgp"],
	'q' => ["quit"],
	'Q' => ["query addr$sign{_}ess$sign{_}es"],
	'r' => ["reply to sender"],
	'R' => ["recall postpon$sign{_}e$sign{_}d"],
	'^r'=> ["mark thread read"],
	'+r'=> ["mark sub$sign{_}thread r$sign{_}ead"],
	's' => ["move"],
	'+s'=> ["save and delete"],
	'T' => ["tag patt$sign{_}er$sign{_}n"],
	'^t'=> ["untag pattern"],
	'+t'=> ["tag thread"],
	'u' => ["undo delete"],
	'U' => ["res$sign{_}tore pat$sign{_}t$sign{_}er$sign{_}n"],
	'^u'=> ["restore thread"],
	'+u'=> ["restore subthread"],
	'v' => ["attach$sign{_}ments"],
	'V' => ["version"],
	'+v'=> ["(un)collapse thread"],
	'+V'=> ["(un)collapse threads"],
	'w' => ["set flag"],
	'W' => ["clear flag"],
	'x' => ["abort"],
	'y' => ["list incoming mailboxes"],

	(map { 'm'.$_ => $common{$_} } keys %common),

	'm|' => ["pipe attach$sign{_}m$sign{_}ent"],
	'ma' => ["attach file"],
	'mA' => ["attach messag$sign{_}e"],
	'mb' => ["edit bcc"],
	'mc' => ["edit cc"],
	'mC' => ["copy file"],
	'md' => ["desc$sign{_}ribe attach$sign{_}m$sign{_}ent"],
	'mD' => ["delete attach$sign{_}m$sign{_}ent"],
	'm^d'=> ["dispo$sign{_}sition tog$sign{_}gle"],
	'me' => ["edit body"],
	'mE' => ["edit all"],
	'm^e'=> ["edit encoding"],
	'mf' => ["edit fcc"],
	'm^f'=> ["forget pass$sign{_}phrase"],
	'm+f'=> ["edit from"],
	'mF' => ["filter attach$sign{_}m$sign{_}ent"],
	'mG' => ["get attach$sign{_}m$sign{_}ent"],
	'mh' => ["display message"],
	'mi' => ["run ispell"],
	'ml' => ["print attach$sign{_}m$sign{_}ent"],
	'mm' => ["edit attach$sign{_}m$sign{_}ent", 'Mime-appropriate open'],
	'mM' => ["edit mix"],
	'm^m'=> ["view attach$sign{_}m$sign{_}ent"],
	'mn' => ["new attach$sign{_}m$sign{_}ent"],
	'mP' => ["post$sign{_}pone"],
	'mr' => ["edit reply$sign{_}-to"],
	'mR' => ["rename attach$sign{_}m$sign{_}ent"],
	'ms' => ["edit subject"],
	'mS' => ["s/mime options"],
	'mt' => ["edit to"],
	'm^t'=> ["ctype attach$sign{_}m$sign{_}ent"],
	'mw' => ["copy to folder"],
	'mu' => ["unlink toggle"],
	'mU' => ["encode attach$sign{_}m$sign{_}ent"],
	'my' => ["send"],

	'wD' => ["deleted"],
	'wN' => ["new"],
	'wO' => ["old"],
	'wr' => ["replied"],
	'w*' => ["tagged"],
	'w!' => ["flagged"],

	'/~A' => ["all"],
	'/~b' => ["msg body"],
	'/~B' => ["whole msg"],
	'/~c' => ["cc address"],
	'/~C' => ["to or cc address"],
	'/~d' => ["date sent ran$sign{_}g$sign{_}e"],
	'/~D' => ["deleted"],
	'/~e' => ["sender"],
	'/~E' => ["expired"],
	'/~f' => ["from"],
	'/~F' => ["flagged"],
	'/~g' => ["signed"],
	'/~G' => ["encryp$sign{_}ted"],
	'/~h' => ["header"],
	'/~H' => ["spam attr$sign{_}ib$sign{_}ute"],
	'/~i' => ["msg id"],
	'/~k' => ["pgp key"],
	'/~L' => ["receiv$sign{_}d by"],
	'/~l' => ["mailing list"],
	'/~m' => ["num$sign{_}ber ran$sign{_}g$sign{_}e"],
	'/~n' => ["score range"],
	'/~N' => ["new"],
	'/~O' => ["old"],
	'/~p' => ["to you"],
	'/~P' => ["by you"],
	'/~Q' => ["replies"],
	'/~r' => ["receive date ran$sign{_}ge"],
	'/~R' => ["read"],
	'/~s' => ["subject"],
	'/~S' => ["super$sign{_}seded"],
	'/~t' => ["to address"],
	'/~T' => ["tagged"],
	'/~u' => ["subscr$sign{_}ibed list"],
	'/~U' => ["unread"],
	'/~v' => ["collapsed thread"],
	'/~V' => ["verified"],
	'/~x' => ["refer$sign{_}ence"],
	'/~X' => ["attach$sign{_}ments"],
	'/~y' => ["x-label"],
	'/~z' => ["size range"],
	'/~=' => ["dupli$sign{_}cate"],
	'/~$' => ["unrefer$sign{_}enced"],
	'/~(' => ["in thread"],
},

mode => {
	'' => 'index',
	'm' => 'compose (m)',
	w => 'message flags (w)',
	'/~' => 'search flags (/~)',
},

}
