readline: add emacs C-x mode
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 5 May 2009 20:12:06 +0000 (20:12 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 5 May 2009 20:12:06 +0000 (20:12 +0000)
readline.inc.pl
readline.plp

index f6172183a3007edb171bcf54ab959fd67494d359..a2931e553451eaf3b95f3585cd9878a490c773fb 100644 (file)
@@ -61,10 +61,27 @@ use utf8;
        '+u' => ["upcase word", 'mi'],
        '^v' => ["verbatim char", 'mv'],
        '^w' => ["delete word", 'mo ring'], # unix
        '+u' => ["upcase word", 'mi'],
        '^v' => ["verbatim char", 'mv'],
        '^w' => ["delete word", 'mo ring'], # unix
-#      '^xBS' => ["delete till bol", 'mo'],
-       '^x' => ["extend$sign{_}ed", 'me arg'],
+       '^x' => ["extend$sign{_}ed", 'me arg mode^x'],
        '^y' => ["yank top", 'co'],
        '+y' => ["rotate yank", 'co ring'],
        '^+y'=> ["yank arg"],
 },
 
        '^y' => ["yank top", 'co'],
        '+y' => ["rotate yank", 'co ring'],
        '^+y'=> ["yank arg"],
 },
 
+'^x' => {
+       lead => $ascii ? "'x"  : "x̂",
+       desc => 'emacs ctrl-x bindings',
+
+       '^h' => '^u',
+       '('  => ["start macro", 'mv'],
+       ')'  => ["end macro", 'mv'],
+       'e'  => ["run macro", 'mv', 'Execute'],
+       '^e' => ["editor", 'mi ext linkvim'],
+       '^r' => ["reload inputrc", 'mv'],
+       '^u' => '^_',
+       '^x' => ["swap cursor", 'pm', 'eXchange'],
+       '^g' => '^g',
+       '^h' => '^u',
+       '^v' => ["shell version", 'ci ext'],
+       '^?' => '^x^h',
+},
+
index dd81cbe9aa6f0be6936c28dd42507f6f7ebf64b5..c849921fcfd47413565ccab9264288b854888ecf 100644 (file)
@@ -52,7 +52,7 @@ $header{content_type} = "text/html; charset=$sign{charset}";
 use Shiar_Sheet::Keyboard;
 my $keys = Shiar_Sheet::Keyboard->new({do 'readline.inc.pl'});
 $keys->map($get{map}) or undef $get{map};
 use Shiar_Sheet::Keyboard;
 my $keys = Shiar_Sheet::Keyboard->new({do 'readline.inc.pl'});
 $keys->map($get{map}) or undef $get{map};
-$keys->print_rows($get{rows}, [4,3,2]);
+$keys->print_rows($get{rows} || '^x=213', [4,3,2]);
 :>
 </ul>
 
 :>
 </ul>