From: Mischa POSLAWSKY Date: Sun, 11 Jan 2009 16:55:56 +0000 (+0000) Subject: vimperator: keyboard cheat page X-Git-Tag: v1.3~202 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/29b80033c249b03db4391eb284d543a0d68a8e5a vimperator: keyboard cheat page Complete Vimperator 1.12 coverage, with various modes (hints, zoom, etc) and determined arguments: Vim modes reassigned, with one additional style in between .co (commands) and .mi (commandish mode). --- diff --git a/base.css b/base.css index 95ba44c..366499e 100644 --- a/base.css +++ b/base.css @@ -118,6 +118,7 @@ ul.keys.ctrl li b small { /* meta key indicator */ .po {background: #DFA} /* window */ .co {background: #FFA} /* command */ .ci {background: #BFE} /* info */ +.cp {background: #FDA} /* TODO */ .mi {background: #FCA} /* insert mode */ .mo {background: #FCC} /* mode */ .mv {background: #ECE} /* visual mode */ diff --git a/nethack.plp b/nethack.plp index 0a5a4be..b73a765 100644 --- a/nethack.plp +++ b/nethack.plp @@ -70,7 +70,7 @@ function setmode(classname) { } // setmode //--> - +

NetHack cheat sheet

diff --git a/red.css b/red.css index 154238b..33e7f72 100644 --- a/red.css +++ b/red.css @@ -30,12 +30,13 @@ ul.keys li b { .pm {background: none} .pm b, dt.pm {color: #DD6} /* motion */ .po {background: none} .po b, dt.po {color: #6CD} /* window */ .co {background: none} .co b, dt.co {color: none} /* command */ -.mi {background: #300} /* ins */ +.mi, .cp {background: #300} /* ins */ .mo {background: #600} /* state */ .mv {background: #600; font-style: italic} .mv b, dt.mv {color: #DD6} /* visual */ .me {background: #600; font-style: italic} /* mode */ dl.legend-options dt, .no {background: none} .no b {color: #000} /* unassigned */ +#vimperator .mi b, #vimperator dt.mi {color: #6CD} /* tab open */ .co[onclick]:hover, .mi[onclick]:hover, diff --git a/vim.plp b/vim.plp index 3ae41b1..505e34e 100644 --- a/vim.plp +++ b/vim.plp @@ -71,7 +71,7 @@ function setmode(classname) { } // setmode //--> - +

vi/vim cheat sheet

diff --git a/vimperator.inc.pl b/vimperator.inc.pl index 6f18abd..36cda28 100644 --- a/vimperator.inc.pl +++ b/vimperator.inc.pl @@ -3,99 +3,160 @@ use utf8; '' => { desc => 'normal mode', - '~' => ["open home$sign{_}dir"], - '@' => ["play macro", 'arg'], - '%' => ["to line pct", 'pm'], #TODO: G? - '0' => ["left of page", 'pm'], + '~' => ["open home$sign{_}dir", 'cp'], + '@' => ["play macro", 'mo arg'], + '^' => ["left of page", 'pm'], + '0' => '^', '$' => ["right of page", 'pm'], '#' => ["rev. find word", 'pm'], '*' => ["find word", 'pm'], - #'+' - #'`' - '^^'=> ["last tab"], - '?' => ["find rev.", 'pm arg modec'], - '/' => ["find", 'pm arg modec'], - - 'a' => ["add bookm$sign{_}ark"], - 'A' => ["toggle bookm$sign{_}ark$sign{_}ed"], - '^a'=> ["increment url nr"], - 'b' => ["to buffer"], - 'B' => ["list buffers"], + '+' => 'zi', + '-' => 'zo', + '^^'=> ["last tab", 'po'], + '?' => ["find rev.", 'pm args modec'], + '/' => ["find", 'pm args modec'], + '[' => ["focus forw$sign{_}ard", 'me arg mode['], + ']' => ["focus back", 'me arg mode]'], + ':' => ["comm$sign{_}and line mode", 'mo args'], + ';' => ["extend$sign{_}ed hint$sign{_}s mode", 'me arg args mode;'], + "'" => ["jump to mark", 'pm'], + '`' => "'", + + 'a' => ["add bookm$sign{_}ark", 'mo args'], + 'A' => ["toggle bookm$sign{_}ark$sign{_}ed", 'mo'], + '^a'=> ["incr$sign{_}em$sign{_}ent url nr", 'cp'], + 'b' => ["to buffer", 'po args'], + 'B' => ["list buffers", 'ci'], '^b'=> ["page up", 'pm'], - '^c'=> ["stop loading"], - 'd' => ["close tab"], - 'D' => ["close left tab"], - #'^d' - #'^u' + '^c'=> ["stop loading", 'co'], + '^d'=> ["scroll down", 'pm'], + 'd' => ["close tab", 'co'], + 'D' => ["close tab left$sign{_}ward$sign{_}s", 'co'], + 'i' => ["caret mode", 'mv'], '^i'=> 'L', '^e'=> 'j', - 'f' => ["quick$sign{_}hint mode", 'arg'], - 'F' => ["f in tab", 'arg'], + 'f' => ["quick$sign{_}hint mode", 'cp args'], + 'F' => ["f in tab", 'mi args'], '^f'=> ["page down", 'pm'], # spacebar - 'g' => ["extra cmds", 'me modeg'], + 'g' => ["extra cmds", 'me modeg arg'], 'G' => ["last/% line", 'pm'], - '^g'=> ["file name"], + '^g'=> ["file name", 'ci'], 'h' => [$sign{left}, 'pm'], - 'H' => ["page back"], + 'H' => ["page back", 'cp'], 'j' => [$sign{down}, 'pm'], 'k' => [$sign{up}, 'pm'], 'l' => [$sign{right}, 'pm'], - 'L' => ["page forw$sign{_}ard"], - 'M' => ["mark url", 'arg'], - 'm' => ["mark line", 'arg'], + 'L' => ["page forw$sign{_}ard", 'cp'], + 'M' => ["mark url", 'mo arg'], + 'm' => ["mark line", 'mo arg'], 'n' => ["find next", 'pm'], 'N' => ["find prev$sign{_}ious", 'pm'], '^n'=> 'gt', - 'o' => ["open", ''], - 'O' => ["alter url"], + 'o' => ["open", 'cp'], + 'O' => ["alter url", 'cp'], '^o'=> 'H', - 'p' => ["open pasted url"], - 'P' => ["p in tab"], + 'p' => ["open pasted url", 'cp'], + 'P' => ["p in tab", 'mi'], '^p'=> 'gT', - 'q' => ["record macro", 'arg'], - 'r' => ["reload page"], - 'R' => ["reload uncach$sign{_}e$sign{_}d"], - 't' => ["tab open new"], - 'T' => ["tab open curr$sign{_}ent"], - '^v'=> ["pass single", 'arg'], - 'u' => ["restore closed tab"], - 'y' => ["copy url"], - 'Y' => ["copy select$sign{_}ion"], + 'q' => ["record macro", 'mv arg'], + 'r' => ["reload page", 'co'], + 'R' => ["reload uncach$sign{_}e$sign{_}d", 'cp'], + 't' => ["tab open new", 'mi'], + 'T' => ["tab open curr$sign{_}ent", 'mi'], + '^v'=> ["pass single", 'co arg'], + '^u'=> ["scroll up", 'pm'], + 'u' => ["restore closed tab", 'mi'], + '^x'=> ["decr$sign{_}em$sign{_}ent url nr", 'cp'], + 'y' => ["copy url", 'mo'], + 'Y' => ["copy select$sign{_}ion", 'mo'], '^y'=> 'k', + 'z' => ["zoom", 'ci modez arg'], 'Z' => ["quit", 'me modeZ arg'], - '^z'=> ["pass throu$sign{_}gh"], + '^z'=> ["pass throu$sign{_}gh", 'mv'], }, # normal mode g => { desc => 'extended commands (g)', lead => 'g', - '0' => ["first tab"], - '$' => ["last tab"], + '0' => ["first tab", 'po'], + '$' => ["last tab", 'po'], '^' => 'g0', - 'b' => ["repeat buffer cmd"], - 'B' => ["reverse gb"], - 'i' => ["last input field"], - '^g'=> ["file details"], - 'g' => ["first line"], - 'f' => ["view source"], - 'F' => ["source extern$sign{_}al"], - 'm' => ["repeat output"], - 'n' => ["tabopen url mark", '', 'Go in New tab'], - 'o' => ["open url mark"], - 'P' => ["P inactive"], - 'h' => ["open home$sign{_}page"], - 'H' => ["tab with home$sign{_}page"], - 'u' => ["parent dir$sign{_}ectory"], - 'U' => ["site root"], + 'b' => ["repeat buffer cmd", 'po'], + 'B' => ["reverse gb", 'po'], + 'f' => ["view source", 'cp'], + 'F' => ["source extern$sign{_}al", 'mo'], + '^g'=> ["file details", 'ci'], + 'g' => ["first line", 'pm'], + 'h' => ["open home$sign{_}page", 'cp'], + 'H' => ["tab with home$sign{_}page", 'mi'], + 'i' => ["last input field", 'pm'], + 'n' => ["tabopen url mark", 'mi arg', 'Go in New tab'], + 'o' => ["open url mark", 'cp arg'], + 'P' => ["$sign{alias}P inactive", 'mi'], + 't' => ["next tab", 'po'], + 'T' => ["prev$sign{_}ious tab", 'po'], + 'u' => ["parent dir$sign{_}ectory", 'cp'], + 'U' => ["site root", 'cp'], }, # mode g +';' => { + desc => 'extended hints (;)', + lead => ';', + + ';' => ["focus", 'pm'], + 'a' => ["save prompt", 'mo args'], + 'f' => ';o', + 'F' => ';t', + 'o' => ["open", 'cp'], + 'O' => ["open prompt", 'cp args'], + 's' => ["save", 'mo'], + 't' => ["open in tab", 'mi'], + 'T' => ["tab prompt", 'mi args'], + 'v' => ["view source", 'cp'], + 'w' => ["open in wind$sign{_}ow", 'mi'], + 'W' => ["wind$sign{_}ow prompt", 'mi args'], + 'y' => ["copy url", 'mo'], + 'Y' => ["copy text", 'mo'], +}, # mode ; +']' => { + desc => '(])', + lead => ']', + + 'f' => ["next frame$sign{_}set", 'pm'], + ']' => ["open next", 'cp'], +}, # mode ] + +'[' => { + desc => '([)', + lead => '[', + + 'f' => ["previous frame$sign{_}set", 'pm'], + '[' => ["open prev", 'cp'], +}, # mode [ + +z => { + desc => 'zoom commands (z)', + lead => 'z', + + 'i' => ["en$sign{_}large text", 'ci', 'Zoom In'], + 'm' => ["en$sign{_}large more", 'ci', 'Zoom More'], + 'o' => ["shrink text", 'ci', 'Zoom Out'], + 'r' => ["tinier text", 'ci', 'Zoom Reduce'], + 'z' => ["reset text size", 'ci', 'Zoom Zero'], + 'I' => ["zoom in", 'ci'], + 'M' => ["zoom more", 'ci'], + 'O' => ["zoom out", 'ci'], + 'R' => ["zoom out more", 'ci', 'Zoom Reduce'], + 'Z' => ["zoom reset", 'ci', 'Zoom Zero'], +}, # mode z + Z => { desc => 'quit commands (Z)', lead => 'Z', - 'Q' => ["quit no save"], - 'Z' => ["quit save ses$sign{_}s$sign{_}ion"], + 'Q' => ["quit no save", 'mo'], + 'Z' => ["quit save ses$sign{_}s$sign{_}ion", 'mo'], }, # mode Z diff --git a/vimperator.plp b/vimperator.plp new file mode 100644 index 0000000..fe30db5 --- /dev/null +++ b/vimperator.plp @@ -0,0 +1,172 @@ +<: +use utf8; +use strict; +use warnings; +no warnings 'qw'; # you know what you doing +no warnings 'uninitialized'; # save some useless checks for more legible code + +our $VERSION = '1.0'; + +our $ascii = 0; +if (exists $get{ascii}) { + $ascii = $get{ascii} ne '0'; # manual override +} elsif (defined $ENV{HTTP_ACCEPT_CHARSET}) { + $ascii = 1; + for (split q{,}, $ENV{HTTP_ACCEPT_CHARSET}) { + $ascii = 0, last if $_ eq '*' or m{utf-?8}i; + } +} + +my $charset = $ascii ? 'us-ascii' : 'utf-8'; +my $ctype = "text/html; charset=$charset"; +$header{content_type} = $ctype; + +:> + + + +vimperator cheat sheet + + + +<: + my %styles = map {$_ => $_} qw(dark circus mono red terse); + our $style = exists $get{style} && $styles{$get{style}} || 'light'; + printf(qq{\n}, + $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_ + ) for keys %styles; + + our $showkeys = exists $get{keys} && $get{keys} ne '0'; + print "\n" unless $showkeys; + print "\n" + if $showkeys and $get{keys} eq 'ghost'; +:> + + + + + + +

Vimperator cheat sheet

+ +

normal mode (default)

+ + + +
+ +
+
+
+
info +
Displays something without any permanent consequences. +
motion +
Move cursor, scroll window, focus buffer element. +
tab +
Tab or window navigation/selection. +
buffer +
Page interaction. +
open +
Browse to a location in the current tab. +
tab open +
Browse somewhere in a new tab. +
browser +
Other browser action. +
mode +
Enter a different mode. +
key cmd +
Additional key commands (click for overview). +
+
+ +
+
+
key<:= $sign{arg} :> +
Commands with a dot need a char argument afterwards. +
key<:= $sign{args} :> +
Commands with two dots require variable arguments afterwards. +
+ +
    +
  • keyboard map is + <:= $get{map} ? 'set to ' : '' :><:= $keys->{map} :> +
  • ascii mode is + <:= exists $get{ascii} && 'forced ' :><:= + $ascii ? 'on' : 'off' :> +
  • keys are + <:= $showkeys ? 'always shown' : 'hidden if unassigned' :><:= + !exists $get{keys} && ' by default' :> +
  • default style is + <:= defined $get{style} && 'set to ' :><:= $style :> +
+
+
+ + + +