use utf8;

{
# less v418
title => 'Less',
version => '1.1',
description => [
	"Default bindings of the less pager.",
	"Clearly shows how much it's more than more.",
],
keywords => [qw' less keys pager more options '],
rows => [1, 0],

mode => {
	''   => 'normal pager',
	'^[' => 'escape keys (hold meta/alt)',
	'-'  => 'flag identifiers',
	':'  => 'colon commands',
},

flag => {
	g1 => [info   => 'Temporary message display (or related option).'],
	g2 => [move   => 'Regular file position panning (or option).'],
	g3 => [jump   => 'Other file position manipulation (").'],
	g4 => [search => 'Go to matching content (").'],
	g7 => [file   => 'Alter open file buffer (").'],
	g8 => [misc   => 'Other commands and options.'],

	arg  => ["key<arg>" => "Commands with a dot need a char argument afterwards."],
	more => [more => "A small subset is compatible with `more`."],
},

def => {
	'' => {
		"\e"=> ['g7 mode^[', "alt<>/meta"],

		'b' => ['g2 more', "page up"],
		'^b'=> \'b',
		'd' => ['g2 more', 'scroll down'],
		'^d'=> \'d',
		'e' => \'j',
		'^e'=> \'j',
		'f' => ['g2 more', "page down"],
		'^f'=> \'f',
		'F' => ['g7', "follow\nForward Forever"],
		'g' => ['g2', "(first) line"],
		'^g'=> \'=',
		'G' => ['g2', "last line"],
		'h' => ['g7 more', "help"],
		'H' => \'h',
		'j' => ['g2', "<down>"],
		'k' => ['g2', "<up>"],
		'^k'=> \'k',
		'^l'=> \'r', # more
		'm' => ['g3 arg', "mark pos<>ition"],
		'^m'=> \'j',
		'n' => ['g4 more', "next find"],
		'N' => ['g4', "prev find"],
		'^n'=> \'j',
		'p' => ['g2', "reset position\nbeginning or Percentage"],
		'^p'=> \'k',
		'q' => ['g8 more', "quit"],
		'Q' => \'q',
		'r' => ['g1', "redraw"],
		'^r'=> \'r',
		'R' => ['g1', "refresh"],
		's' => ['g8 arg', "save to file"],
		't' => ['g4', "next tag"],
		'T' => ['g4', "prev tag"],
		'u' => ['g2', 'scroll up'],
		'^u'=> \'u',
		'v' => ['g8 linkvi more', "edit"],
		'^v'=> \'f',
		'V' => ['g1', "version"],
		'w' => ['g2', "page up and set window"],
		'^x'=> ['g8 arg mode^x', "emacs aliases"],
		'y' => \'k',
		'^y'=> \'k',
		'z' => ['g2 more', "set page down"],

		'!' => ['g8 more', "shell command"],
		'|' => ['g8 arg', "pipe till mark"],
		':' => ['g8 arg mode:', "com<>mand"],
		'/' => ['g4 arg more', "find"],
		'?' => ['g4 arg', "find rev."],
		'%' => \'p',
		'&' => ['g4 arg', "filter match<>es"],
		"'" => ['g3 arg', "goto mark"],
		'-' => ['g8 arg mode-', "toggle option"],
		'_' => ['g1 arg mode-', "show option"],
		'=' => ['g1 more', "file name"],
		'+' => ['g7', "initial cmd"],

		'(' => ['g4', "closing"],
		'<' => \'g',
		'>' => \'G',
	},

	'^[' => { # esc
		"\e"=> ['g7 mode', "noop"],
		'n' => ['g4', "any next find"],
		'N' => ['g4', "any prev find"],
		'u' => ['g1', "mark search\nUndo"],
		'v' => \'b',
		'(' => ['g2', "scroll left"],
		')' => ['g2', "scroll right"],
		'<' => \'g',
		'>' => \'G',
	},

	#'^x' => {
	#	"\e"=> 'g7 mode',
	#	'^x' => \"'",
	#	'^v' => \':e',
	#},

	':' => {
		"\e"=> ['g7 mode', "noop"],
		'd' => ['g7', "drop file"],
		'e' => ['g7', "open file"],
		'f' => \'=',
		'n' => ['g7 more', "next file"],
		'p' => ['g7 more', "prev file"],
		'q' => \'q',
		'Q' => \':q',
		'x' => ['g7', "first file"],
	},

	'-' => {
		"\e"=> ['g7 mode', "noop"],
		'a' => ['g4', "advance find page"],
		'b' => ['g7 arg', "buffer space"],
		'B' => ['g7', "static buffer for pipes"],
		'c' => ['g2', "clear on scroll"],
		'd' => ['g8', "dumb term<>inal"],
		'D' => ['g8 arg ext', "dos colours"],
		'e' => ['g7', "exit after eof"],
		'E' => ['g7', "exit at eof"],
		'f' => ['g7', "force open"],
		'F' => ['g7', "exit if 1 page"],
		'g' => ['g4', "hilight last match"],
		'h' => ['g2 arg', "scroll back limit"],
		'i' => ['g4', "ignore lower<>c<>ase"],
		'I' => ['g4', "ignore case"],
		'j' => ['g3 arg', "top offset"],
		'J' => ['g1', "status column"],
		'k' => ['g8 arg', "key bind<>ing<>s"],
		'L' => ['g8', qq[ignore <span style="font-variant:small-caps">lesso<>pen</span> filter]],
		'm' => ['g1', "med. promp<>t tog<>gle"],
		'M' => ['g1', "long promp<>t tog<>gle"],
		'n' => ['g8', "count line num<>ber<>s"],
		'N' => ['g1', "show line n<>um<>ber<>s"],
		'o' => ['g8 arg', "stdin to log"],
		'O' => ['g8 arg', "log over<>wr<>ite"],
		'p' => ['g4 arg', "initial search"],
		'P' => ['g1 arg', "status line\nPrompt"],
		'q' => ['g8', "no info bell\nQuiet"],
		'Q' => ['g8', "no warn bell\nQuiet!"],
		'r' => ['g8', "raw chars"],
		'R' => ['g8', "ansi chars"],
		's' => ['g8', "squeeze blank lines"],
		'S' => ['g8', "no line wrap"],
		't' => ['g4 arg', "find tag"],
		'T' => ['g4 arg', "tags file"],
		'u' => ['g8', 'parse \b \r'],
		'U' => ['g8', 'escape \t \b \r'],
		'V' => \'V',
		'w' => ['g8', "hilight page d<>own"],
		'W' => ['g8', "hilight forw<>ard"],
		'x' => ['g8 arg', "tab stops"],
		'X' => ['g8', "no termcap init"],
		'y' => ['g2 arg', "scroll limit fw<>d"],
		'z' => ['g2 arg', "page size"],
		'"' => ['g8 arg', "shell quotes"],
		'~' => ['g8', "outside tildes toggle"],
		'#' => ['g2 arg', "col shift"],
		'-' => ['g8 arg', "option name"],
		'+' => ['g8 arg', "reset option"],
	},
},
}
