latin: chappe semaphore
[sheet.git] / vi.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'vi cheat sheet',
5         version => 'v1.3',
6         description => [
7                 "Interactive cheat sheet for vi text editors, notably Vim,",
8                 "describing each key in various modes.",
9         ],
10         keywords => [qw'
11                 vi vim nvi sheet cheat reference overview commands keyboard
12         '],
13         stylesheet => [qw'light dark circus mono red terse'],
14         keys => 1,
15 });
16
17 :>
18 <h1>vi/vim cheat sheet</h1>
19
20 <h2>normal mode (default)</h2>
21
22 <:
23 use Shiar_Sheet::Keyboard 2;
24 my $info = do 'vi.eng.inc.pl' or die $@;
25 $info->{def} = do 'vi.inc.pl';
26 my $keys = Shiar_Sheet::Keyboard->new($info);
27 $keys->map($get{map}) or undef $get{map};
28 $keys->print_rows($get{rows});
29 :>
30
31 <hr>
32
33 <div class="help">
34         <div class="left">
35 <:
36                 $keys->print_legend('legend-types', ['g1' .. 'g4', 'g6' .. 'g9']);
37 :>
38         </div>
39
40         <div class="right">
41 <:
42                 $keys->print_legend('legend-options', [qw'arg motion', 'ext vim6', 'ext new vim7']);
43 :>
44
45                 <ul class="legend legend-set">
46                 <li>keyboard <strong>map</strong> is
47                         <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
48                 <li><strong>keys</strong> are
49                         <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
50                                 !defined $showkeys && ' by default' :>
51                 <li>default <strong>style</strong> is
52                         <:= defined $get{style} && 'set to ' :><em><:= $style :></em>
53                 </ul>
54         </div>
55 </div>
56