From 9af3812183d59b6310ce71d913426abc2013d467 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 27 Sep 2010 02:17:38 +0200 Subject: vim_mode: Add G to switch to count-th window. --- vim-mode/vim_mode.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 6dabbb7..63ef6c1 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -17,6 +17,7 @@ # * repeat change: . # * change/change/yank line: cc dd yy S # * Combinations like in Vi, e.g. d5fx +# * goto window: 5G # # TODO: # * /,?,n to search through history (like history_search.pl) @@ -194,6 +195,8 @@ my $movements # to end of line 'C' => { func => \&cmd_movement_dollar }, 'D' => { func => \&cmd_movement_dollar }, + # change window + 'G' => { func => \&cmd_movement_G }, # misc '~' => { func => \&cmd_movement_tilde }, '.' => {}, @@ -595,6 +598,15 @@ sub _paste_at_position { _input_pos($pos - 1 + length $string); } +sub cmd_movement_G { + my ($count, $pos) = @_; + + my $window = Irssi::window_find_refnum($count); + if ($window) { + $window->set_active(); + } +} + sub cmd_movement_tilde { my ($count, $pos) = @_; -- cgit v1.2.3