13f8dc2b7bd114c12e7cc5bdb0d765e40f29c944
[sheet.git] / readline.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.0';
3
4         use Shiar_Sheet::KeySigns qw(%sign);  # dependant on $get{ascii}
5
6         $header{content_type} = "text/html; charset=$sign{charset}";
7
8 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
9  "http://www.w3.org/TR/html4/loose.dtd">
10 <html lang="en">
11
12 <head>
13 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
14 <title>readline cheat sheet</title>
15 <meta name="description" content="Overview sheet of default key bindings for GNU readline, used in line-editing in most Unix software, notably emacs and bash.">
16 <meta name="keywords" content="readline, gnu, bash, emacs, sheet, cheat, reference, overview, keyboard, editing, curses">
17 <:= stylesheet(qw'light dark circus mono red terse') :>
18 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
19 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
20         our $showkeys = exists $get{keys} && $get{keys} ne '0';
21         print "\n".'<style type="text/css"> .no {visibility:hidden} </style>'
22                 unless $showkeys;
23         print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
24                 if $showkeys and $get{keys} eq 'ghost';
25 :>
26 <script type="text/javascript" src="/keys.js"></script>
27
28 <body id="readline">
29
30 <h1>readline cheat sheet</h1>
31
32 <h2>default emacs mode</h2>
33
34 <ul id="rows">
35
36 <li class="row">
37         <ul class="keys omni">
38         <li class="me" onclick="setmode()"><b>Esc</b> +
39         </ul>
40 </li>
41
42 <:
43 use Shiar_Sheet::Keyboard;
44 my $keys = Shiar_Sheet::Keyboard->new({do 'readline.inc.pl'});
45 $keys->map($get{map}) or undef $get{map};
46 $keys->print_rows($get{rows} || '^x=213', [4,3,2]);
47 :>
48 </ul>
49
50 <hr>
51
52 <div class="help">
53         <div class="left">
54                 <dl class="legend legend-types">
55                 <dt class="ci">info
56                         <dd>Info command: shows/does something without altering anything.
57                 <dt class="pm">motion
58                         <dd>Move the cursor.
59                 <dt class="co">history
60                         <dd>Replace contents involving kill ring, undo, or command history.
61                 <dt class="mi">change
62                         <dd>Alter current text (filtering or completion).
63                 <dt class="mo">delete
64                         <dd>Remove text.
65                 <dt class="mv">misc
66                         <dd>Miscellaneous commands.
67                 <dt class="me">mode
68                         <dd>Additional key functionality (click to view).
69                 </dl>
70         </div>
71
72         <div class="right">
73                 <dl class="legend legend-options">
74                 <dt>key<:= $sign{arg} :>
75                         <dd>Commands with a dot need a char argument afterwards.
76                 <dt class="new">&gt;v2.0
77                         <dd>Unavailable before readline version 2.1 (1997).
78                 <dt class="ext">bash
79                         <dd>Default assignment in Bash shells, but not common readline.
80                 </dl>
81
82                 <ul class="legend legend-set">
83                 <li>keyboard <strong>map</strong> is
84                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
85                 <li><strong>ascii</strong> mode is
86                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
87                                 $sign{-ascii} ? 'on' : 'off' :></em>
88                 <li><strong>keys</strong> are
89                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
90                                 !exists $get{keys} && ' by default' :>
91                 <li>default <strong>style</strong> is
92                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
93                 </ul>
94         </div>
95 </div>
96
97 <p class="footer">
98         <a href="/" rel="home">sheet.shiar.nl</a>/readline.<a href="/source/readline.plp"
99          rel="code" title="Written in Perl">plp</a>
100         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/readline.plp"
101          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
102         created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
103         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
104          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
105 </p>
106
107 </html>