aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode/vim_mode.pl
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-27 00:17:38 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-27 00:17:38 +0000
commit9af3812183d59b6310ce71d913426abc2013d467 (patch)
tree7f13179f4f5d2cd189a98f7c0837b346d45aebe8 /vim-mode/vim_mode.pl
parentvim_mode: Correctly implement w b e like in vi. (diff)
downloadirssi-scripts-9af3812183d59b6310ce71d913426abc2013d467.tar.gz
irssi-scripts-9af3812183d59b6310ce71d913426abc2013d467.zip
vim_mode: Add G to switch to count-th window.
Diffstat (limited to '')
-rw-r--r--vim-mode/vim_mode.pl12
1 files changed, 12 insertions, 0 deletions
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) = @_;