4 title => 'vi cheat sheet',
7 "Interactive cheat sheet for vi text editors, notably Vim,",
8 "describing each key in various modes.",
11 vi vim nvi sheet cheat reference overview commands keyboard
13 charset => $sign{charset},
14 stylesheet => [qw'light dark circus mono red terse'],
19 <h1>vi/vim cheat sheet</h1>
21 <h2>normal mode (default)</h2>
26 <ul class="keys omni">
27 <li class="mo chr27" onclick="setmode()"><b>Esc</b> normal mode
28 <!-- not as static anymore, but never bothered; just see ^[ -->
33 use Shiar_Sheet::Keyboard 2;
34 my $info = do 'vi.eng.inc.pl' or die $@;
35 $info->{def} = do 'vi.inc.pl';
36 my $keys = Shiar_Sheet::Keyboard->new($info);
37 $keys->map($get{map}) or undef $get{map};
38 $keys->print_rows($get{rows});
46 <dl class="legend legend-types">
48 <dd>Info command: shows/does something without altering anything.
50 <dd>Moves the cursor, or defines the range for an operator (<:= $sign{motion} :>).
51 <dt class="po">positioning
52 <dd>Other movement (jumps, window (re)positioning).
53 <dt class="co">command
54 <dd>Direct action command.
55 <dt class="mi">ins mode
56 <dd>Enters Insert or Replace mode.
58 <dd>Enters a different mode.
59 <dt class="mv">vis mode
60 <dd>Enters Visual or Select mode.
61 <dt class="me">key cmd
62 <dd>Additional key commands (click for overview).
67 <dl class="legend legend-options">
68 <dt>key<:= $sign{arg} :>
69 <dd>Commands with a dot need a char argument afterwards.
70 <dt>key<:= $sign{motion} :>
71 <dd>Requires a motion afterwards, operates between cursor and destination.
72 <dt class="ext vim6">vim
73 <dd>Not in original Vi (assessment incomplete).
74 <dt class="ext new vim7">vim7
75 <dd>New in vim version 7.x.
78 <ul class="legend legend-set">
79 <li>keyboard <strong>map</strong> is
80 <:= $get{map} ? 'set to ' : '' :><em><:= $keys->{map} :></em>
81 <li><strong>ascii</strong> mode is
82 <:= defined $sign{-ascii} && 'forced ' :><em><:=
83 $sign{-ascii} ? 'on' : 'off' :></em>
84 <li><strong>keys</strong> are
85 <em><:= $showkeys ? 'always shown' : 'hidden if unassigned' :></em><:=
86 !defined $showkeys && ' by default' :>
87 <li>default <strong>style</strong> is
88 <:= defined $get{style} && 'set to ' :><em><:= $style :></em>