From: Mischa POSLAWSKY Date: Fri, 17 Oct 2008 22:19:34 +0000 (+0000) Subject: vim: custom key rows specifiable via ?status X-Git-Tag: v1.2~10 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/be46753aff7814c37fd21b8117fd77de1d3edc39 vim: custom key rows specifiable via ?status Allows a non-interactive keyboard custom-tailored to show only wanted key modes and cases. Useful to print out specific rows. Letters indicate Vim modes (e.g. g, ^w, v, i, nothing for normal), following digits specify keyboard modes/cases (where 1 is lower case, 2 shifted, and 3 with control pressed). After this, a dash with more digits can be added to supply alternative key cases shown only at the top (numeric) row. For example: ?static=i3+z1+g1-2+321-21 would result in: 1. insert mode keys with control pressed; 2. z + unshifted keys; 3. g + shifted keys for the first row, so !-) instead of 1-0, + normal keys (a-z, not A-Z as would be g2) elsewhere; 4. standard rows (control, shift, normal) for normal mode, but leaving out ctrl for the first row (only ^^ there). Clicking mode keys will not work correctly (should probably just be disabled). --- diff --git a/index.plp b/index.plp index a482b58..4cffec6 100644 --- a/index.plp +++ b/index.plp @@ -161,17 +161,25 @@ sub print_key { our $map = defined $keyrows{$get{map}} ? $get{map} : 'qwerty'; my $keyrows = $keyrows{$map}; +my @moderows = $get{static} ? split(/\s+/, $get{static}) : sort keys %keys; for (my $row = 0; $row <= $#$keyrows; $row++) { my $keyrow = $keyrows->[$row]; + my @caserows = 0 .. $#$keyrow; + print qq{