Source of vi.inc.pl

use utf8;
{

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

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

g => {
	lead => "g",

	"\e"=> "g7 mode",

	'~' => "g4 argm ext vim6",
	'@' => "g4 ext vim7 new",
	'#' => "g2 ext vim6",
	'$' => "g2",
	'^' => "g2 ext vim6",
	'&' => "g4",
	'*' => "g2 ext vim6",
	'_' => "g2 ext vim6",
	'+' => "g4 ext vim7 new",
	'`' => "g2 ext vim6 arg",
	'8' => "g1",
	'0' => "g2 ext vim6",
	'-' => "g4 ext vim7 new",
	'^['=> "g7 mode",
	']' => "g3",
	'^]'=> "g3",
	';' => "g2",
	"'" => "g2 ext vim6 arg",
	'<' => "g4 ext vim7 new",
	'?' => "g4 argm ext vim6",
	',' => "g2",

	'a' => "g1",
	'^a'=> "g1",
	'd' => "g2 ext vim6",
	'D' => "g2 ext vim6",
	'e' => "g2",
	'E' => "g2",
	'f' => "g4 ext vim6",
	'F' => "g4 ext vim7 new",
	'g' => "g2",
	'^g'=> "g1 vim6",
	'h' => "g8 modev",
	'H' => "g8 modev",
	'^h'=> "g8 modev ext vim6",
	'i' => "g6 undo modei",
	'I' => "g6 undo modei",
	'j' => "g2 ext vim6",
	'J' => "g4",
	'k' => "g2 ext vim6",
	'm' => "g2 ext vim6",
	'o' => "g2",
	'p' => "g4 undo",
	'P' => "g4",
	'q' => "g4 argm",
	'Q' => "g7 ext vim6",
	'r' => "g4 arg",
	'R' => "g6 undo modei",
	's' => "g1 ext vim6",
	't' => "g3 ext vim7 new",
	'T' => "g3 ext vim7 new",
	'u' => "g4 argm ext vim6", # XXX undo?
	'U' => "g4 undo argm ext vim6",
	'v' => 'g8 modev',
	'V' => "g4",
	'w' => "g4 argm ext vim7 new",
	'x' => "g4 ext vim7 new",
}, # mode g

Z => {
	lead => "Z",

	"\e"=> "g7 mode",
	'^['=> "=\e",

	'Q' => "g4 ext vim6",
	'Z' => "g4",
}, # mode Z

z => {
	lead => "z",

	"\e"=> "g7 mode",

	'^' => "g3",
	'+' => "g3",
	'-' => "g3",
	'=' => "g4 ext vim7 new",
	'.' => "g3",
	'^['=> "=\e",

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

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

	"\e"=> "g7 mode",

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

	'c' => "g2",
	'd' => "g1",
	'D' => "g4",
	'^d'=> "g3",
	'f' => "=gf",  # deprecated
	'i' => 'g1',
	'I' => 'g4',
	'^i'=> 'g3',
	'm' => "g2",
	'p' => "g4",
	'P' => "g4",
	's' => "g3 ext vim7 new",
	'S' => "g3 ext vim7 new",
	'z' => "g2 ext vim6 folding",
}, # mode [

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

	"\e"=> "g7 mode",

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

	'c' => "g2",
	'd' => "g1",
	'D' => "g4",
	'^d'=> "g3",
	'f' => "=gf",  # deprecated
	'i' => "g1",
	'I' => "g4",
	'^i'=> "g3",
	'm' => "g2",
	'p' => "g4",
	'P' => "=[p",
	's' => "g3 ext vim7 new",
	'S' => "g3 ext vim7 new",
	'z' => "g2 ext vim6 folding",
}, # mode ]

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

	"\e"=> "g7 mode",

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

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

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

	"\e"=> "g7 mode",
	'^['=> "=\e",
	']' => "g3",
	'}' => "g3",
	'^]'=> "g3",
	'f' => "g4 ext vim7 new",
	'F' => "g4 ext vim7 new",
}, # mode ^w g

v => {
	"\e"=> "g7 mode",

	'!' => "g4",
	':' => "g7 modec",
	'<' => "g4",
	'=' => 'g4 undo',
	'>' => 'g4',
	'~' => "g4 ext vim6",
	'^['=> "=\e",
	'^]'=> "g3",
	'^\\'=>'^\\',

	'a' => 'g9 modeva arg ext vim6',
	'A' => 'g6 modei ext vim6',
	'c' => 'g6 modei ext vim6',
	'C' => 'g6 modei ext vim6',
	'^c'=> "g7 mode",
	'd' => "g4 ext vim6",
	'D' => "g4 ext vim6",
	'g' => "g9 arg modevg",
	'^g'=> "g8",
	'^h'=> 'g4',
	'i' => "g9 modeva arg ext vim6",
	'I' => "g6 modei ext vim6", # block
	'J' => "g4",
	'K' => 'g4',
	'o' => "g2",
	'O' => "g2",
	'^o'=> "g8",
	'p' => 'g4',
	'P' => 'g4',
	'^q'=> "=^q",
	'r' => 'g4 arg',
	'R' => "=vS",  # "might change in future"
	'^s'=> "=^s",
	's' => "=vc",
	'S' => 'g6 modei ext vim6',
	'u' => "g4 ext vim6",
	'U' => "g4 ext vim6",
	'v' => "g8",
	'V' => "g8",
	'^v'=> "g8 ext vim6",
	'x' => "=vd",
	'X' => "=vD",
	'y' => "g4",
	'Y' => "g4",

	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"=> "g8 modev",

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

va => {
	"\e"=> "g8 modev",

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

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

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

i => {
	"\e" => "g7 mode",

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

	'^a' => "g4 ext vim6",
	'^b' => "no ext vim6",
	'^c' => "g7 mode",
	'^d' => 'g4',
	'^e' => "g4 ext vim6",
	'^f' => 'g4',
	'^g' => "g9 modei^g arg",
	'^h' => "g4",
	'^i' => "g4",
	'^j' => "g4",
	'^k' => 'g4 arg arg ext vim6 linkdigraphs',
	'^l' => "g7 mode ext vim6",  # insertmode only
	'^m' => "g4",
	'^n' => "g2 ext vim6",
	'^o' => 'g4',
	'^p' => "g2 ext vim6",
	'^q' => "=^q",  # or i^v
	'^r' => 'g4 arg ext vim6',
	'^s' => "=^s",
	'^t' => "g4",
	'^u' => "g4",
	'^v' => 'g4 linkcharset',
	'^w' => "g4",
	'^x' => 'g9 arg modei^x ext vim6',
	'^y' => "g4 ext vim6",
	'^z' => "g1 ext vim6",  # insertmode only
}, # modei

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

	"\e"=> 'g6 modei',

	'k' => 'g2',
	'j' => 'g2',
	'u' => 'g4',
	# other keys (even esc) are not recognized
}, # mode i ^g

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

	"\e" => "g7 mode", # yes, it really leaves insert mode

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

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