From 38f9d6cd9bee0940367500ae0223b2320edf80c2 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 8 Oct 2010 22:27:33 +0200 Subject: vim_mode: :map supports in {rhs}. --- vim-mode/vim_mode.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'vim-mode/vim_mode.pl') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 5d6dfe1..07968d4 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -82,14 +82,15 @@ # # {lhs} is the key combination to be mapped, {rhs} the target. The <> notation # is used (e.g. is Ctrl-F), case is ignored. Supported <> keys: -# -, , , , . Mapping ex-mode and irssi commands -# is supported. Only default mappings can be used in {rhs}. +# -, , , , , . Mapping ex-mode and irssi +# commands is supported. Only default mappings can be used in {rhs}. # Examples: # :map w W # to remap w to work like W # :map gb :bnext # to map gb to call :bnext # :map gB :bprev # :map /clear # map Ctrl-L to irssi command /clear # :map /window goto 1 +# :map - disable , it does nothing now # # # The following irssi settings are available: @@ -243,6 +244,8 @@ sub C_INSERT () { 4 } sub C_EX () { 5 } # irssi commands sub C_IRSSI () { 6 } +# does nothing +sub C_NOP () { 7 } # word and non-word regex, keep in sync with setup_changed()! my $word = qr/[\w_]/o; @@ -1598,6 +1601,12 @@ sub ex_map { func => substr($rhs, 1), type => C_IRSSI, }; + # does nothing + } elsif (lc $rhs eq '') { + $command = { char => '', + func => undef, + type => C_NOP, + }; # command-mode command } else { $rhs = _parse_mapping($2); @@ -2044,6 +2053,10 @@ sub handle_command_cmd { print "Processing irssi-command: $map->{char} ($cmd->{char})" if DEBUG; Irssi::command($cmd->{func}); return 1; # call _stop(); + # does nothing. + } elsif ($cmd->{type} == C_NOP) { + print "Processing : $map->{char}" if DEBUG; + return 1; # call _stop(); } # text-objects (i a) are simulated with $movement -- cgit v1.2.3