keys: replace omni-present escape keys
[sheet.git] / readline.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'readline cheat sheet',
5         version => 'v1.1',
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'
11                 readline gnu bash emacs sheet cheat reference overview keyboard editing curses
12         '],
13         charset => $sign{charset},
14         stylesheet => [qw'light dark circus mono red terse'],
15         keys => 1,
16 });
17
18 :>
19 <h1>readline cheat sheet</h1>
20
21 <h2>default emacs mode</h2>
22
23 <ul id="rows">
24
25 <:
26 use Shiar_Sheet::Keyboard 2;
27 my $info = do 'readline.eng.inc.pl' or die $@;
28 $info->{def} = do 'readline.inc.pl';
29 my $keys = Shiar_Sheet::Keyboard->new($info);
30 $keys->map($get{map}) or undef $get{map};
31 $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
32 :>
33 </ul>
34
35 <hr>
36
37 <div class="help">
38         <div class="left">
39                 <dl class="legend legend-types">
40                 <dt class="ci">info
41                         <dd>Info command: shows/does something without altering anything.
42                 <dt class="pm">motion
43                         <dd>Move the cursor.
44                 <dt class="co">history
45                         <dd>Replace contents involving kill ring, undo, or command history.
46                 <dt class="mi">change
47                         <dd>Alter current text (filtering or completion).
48                 <dt class="mo">delete
49                         <dd>Remove text.
50                 <dt class="mv">misc
51                         <dd>Miscellaneous commands.
52                 <dt class="me">mode
53                         <dd>Additional key functionality (click to view).
54                 </dl>
55         </div>
56
57         <div class="right">
58                 <dl class="legend legend-options">
59                 <dt>key<:= $sign{arg} :>
60                         <dd>Commands with a dot need a char argument afterwards.
61                 <dt class="new">&gt;v2.0
62                         <dd>Unavailable before readline version 2.1 (1997).
63                 <dt class="ext">bash
64                         <dd>Default assignment in Bash shells, but not common readline.
65                 </dl>
66
67                 <ul class="legend legend-set">
68                 <li>keyboard <strong>map</strong> is
69                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
70                 <li><strong>ascii</strong> mode is
71                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
72                                 $sign{-ascii} ? 'on' : 'off' :></em>
73                 <li><strong>keys</strong> are
74                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
75                                 !exists $get{keys} && ' by default' :>
76                 <li>default <strong>style</strong> is
77                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
78                 </ul>
79         </div>
80 </div>
81