X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=genrefcard.pl;h=057142ecf28836b13951eaea34b3b7982056bc2a;hb=d37e69cd6d6eee0e8ae18e52d27175ed1785174a;hp=8e028ff05edda1b7496c242e5f53e682bf250bc1;hpb=0b0832bc305eb1f36dfdd515d19e456d6f4e66ee;p=grml-gen-zshrefcard.git diff --git a/genrefcard.pl b/genrefcard.pl index 8e028ff..057142e 100755 --- a/genrefcard.pl +++ b/genrefcard.pl @@ -2,7 +2,16 @@ use strict; #{{{ readme ### Author: Frank Terbeck -### GPLv2 +### +### This file is free software: you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published +### by the Free Software Foundation, either version 3 of the License, +### or (at your option) any later version. +### +### This file is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. ### ### generate grml zsh refcard. ### #v#: variables @@ -355,6 +364,25 @@ sub __keybinding { #{{{ #xprint(0, "!-> DEBUG: kbd: $kbd - value: $value - desc: $desc\n"); push(@{ $data{"keybindings-$secmap[$sec]"} }, "\\command\{$kbd\}\{$desc\}"); + } elsif ($input[$ln] =~ m!^.*bind2maps\s+([^-])+--\s+(.*)!) { + my ($maps, $rest) = ($1, $2); + my (@a) = split /\s+/, $rest, 2; + if ($a[0] ne q{-s}) { + push(@{ $data{"keybindings-$secmap[$sec]"} }, + "\\command\{$a[0]\}\{$desc\}"); + return 1; + } + my $seq; + $rest = $a[1]; + if ($rest =~ m!^'([^']+)'\s+!) { + $seq = $1; + } elsif ($rest =~ m!^"([^"]+)"\s+!) { + $seq = $1; + } else { + $seq = $rest; + } + $seq = demystify_keys($seq); + push(@{ $data{"keybindings-$secmap[$sec]"} }, "\\command\{$seq\}\{$desc\}"); } else { return 0; }