readline: replace code by common keyboard page
[sheet.git] / readline.eng.inc.pl
1 use utf8;
2
3 {
4 title => 'readline',
5 version => 1.2,
6 description => [
7         "Reference sheet of default key bindings for GNU readline,",
8         "used for line-editing in most Unix software, notably Emacs and Bash.",
9 ],
10 keywords => [qw( readline gnu bash emacs editing curses )],
11 rows => [4, 3, 2],
12
13 key => {
14         '+<' => "history start",
15         '+>' => "history end",
16         '+?' => "list complet<>ion<>s",
17         '^@' => "set mark",
18
19         '+#' => "prefix comm<>en<>t",
20         '+&' => "tilde expand",
21         '+*' => "complet<>e all",
22         '+.' => "insert last",
23
24         '^[' => "meta",
25         '+\\'=> "delete whitesp<>ace",
26         '^]' => "find char",
27         '^+]'=> "rev find char",
28         '^_' => "undo",
29
30         '+~' => "user<>name exp<>and",
31         '+!' => "cmd expand",
32         '+@' => "host<>name exp<>and",
33         '+$' => "variable expand",
34         '+^' => "history expand",
35         '+/' => "filename expand",
36
37         '^a' => "begin of line",
38         '^b' => "char back<>w<>ard<>s",
39         '+b' => "word back<>w<>ard<>s",
40         '^c' => "cancel comm<>and",
41         '+c' => "capital<>ise word",
42         '^d' => "delete char",
43         '+d' => "delete word rem<>ain<>der",
44 #       '^e' => "emacs mode",
45         '^e' => "end of line",
46         '^f' => "char forward",
47         '+f' => "word forward",
48         '^g' => "abort cmd, bell",
49         '^h' => "back<>space",
50         '^+h'=> "delete bound word",
51         '^i' => "auto<>complet<>e\n(tab)",
52         '^+j'=> "vim mode",
53         '^k' => "delete till eol",
54         '^l' => "clear screen",
55         '+l' => "lowcase word",
56         '^m' => "enter line\n(enter)",
57         '^n' => "history next",
58         '+n' => "match history",
59         '^o' => "enter and next",
60         '^p' => "history back",
61         '+p' => "rev match history",
62 #       '^q' => "\nQuote",  #TODO fix partial override
63         '^r' => "reverse history",
64         '+r' => "full undo\nRevert",
65         '^s' => "search history",
66         '^t' => "move char forw<>ard\nTranspose char",
67         '+t' => "move word forw<>ard\nTranspose word",
68         '^u' => "delete till bol", # unix
69         '+u' => "upcase word",
70         '^v' => "verbat<>im char",
71         '^w' => "delete word", # unix
72         '^x' => "extend<>ed",
73         '^y' => "yank top",
74         '+y' => "rotate yank",
75         '^+y'=> "yank arg",
76         '^z' => "back<>ground",
77
78         '^x('  => "start macro",
79         '^x)'  => "end macro",
80         '^xe'  => "run macro\nExecute",
81         '^x^e' => "editor",
82         '^x^r' => "reload inputrc",
83         '^x^x' => "swap cursor\neXchange",
84         '^x^v' => "shell version",
85
86         # globally label escape as meta key
87           "\e" => "+",
88         "^x\e" => "+",
89 },
90
91 mode => {
92         ''   => "emacs mode",
93         '^x' => "emacs ctrl-x bindings",
94 },
95
96 flag => {
97         g1 => [info    => "Info command: shows/does something without altering anything."],
98         g2 => [motion  => "Move the cursor."],
99         g4 => [history => "Replace contents involving kill ring, undo, or command history."],
100         g6 => [change  => "Alter current text (filtering or completion)."],
101         g7 => [delete  => "Remove text."],
102         g8 => [misc    => "Miscellaneous commands."],
103         g9 => [mode    => "Additional key functionality (click to view)."],
104
105         arg => ["key<arg>" => "Commands with a dot need a char argument afterwards."],
106         'v21 new' => ["&gt;v2.0" => "Unavailable before readline version 2.1 (1997)."],
107         'xbash ext' => ["bash" => "Default assignment in Bash shells, but not common readline."],
108 },
109
110 def => {
111         '' => {
112                 "\e" => 'g8',
113
114                 '+<' => 'g4',
115                 '+=' => '=+?', #TODO: v21 # emacs, not in v2.0
116                 '+>' => 'g4',
117                 '^?' => '=^h',
118                 '+?' => 'g1',
119                 '^@' => 'g8 v21', # not in v2.0
120
121                 '+#' => 'g6 v21', # not in v2.0
122                 '+&' => 'g6',
123                 '+*' => 'g6 v21', # not in v2.0
124                 '+.' => 'g4',
125                 '+~' => '=+&amp;', # emacs
126
127                 '^[' => 'g8',
128                 '^+['=> '=^i',
129                 '+\\'=> 'g7',
130                 '^]' => 'g2 arg v21', # not in v2.0
131                 '^+]'=> 'g2 arg v21', # not in v2.0
132                 '^_' => 'g4',
133                 '+_' => '=+.',
134
135                 '+~' => 'g6 xbash', # common emacs => '=+&'
136                 '+!' => 'g6 xbash',
137                 '+@' => 'g6 xbash',
138                 '+$' => 'g6 xbash',
139                 '+^' => 'g4 xbash',
140                 '+/' => 'g1 xbash',
141
142                 '^a' => 'g2',
143                 '^b' => 'g2',
144                 '+b' => 'g2',
145                 '^c' => 'g8 xbash',
146                 '+c' => 'g6',
147                 '^d' => 'g7',
148                 '+d' => 'g7 ring',
149         #       '^e' => 'g9',
150                 '^e' => 'g2',
151                 '^f' => 'g2',
152                 '+f' => 'g2',
153                 '^g' => 'g8',
154                 '^+g'=> '=^g',
155                 '^h' => 'g7',
156                 '^+h'=> 'g7 ring', #TODO
157                 '^i' => 'g6',
158                 '^+i'=> '=^v^i',
159                 '^j' => '=^m',
160                 '^+j'=> 'g9', #TODO: mode^+j
161                 '^k' => 'g7 ring',
162                 '^l' => 'g1',
163                 '+l' => 'g6',
164                 '^m' => 'g4',
165                 '^+m'=> '=^+j',
166                 '^n' => 'g4',
167                 '+n' => 'g4',
168                 '^o' => 'g4 xbash',
169                 '^p' => 'g4',
170                 '+p' => 'g4',
171                 '^q' => '=^v',
172                 '^r' => 'g4',
173                 '+r' => 'g4',
174                 '^+r'=> '=+r',
175                 '^s' => 'g4',
176                 '^t' => 'g6',
177                 '+t' => 'g6',
178                 '^u' => 'g7 ring',
179                 '+u' => 'g6',
180                 '^v' => 'g8',
181                 '^w' => 'g7 ring',
182                 '^x' => 'g9 arg mode^x',
183                 '^y' => 'g4',
184                 '+y' => 'g4 ring',
185                 '^+y'=> "yank arg",
186                 '^z' => 'g8 xbash',
187         },
188
189         '^x' => {
190                 lead => "x̂",
191
192                 "\e" => 'g8 mode',
193
194                 '('  => 'g8',
195                 ')'  => 'g8',
196                 'e'  => 'g8',
197                 '^e' => 'g6 xbash linkvi',
198                 '^g' => '=^g',
199                 '^h' => '=^u',
200                 '^r' => 'g8',
201                 '^u' => '=^_',
202                 '^x' => 'g2 v21', # not in v2.0
203                 '^v' => 'g1 xbash',
204                 '^?' => '=^x^h',
205         },
206 },
207 }