index: only use common stylesheet
[sheet.git] / vim.plp
1 <(common.inc.plp)><:
2         our $VERSION = 'v1.2';
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>
11
12 <head>
13 <meta http-equiv="content-type" content="<:= $header{content_type} :>">
14 <title>vi cheat sheet</title>
15 <:= stylesheet(qw'light dark circus mono red terse') :>
16 <!--[if lte IE 6]><style> .help dl.legend dt {margin:0 0 1px} </style><![endif]-->
17 <!--[if lte IE 7]><style> .help dl.legend dd {float:none} </style><![endif]--><:
18         our $showkeys = exists $get{keys} && $get{keys} ne '0';
19         print "\n".'<style type="text/css"> .no {visibility:hidden} </style>'
20                 unless $showkeys;
21         print "\n".'<style type="text/css"> .no, .alias {opacity:.5} </style>'
22                 if $showkeys and $get{keys} eq 'ghost';
23 :>
24 <script type="text/javascript" src="/keys.js"></script>
25
26 <body id="vim">
27
28 <h1>vi/vim cheat sheet</h1>
29
30 <h2>normal mode (default)</h2>
31
32 <ul id="rows">
33
34 <li class="row">
35         <ul class="keys omni">
36         <li class="mo chr27" onclick="setmode()"><b>Esc</b> normal mode
37                 <!-- not as static anymore, but never bothered; just see ^[ -->
38         </ul>
39 </li>
40
41 <:
42 use Shiar_Sheet::Keyboard;
43 my $keys = Shiar_Sheet::Keyboard->new({do 'vim.inc.pl'});
44 $keys->map($get{map}) or undef $get{map};
45 $keys->print_rows($get{rows});
46 :>
47 </ul>
48
49 <hr>
50
51 <div class="help">
52         <div class="left">
53                 <dl class="legend legend-types">
54                 <dt class="ci">info
55                         <dd>Info command: shows/does something without altering anything.
56                 <dt class="pm">motion
57                         <dd>Moves the cursor, or defines the range for an operator (<:= $sign{motion} :>).
58                 <dt class="po">positioning
59                         <dd>Other movement (jumps, window (re)positioning).
60                 <dt class="co">command
61                         <dd>Direct action command.
62                 <dt class="mi">ins mode
63                         <dd>Enters Insert or Replace mode.
64                 <dt class="mo">mode
65                         <dd>Enters a different mode.
66                 <dt class="mv">vis mode
67                         <dd>Enters Visual or Select mode.
68                 <dt class="me">key cmd
69                         <dd>Additional key commands (click for overview).
70                 </dl>
71         </div>
72
73         <div class="right">
74                 <dl class="legend legend-options">
75                 <dt>key<:= $sign{arg} :>
76                         <dd>Commands with a dot need a char argument afterwards.
77                 <dt>key<:= $sign{motion} :>
78                         <dd>Requires a motion afterwards, operates between cursor and destination.
79                 <dt class="ext vim6">vim
80                         <dd>Not in original Vi (assessment incomplete).
81                 <dt class="ext new vim7">vim7
82                         <dd>New in vim version 7.x.
83                 </dl>
84
85                 <ul class="legend legend-set">
86                 <li>keyboard <strong>map</strong> is
87                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
88                 <li><strong>ascii</strong> mode is
89                         <:= defined $sign{-ascii} && 'forced ' :><em><:=
90                                 $sign{-ascii} ? 'on' : 'off' :></em>
91                 <li><strong>keys</strong> are
92                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
93                                 !exists $get{keys} && ' by default' :>
94                 <li>default <strong>style</strong> is
95                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
96                 </ul>
97         </div>
98 </div>
99
100 <p class="footer">
101         <a href="/" rel="home">sheet.shiar.nl</a>/vim.<a href="/source/vim.plp"
102          rel="code" title="Written in Perl">plp</a>
103         <a href="http://git.shiar.nl/sheet.git/history/HEAD:/vim.plp"
104          rel="vcs-git" title="Git repository"><:= $VERSION :></a>
105         created by <a href="http://shiar.nl/" rel="author">Shiar</a> <:= $sign{sep} :>
106         <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html" rel="copyright"
107          title="Licensed under the GNU Affero General Public License, version 3">AGPLv3</a>
108 </p>
109
110 </html>