From 3aab2658e078a4f424343fb10817f8d0eab9343b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 15 May 2009 22:34:25 +0000 Subject: [PATCH] mutt: page, key classes, various updates --- base.css | 2 + circus.css | 12 ++-- dark.css | 2 + mutt.inc.pl | 182 ++++++++++++++++++++++++++-------------------------- mutt.plp | 113 ++++++++++++++++++++++++++++++++ red.css | 35 ++++++---- 6 files changed, 239 insertions(+), 107 deletions(-) create mode 100644 mutt.plp diff --git a/base.css b/base.css index 0aee0ed..76f5929 100644 --- a/base.css +++ b/base.css @@ -374,6 +374,8 @@ td.di-a:hover {background: #CF8} .mv {background: #ECE} /* visual mode */ .me {background: #CCF} /* key mode */ +.pm[onclick]:hover {background: #7E7} +.po[onclick]:hover {background: #CE6} .ci[onclick]:hover {background: #5ED} .mi[onclick]:hover {background: #F97} .mo[onclick]:hover {background: #F88} diff --git a/circus.css b/circus.css index 160ca54..a6e77b7 100644 --- a/circus.css +++ b/circus.css @@ -1,13 +1,15 @@ .pm {background: #8F8} /* motion */ -.po {background: #CF7} /* window */ -.co {background: #FF7} /* command */ +.po {background: #BF6} /* window */ +.co {background: #FF6} /* command */ .ci {background: #8FD} /* info */ -.cp {background: #FB7} /* info */ -.mi {background: #FFA070} /* insert mode */ +.cp {background: #FC6} +.mi {background: #F96} /* insert mode */ .mo {background: #F77} /* mode */ .mv {background: #E8E} /* visual mode */ -.me {background: #99F} /* key mode */ +.me {background: #9AF} /* key mode */ +.pm[onclick]:hover {background: #000; color: #7E7} +.po[onclick]:hover {background: #000; color: #CE6} .ci[onclick]:hover {background: #000; color: #8FD} .co[onclick]:hover {background: #000; color: #FF7} .mi[onclick]:hover {background: #000; color: #FFA070} diff --git a/dark.css b/dark.css index dd54f48..9540a7a 100644 --- a/dark.css +++ b/dark.css @@ -27,6 +27,8 @@ dl.legend-options dt {background: #333} .me {background: #205} /* mode */ .no {background: #222} /* unassigned */ +.pm[onclick]:hover, +.po[onclick]:hover, .ci[onclick]:hover, .co[onclick]:hover, .mi[onclick]:hover, diff --git a/mutt.inc.pl b/mutt.inc.pl index 969aeee..77f920d 100644 --- a/mutt.inc.pl +++ b/mutt.inc.pl @@ -5,100 +5,100 @@ my @generic = qw(^l ! * / : ; < = > ? H L M Z [ ] j k n q t z); '' => { desc => 'index', - ';' => ["apply to tagged", 'arg'], # tag-prefix + ';' => ["apply to tagged", 'mi arg'], # tag-prefix '@' => ["display sender", 'ci'], # display-address - ':' => ["enter command"], # enter-command - '=' => ["first entry"], # first-entry - ']' => ["half page down"], # half-down - '[' => ["half page up"], # half-up - '?' => ["help"], # help - '!' => ["invoke shell"], # shell - '*' => ["last message"], # last-entry - '>' => ["line $sign{down}"], # next-line - '<' => ["line $sign{up}"], # previous-line - '.' => ["list new mail"], # buffy-list #TODO - '|' => ["pipe to shell"], # pipe-message - '$' => ["save mailbox"], # sync-mailbox - '/' => ["search", 'mode/~'], # search - '#' => ["split up thread"], # break-thread - '&' => ["thread tagged"], # link-threads - '%' => ["toggle readonly"], # toggle-write + ':' => ["enter command", 'mi'], # enter-command + '=' => ["first entry", 'po'], # first-entry + ']' => ["half page down", 'pm'], # half-down + '[' => ["half page up", 'pm'], # half-up + '?' => ["help", 'ci'], # help + '!' => ["invoke shell", 'ci arg'], # shell + '*' => ["last message", 'po'], # last-entry + '>' => ["line $sign{down}", 'pm'], # next-line + '<' => ["line $sign{up}", 'pm'], # previous-line + '.' => ["list new mail", 'mv'], # buffy-list #TODO + '|' => ["pipe to shell", 'mi'], # pipe-message + '$' => ["save mailbox", 'co'], # sync-mailbox + '/' => ["search", 'po arg mode/~'], # search + '#' => ["split up thread", 'co'], # break-thread + '&' => ["thread tagged", 'co'], # link-threads + '%' => ["toggle reado$sign{_}nl$sign{_}y", 'co'], # toggle-write ' ' => '^m', - 'a' => ["create alias"], # create-alias - 'b' => ["bounce"], # bounce-message - '^b'=> ["url$sign{_}view"], - '\b'=> ["search bodies"], # M ~b - 'c' => ["open folder"], # change-folder - 'C' => ["copy message"], # copy-message - '\c'=> ["open readonly"], # change-folder-readonly - '\C'=> ["make plain copy"], # decode-copy - 'd' => ["delete"], # delete-message - 'D' => ["delete pattern"], # delete-pattern - '^d'=> ["delete thread"], # delete-thread - '\d'=> ["delete subthread"], # delete-subthread - 'e' => ["edit"], # edit - '^e'=> ["edit con$sign{_}tent type"], # edit-type - '\e'=> ["edit+send copy"], # resend-message - 'f' => ["forward"], # forward-message - 'F' => ["toggle important"], # flag-message - '^f'=> ["forget pass$sign{_}phras$sign{_}e"], # forget-passphrase - 'g' => ["reply to all", '', 'Group reply'], # group-reply - 'G' => ["fetch POP", '', 'Gather new mail'], # fetch-mail - 'h' => ["toggle headers"], # display-toggle-weed - 'H' => ["screen top"], # top-page - '^i'=> ["next unread msg"], # next-new-then-unread -# '\tab'=> ["previous unread msg"], # previous-new-then-unread - 'j' => ["next entry"], # next-entry, next-undeleted - 'J' => ["next message"], # next-entry - 'k' => ["previous entry"], # previous-entry, previous-undeleted - 'K' => ["previous message"], # previous-entry - '^k'=> ["extract pub keys"], # extract-keys - '\k'=> ["send public key"], # mail-key - 'l' => ["limit pattern"], # limit - 'L' => ["reply to list"], # list-reply - '^l'=> ["redraw"], # refresh - '\l'=> ["show current limit"], # show-limit - 'm' => ["compose mail"], # mail - 'M' => ["screen middle"], # middle-page - '^m'=> ["select"], # select-entry, display-message - 'n' => ["search next"], # search-next - 'N' => ["toggle new"], # toggle-new - '^n'=> ["next thread"], # next-thread - '\n'=> ["next subthread"], # next-subthread - 'o' => ["sort"], # sort-mailbox - 'O' => ["sort reverse"], # sort-reverse - 'p' => ["print"], # print-message - 'P' => ["to parent"], # parent-message - '^p'=> ["previous thread"], # previous-thread - '\p'=> ["previous subthread"], # previous-subthread - '\P'=> ["check for pgp"], # check-traditional-pgp - 'q' => ["exit or quit"], # exit, quit - 'Q' => ["query for addresses"], # query #TODO - 'r' => ["reply to sender"], # reply - 'R' => ["recall postpon$sign{_}e$sign{_}d"], # recall-message - '^r'=> ["mark thread read"], # read-thread - '\r'=> ["mark sub$sign{_}thread r$sign{_}ead"], # read-subthread - 's' => ["move"], # save-message - '\s'=> ["save and delete"], # decode-save - 't' => ["tag"], # tag-entry - 'T' => ["tag pattern"], # tag-pattern - '^t'=> ["untag pattern"], # untag-pattern - '\t'=> ["tag thread"], # tag-thread - 'u' => ["undo delete"], # undelete-message - 'U' => ["undelete pattern"], # undelete-pattern - '^u'=> ["undelete thread"], # undelete-pattern - '\u'=> ["undelete subthread"], # undelete-subthread - 'v' => ["attach$sign{_}ments"], # view-attachments - 'V' => ["version"], # show-version - '\v'=> ["(un)collapse thread"], # collapse-thread - '\V'=> ["(un)collapse threads"], # collapse-all - 'w' => ["set flag", 'arg'], # set-flag - 'W' => ["clear flag", 'arg'], # clear-flag - 'x' => ["exit menu"], # exit - 'y' => ["list incoming mailboxes"], # M ? - 'z' => ["page $sign{down}"], # next-page - 'Z' => ["page $sign{up}"], # previous-page + 'a' => ["create alias", 'mi'], # create-alias + 'b' => ["bounce", 'mo'], # bounce-message + '^b'=> ["url$sign{_}view", 'ci'], + '+b'=> ["search bodies"], # M ~b + 'c' => ["open folder", 'mv'], # change-folder + 'C' => ["copy message", 'mi'], # copy-message + '+c'=> ["open readonly", 'mv'], # change-folder-readonly + '+C'=> ["make plain copy"], # decode-copy + 'd' => ["delete", 'co'], # delete-message + 'D' => ["delete patt$sign{_}er$sign{_}n", 'co arg'], # delete-pattern + '^d'=> ["delete thread", 'co'], # delete-thread + '+d'=> ["delete subthread", 'co'], # delete-subthread + 'e' => ["edit", 'co'], # edit + '^e'=> ["edit con$sign{_}tent type", 'co'], # edit-type + '+e'=> ["edit+send copy"], # resend-message + 'f' => ["forward", 'mo modem'], # forward-message + 'F' => ["toggle important", 'co'], # flag-message + '^f'=> ["forget pass$sign{_}phras$sign{_}e", 'mi'], # forget-passphrase + 'g' => ["reply to all", 'mo modem', 'Group reply'], # group-reply + 'G' => ["fetch POP", 'mi', 'Gather new mail'], # fetch-mail + 'h' => ["toggle headers", 'me'], # display-toggle-weed + 'H' => ["screen top", 'po'], # top-page + '^i'=> ["unread msg $sign{down}", 'po'], # next-new-then-unread + '+^i'=> ["unread msg $sign{up}"], # previous-new-then-unread + 'j' => ["entry $sign{down}", 'po'], # next-entry, next-undeleted + 'J' => ["messag$sign{_}e $sign{down}", 'po'], # next-entry + 'k' => ["entry $sign{up}", 'po'], # previous-entry, previous-undeleted + 'K' => ["messag$sign{_}e $sign{up}", 'po'], # previous-entry + '^k'=> ["extract pub keys", 'ci'], # extract-keys + '+k'=> ["send public key", 'mo modem'], # mail-key + 'l' => ["limit pattern", 'me'], # limit + 'L' => ["reply to list", 'mo modem'], # list-reply + '^l'=> ["redraw", 'ci'], # refresh + '+l'=> ["show current limit", 'ci'], # show-limit + 'm' => ["compo$sign{_}s$sign{_}e mail", 'mo modem'], # mail + 'M' => ["screen middle", 'po'], # middle-page + '^m'=> ["select", 'mi mode^m'], # select-entry, display-message + 'n' => ["search $sign{down}", 'po'], # search-next + 'N' => ["toggle new", 'co'], # toggle-new + '^n'=> ["thread $sign{down}", 'po'], # next-thread + '+n'=> ["subthr$sign{_}ead $sign{down}", 'po'], # next-subthread + 'o' => ["sort", 'me modeo'], # sort-mailbox + 'O' => ["sort reverse", 'me modeo'], # sort-reverse + 'p' => ["print", 'ci'], # print-message + 'P' => ["to parent", 'po'], # parent-message + '^p'=> ["thread $sign{up}", 'po'], # previous-thread + '+p'=> ["subthr$sign{_}ead $sign{up}", 'po'], # previous-subthread + '+P'=> ["check for pgp"], # check-traditional-pgp + 'q' => ["exit or quit", 'mv'], # exit, quit + 'Q' => ["query addr$sign{_}ess$sign{_}es", 'ci arg'], # query + 'r' => ["reply to sender", 'mo modem'], # reply + 'R' => ["recall postpon$sign{_}e$sign{_}d", 'mo modem'], # recall-message + '^r'=> ["mark thread read", 'co'], # read-thread + '+r'=> ["mark sub$sign{_}thread r$sign{_}ead", 'co'], # read-subthread + 's' => ["move", 'co'], # save-message + '+s'=> ["save and delete", 'co'], # decode-save + 't' => ["tag", 'co'], # tag-entry + 'T' => ["tag patt$sign{_}er$sign{_}n", 'co arg'], # tag-pattern + '^t'=> ["untag pattern", 'co'], # untag-pattern + '+t'=> ["tag thread", 'co'], # tag-thread + 'u' => ["undo delete", 'co'], # undelete-message + 'U' => ["res$sign{_}tore pat$sign{_}t$sign{_}er$sign{_}n", 'co arg'], # undelete-pattern + '^u'=> ["restore thread", 'co'], # undelete-thread + '+u'=> ["restore subthread", 'co'], # undelete-subthread + 'v' => ["attach$sign{_}ments", 'ci'], # view-attachments + 'V' => ["version", 'ci'], # show-version + '+v'=> ["(un)collapse thread", 'me'], # collapse-thread + '+V'=> ["(un)collapse threads", 'me'], # collapse-all + 'w' => ["set flag", 'co arg'], # set-flag + 'W' => ["clear flag", 'co arg'], # clear-flag + 'x' => ["exit menu", 'mv'], # exit + 'y' => ["list incoming mailboxes", 'mv'], # M ? + 'z' => ["page $sign{down}", 'pm'], # next-page + 'Z' => ["page $sign{up}", 'pm'], # previous-page }, # index ' ' => { diff --git a/mutt.plp b/mutt.plp new file mode 100644 index 0000000..7ecf7fc --- /dev/null +++ b/mutt.plp @@ -0,0 +1,113 @@ +<: +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 + +use Shiar_Sheet::KeySigns qw(%sign); + +our $VERSION = 'v1.0'; + +$header{content_type} = "text/html; charset=$sign{charset}"; + +:> + + + +mutt 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'; +:> + + + + +

Mutt cheat sheet

+ +

index (default)

+ +
    + +
  • +
      +
    • Esc + + +
    +
  • + +<: +use Shiar_Sheet::Keyboard; +my $keys = Shiar_Sheet::Keyboard->new({do 'mutt.inc.pl'}); +$keys->map($get{map}) or undef $get{map}; +$keys->print_rows($get{rows}); +:> +
+ +
+ +
+
+
+
aside +
Temporarily display something without changing state. +
move +
Scroll window, only selecting a different message when necessary. +
select +
Select another message entry. +
edit +
Modify message flags or contents. +
command +
Any other action which does not alter an existing message. +
send +
Prepare and/or send a (new) message. +
leave +
Exit the opened folder. +
display +
Permanently alter/toggle current view. +
+
+ +
+
+
key<:= $sign{arg} :> +
Commands with a dot need an argument afterwards. +
+ +
    +
  • keyboard map is + <:= $get{map} ? 'set to ' : '' :><:= $keys->{map} :> +
  • ascii mode is + <:= defined $sign{-ascii} && 'forced ' :><:= + $sign{-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 :> +
+
+
+ + + + diff --git a/red.css b/red.css index 5606d38..af61745 100644 --- a/red.css +++ b/red.css @@ -26,20 +26,33 @@ ul.keys li b { font-style: normal; } -.ci {background: none; font-style: italic} /* info */ -.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, .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 */ +.no, dl.legend-options dt, +.ci, .pm, .po, .co {background: none} +#mutt .co, +.mi, .cp {background: #300} +.mo, .mv, .me {background: #600} +#mutt .pm b, #mutt dt.pm, +#mutt .mv b, #mutt dt.mv, +dt.co, + .co b {color: inherit} +#vimperator .mi b, #vimperator dt.mi, +dt.po, + .po b {color: #6CD} +#mutt .ci b, #mutt dt.ci, +#mutt .mi b, #mutt dt.mi, +#mutt .me b, #mutt dt.me, +dt.pm, dt.mv, + .pm b, .mv b {color: #DD6} +.no b {color: #000} /* unassigned */ +.ci, .mv, .me {font-style: italic} +#mutt .ci, #mutt .me, +.no {font-style: normal} .ci[onclick]:hover, +.pm[onclick]:hover, +.po[onclick]:hover, .co[onclick]:hover, +.cp[onclick]:hover, .mi[onclick]:hover, .mo[onclick]:hover, .mv[onclick]:hover, -- 2.30.0