use utf8;
{

'' => {
	'~' => ["co undo"],
	'!' => ["co argm undo modec"],
	'@' => ["co arg undo"],
	'#' => ["pm ext vim6"],
	'$' => ["pm"],
	'%' => ["pm"],
	'^' => ["pm"],
	'&' => ["co undo"],
	'*' => ["pm ext vim6"],
	'(' => ['pm'],
	')' => ['pm'],
	'_' => ["pm"],
	'+' => ["pm"],
	'`' => ["pm arg"],
	'0' => ["pm"],
	'^^'=> ["co"],
	'-' => ["pm"],
	'=' => ['co argm undo'],
	'?' => ["pm arg modec"],
	';' => ["pm"],
	':' => ["co modec"],
	"'" => ["pm arg"],
	'"' => ['co arg'],
	'\\' => ['me arg'],
	'^\\' => ["mo arg"],
	',' => ["pm"],
	'<' => ["co argm undo"],
	'.' => ["co undo"],
	'>' => ["co argm undo"],
	'/' => ["pm arg modec"],
	'[' => ["me arg mode["],
	'{' => ["pm"],
	']' => ["me arg mode]"],
	'}' => ["pm"],
	'^]'=> ["po"],
	'|' => ["pm"],

	'a' => ["mi undo modei"],
	'A' => ["mi undo modei"],
	'^a'=> ["co undo"],
	'b' => ["pm"],
	'B' => ["pm"],
	'^b'=> ["pm"],
	'c' => ["mi argm undo modei"],
	'C' => ["mi undo modei"],
	'^c'=> ["co"],
	'd' => ["co argm undo"],
	'D' => ["co undo"],
	'^d'=> ["po"],
	'e' => ["pm"],
	'E' => ["pm"],
	'^e'=> ["po"],
	'f' => ["pm arg"],
	'F' => ["pm arg"],
	'^f'=> ["pm"],
	'g' => ["me arg modeg"],
	'G' => ["pm"],
	'^g'=> ["ci"],
	'h' => ["pm"],
	'H' => ["pm"],
	'^h'=> "h",
	'i' => ["mi undo modei"],
	'I' => ["mi undo modei"],
	'^i'=> ["pm ext vim6"],
	'j' => ["pm"],
	'J' => ["co undo"],
	'^j'=> "j",
	'k' => ["pm"],
	'K' => ["co"],
	'l' => ["pm"],
	'L' => ["pm"],
	'^l'=> ["ci"],
	'm' => ["co arg"],
	'M' => ["pm"],
	'^m'=> "+",
	'n' => ["pm"],
	'N' => ["pm"],
	'^n'=> "j",
	'o' => ["mi undo modei"],
	'O' => ["mi undo modei"],
	'^o'=> ["pm ext vim6"],
	'p' => ["co undo"],
	'P' => ["co undo"],
	'^p'=> "k",
	'q' => ["mo arg"],
	'Q' => ["mo"],
	'^q'=> ["ci"], # or ^v
	'r' => ["co arg undo"],
	'R' => ["mi undo modei"],
	'^r'=> ["co undo ext vim6"],
	's' => ["mi undo modei"],
	'S' => ["mi undo modei"],
	'^s'=> ["ci"],
	't' => ["pm arg"],
	'T' => ["pm"],
	'^t'=> ["po"],
	'u' => ["co undo"],
	'U' => ["co undo"],
	'^u'=> ["po"],
	'v' => ["mv modev"],
	'V' => ["mv modev"],
	'^v'=> ["mv modev ext vim6"],
	'w' => ["pm"],
	'W' => ["pm"],
	'^w'=> ["me arg mode^w"],
	'x' => ["co undo"],
	'X' => ["co undo"],
	'^x'=> ["co undo"],
	'y' => ["co argm"],
	'Y' => ["co"],
	'^y'=> ["po"],
	'z' => ["me arg modez"],
	'Z' => ["me arg modeZ"],
	'^z'=> ["ci"],
}, # normal mode

g => {
	lead => "g",

	"\e"=> ["mo mode"],

	'~' => ["co argm ext vim6"],
	'@' => ["co ext vim7 new"],
	'#' => ["pm ext vim6"],
	'$' => ["pm"],
	'^' => ["pm ext vim6"],
	'&' => ["co"],
	'*' => ["pm ext vim6"],
	'_' => ["pm ext vim6"],
	'+' => ["co ext vim7 new"],
	'`' => ["pm ext vim6 arg"],
	'8' => ["ci"],
	'0' => ["pm ext vim6"],
	'-' => ["co ext vim7 new"],
	'^['=> ["mo mode"],
	']' => ["po"],
	'^]'=> ["po"],
	';' => ["pm"],
	"'" => ["pm ext vim6 arg"],
	'<' => ["co ext vim7 new"],
	'?' => ["co argm ext vim6"],
	',' => ["pm"],

	'a' => ["ci"],
	'^a'=> ["ci"],
	'd' => ["pm ext vim6"],
	'D' => ["pm ext vim6"],
	'e' => ["pm"],
	'E' => ["pm"],
	'f' => ["co ext vim6"],
	'F' => ["co ext vim7 new"],
	'g' => ["pm"],
	'^g'=> ["ci"],
	'h' => ["mv modev"],
	'H' => ["mv modev"],
	'^h'=> ["mv modev ext vim6"],
	'i' => ["mi undo modei"],
	'I' => ["mi undo modei"],
	'j' => ["pm ext vim6"],
	'J' => ["co"],
	'k' => ["pm ext vim6"],
	'm' => ["pm ext vim6"],
	'o' => ["pm"],
	'p' => ["co undo"],
	'P' => ["co"],
	'q' => ["co argm"],
	'Q' => ["mo ext vim6"],
	'r' => ["co arg"],
	'R' => ["mi undo modei"],
	's' => ["ci ext vim6"],
	't' => ["po ext vim7 new"],
	'T' => ["po ext vim7 new"],
	'u' => ["co argm ext vim6"], # XXX undo?
	'U' => ["co undo argm ext vim6"],
	'v' => ['mv modev'],
	'V' => ["co"],
	'w' => ["co argm ext vim7 new"],
	'x' => ["co ext vim7 new"],
}, # mode g

Z => {
	lead => "Z",

	"\e"=> ["mo mode"],
	'^['=> "\e",

	'Q' => ["co ext vim6"],
	'Z' => ["co"],
}, # mode Z

z => {
	lead => "z",

	"\e"=> ["mo mode"],

	'^' => ["po"],
	'+' => ["po"],
	'-' => ["po"],
	'=' => ["co ext vim7 new"],
	'.' => ["po"],
	'^['=> "\e",

	'a' => ["co ext vim6 folding"],
	'A' => ["co ext vim6 folding"],
	'b' => ["po"],
	'c' => ["co ext vim6 folding"],
	'C' => ["co ext vim6 folding"],
	'd' => ["co ext vim6 folding"],
	'D' => ["co ext vim6 folding"],
	'e' => ["po"],
	'E' => ["co ext vim6 folding"],
	'f' => ["co argm ext vim6 folding"],
	'F' => ["co ext vim6 folding"],
	'g' => ["co ext vim7 new"],
	'G' => ["co ext vim7 new"],
	'h' => ["po"],
	'H' => ["po"],
	'i' => ["co ext vim6 folding"],
	'j' => ["pm ext vim6 folding"],
	'k' => ["pm ext vim6 folding"],
	'l' => ["po"],
	'L' => ["po"],
	'^m'=> ["po"],
	'm' => ["co ext vim6 folding"],
	'M' => ["co ext vim6 folding"],
	'n' => ["co ext vim6 folding"],
	'N' => ["co ext vim6 folding"],
	'o' => ["co ext vim6 folding"],
	'O' => ["co ext vim6 folding"],
	'r' => ["co ext vim6 folding"],
	'R' => ["co ext vim6 folding"],
	's' => ["po"],
	't' => ["po"],
	'u' => ["co arg ext vim7 new"],
	'v' => ["co ext vim6 folding"],
	'w' => ["co ext vim7 new"],
	'W' => ["co ext vim7 new"],
	'x' => ["co ext vim6 folding"],
	'X' => ["co ext vim6 folding"],
	'z' => ["po"],
}, # mode z

'[' => {
	lead => "[",

	"\e"=> ["mo mode"],

	"`" => ["pm ext vim6"],
	'#' => ["pm"],
	'(' => ["pm"],
	'*' => "[/",
	'/' => ["pm"],
	"'" => "[` ^", # ext vim6
	'{' => ["pm"],
	'[' => ["pm"],
	'^['=> "\e",
	']' => ["pm"],

	'c' => ["pm"],
	'd' => ["ci"],
	'D' => ["co"],
	'^d'=> ["po"],
	'f' => "gf",  # deprecated
	'i' => ['ci'],
	'I' => ['co'],
	'^i'=> ['po'],
	'm' => ["pm"],
	'p' => ["co"],
	'P' => ["co"],
	's' => ["po ext vim7 new"],
	'S' => ["po ext vim7 new"],
	'z' => ["pm ext vim6 folding"],
}, # mode [

']' => {
	lead => "]",

	"\e"=> ["mo mode"],

	"`" => ["pm ext vim6"],
	'#' => ["pm"],
	')' => ["pm"],
	'*' => "]/",
	"'" => "]` ^", # ext vim6
	'/' => ["pm"],
	'[' => ["pm"],
	'^['=> "\e",
	']' => ["pm"],
	'}' => ["pm"],

	'c' => ["pm"],
	'd' => ["ci"],
	'D' => ["co"],
	'^d'=> ["po"],
	'f' => "gf",  # deprecated
	'i' => ["ci"],
	'I' => ["co"],
	'^i'=> ["po"],
	'm' => ["pm"],
	'p' => ["co"],
	'P' => "[p",
	's' => ["po ext vim7 new"],
	'S' => ["po ext vim7 new"],
	'z' => ["pm ext vim6 folding"],
}, # mode ]

'^w' => {
	lead => "ŵ",

	"\e"=> ["mo mode"],

	'<' => ["po"],
	'>' => ["po"],
	'^' => ["co"],
	'_' => ["po"],
	'+' => ["po"],
	'-' => ["po"],
	'=' => ["po"],
	'^['=> "\e",
	']' => ["po"],
	'}' => ["po"],
	'|' => ["po"],

	'b' => ["po"],
	'c' => ["po"],
	'^c'=> ["mo mode"],
	'd' => ["po"],
	'f' => ["co"],
	'F' => ["co ext vim7 new"],
	'g' => ["me arg mode^wg"],
	'h' => ["po"],
	'H' => ["po"],
	'i' => ["po"],
	'j' => ["po"],
	'J' => ["po"],
	'k' => ["po"],
	'K' => ["po"],
	'l' => ["po"],
	'L' => ["po"],
	'n' => ["co"],
	'o' => ["po"],
	'p' => ["po"],
	'P' => ["po"],
	'q' => ["co"],
	'r' => ["po"],
	'R' => ["po"],
	's' => ["po"],
	'S' => "^ws",
	't' => ["po"],
	'v' => ["po"],
	'w' => ["po"],
	'W' => ["po"],
	'x' => ["po"],
	'z' => ["po"],
}, # mode ^w

'^wg' => {
	lead => "ŵg",

	"\e"=> ["mo mode"],
	'^['=> "\e",
	']' => ["po"],
	'}' => ["po"],
	'^]'=> ["po"],
	'f' => ["co ext vim7 new"],
	'F' => ["co ext vim7 new"],
}, # mode ^w g

v => {
	"\e"=> ["mo mode"],

	'!' => ["co"],
	':' => ["mo modec"],
	'<' => ["co"],
	'=' => ['co undo'],
	'>' => ['co'],
	'~' => ["co ext vim6"],
	'^['=> "\e",
	'^]'=> ["po"],
	'^\\'=>'^\\',

	'a' => ['me modeva arg ext vim6'],
	'A' => ['mi modei ext vim6'],
	'c' => ['mi modei ext vim6'],
	'C' => ['mi modei ext vim6'],
	'^c'=> ["mo mode"],
	'd' => ["co ext vim6"],
	'D' => ["co ext vim6"],
	'g' => ["me arg modevg"],
	'^g'=> ["mv"],
	'^h'=> ['co'],
	'i' => ["me modeva arg ext vim6"],
	'I' => ["mi modei ext vim6"], # block
	'J' => ["co"],
	'K' => ['co'],
	'o' => ["pm"],
	'O' => ["pm"],
	'^o'=> ["mv"],
	'p' => ['co'],
	'P' => ['co'],
	'^q'=> "^q",
	'r' => ['co arg'],
	'R' => "vS",  # "might change in future"
	'^s'=> "^s",
	's' => "vc",
	'S' => ['mi modei ext vim6'],
	'u' => ["co ext vim6"],
	'U' => ["co ext vim6"],
	'v' => ["mv"],
	'V' => ["mv"],
	'^v'=> ["mv ext vim6"],
	'x' => "vd",
	'X' => "vD",
	'y' => ["co"],
	'Y' => ["co"],

	map {$_ => $_} qw(
		b B ^b ^d e E ^e f F ^f G h H ^i j ^j k l L m M ^m
		n N ^n ^p q ^s t T ^u w W ^w ^y z ^z
		` # $ % ^ * ( 0 ) [ { ] } ; / ? + - _ |
	) # a lot like normal mode
}, # mode v

vg => {
	lead => "g",

	"\e"=> ["mv modev"],

	'^['=> "\e",
	'?' => ["co ext vim6"],
	'J' => ['co ext vim6'],
	'q' => ["co ext vim6"],
	'v' => 'gv',
	'w' => ['co ext vim7 new'],
}, # mode v g

va => {
	"\e"=> ["mv modev"],

	'(' => 'vab',
	')' => 'vab',
	'`' => "va'",
	"'" => ['pm ext vim7 new'],
	'"' => "va'",
	'<' => ['pm ext vim6'],
	'>' => 'va&lt;',
	'[' => ['pm ext vim6'],
	'{' => 'vaB',
	'^['=> "\e",
	']' => 'va[',
	'}' => 'vaB',

	'b' => ['pm ext vim6'],
	'B' => ['pm ext vim6'],
	'p' => ['pm ext vim6'],
	's' => ['pm ext vim6'],
	't' => ['pm ext vim7 new'],
	'w' => ['pm ext vim6'],
	'W' => ['pm ext vim6'],
}, # mode v a

#c => {
#	desc => "command-line mode",
#
#	'^_' => 'i^_',
#	'^^' => 'i^^',
#	'^\\'=>'^\\',
#	'^a' => [""], #todo
#	'^b' => ["po"],
#	'^c' => 'i^c',
#	'^d' => [""], #todo
#	'^e' => ["po"],
#	'^h' => 'i^h',
#	'^j' => ["co"],
#	'^k' => 'i^k',
#	'^l' => [""], #todo
#	'^n' => [""], #todo
#	'^p' => [""], #todo
#	'^r' => 'i^r', # and then some...
#	     ## ["co arg ext vim6"],
#	'^q' => '^q',
#	'^u' => 'i^u',
#	'^v' => 'i^v',
#	'^w' => 'i^w',
#	'^y' => ["co"],
#}, # mode c

i => {
	"\e" => ["mo mode"],

	'^@' => ["co"],
	'^^' => ["co ext vim6"],
	'^['=> "\e",
	'^]' => ["co ext vim6"],
	'^_' => ["co ext vim6"],
	'^\\'=>'^\\',

	'^a' => ["co ext vim6"],
	'^b' => ["no ext vim6"],
	'^c' => ["mo mode"],
	'^d' => ['co'],
	'^e' => ["co ext vim6"],
	'^f' => ['co'],
	'^g' => ["me modei^g arg"],
	'^h' => ["co"],
	'^i' => ["co"],
	'^j' => ["co"],
	'^k' => ['co arg arg ext vim6 linkdigraphs'],
	'^l' => ["mo mode ext vim6"],  # insertmode only
	'^m' => ["co"],
	'^n' => ["pm ext vim6"],
	'^o' => ['co'],
	'^p' => ["pm ext vim6"],
	'^q' => "^q",  # or i^v
	'^r' => ['co arg ext vim6'],
	'^s' => "^s",
	'^t' => ["co"],
	'^u' => ["co"],
	'^v' => ['co linkcharset'],
	'^w' => ["co"],
	'^x' => ['me arg modei^x ext vim6'],
	'^y' => ["co ext vim6"],
	'^z' => ["ci ext vim6"],  # insertmode only
}, # modei

'i^g' => {
	lead => "ĝ",

	"\e"=> ['mi modei'],

	'k' => ['pm'],
	'j' => ['pm'],
	'u' => ['co'],
	# other keys (even esc) are not recognized
}, # mode i ^g

'i^x' => {
	lead => "x̂",

	"\e" => ["mo mode"], # yes, it really leaves insert mode

	'^['=> "\e",
	'^]' => ['co'],
	'^d' => ['co'],
	'^e' => ["po"],
	'^f' => ['co'],
	'^i' => ['co'],
	'^k' => ['co'],
	'^l' => ['co'],
	'^n' => ['co'],
	'^o' => ['co ext vim7 new'],
	'^p' => ['co'],
	'^s' => ['co'],
	 's' => 'i^x^s',
	'^t' => ['co'],
	'^u' => ['co ext vim7 new'],
	'^v' => ['co'],
	'^y' => ["po"],
}, # mode i ^x

# XXX ex mode if you want to go completely wild
}
