aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-09-26 21:58:24 +0000
committerSimon Ruderich <simon@ruderich.org>2010-09-26 21:58:44 +0000
commit38da5ad415df8010ebcbbcf77ed0bd8f77785d08 (patch)
tree078824e235f6d04684451d68e993a0e3d57eac6d /vim-mode
parentMerge remote branch 'origin/dev' (diff)
downloadirssi-scripts-38da5ad415df8010ebcbbcf77ed0bd8f77785d08.tar.gz
irssi-scripts-38da5ad415df8010ebcbbcf77ed0bd8f77785d08.zip
vim_mode: Add r.
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 8deb7ed..574fd9b 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -8,6 +8,7 @@
# * cursor word motion with: w b e W B E
# * change/delete: c d C D
# * delete at cursor: x
+# * replace at cursor: r
# * Insert mode at pos: i a
# * Insert mode at start: I
# * insert mode at end: A
@@ -180,6 +181,8 @@ my $movements
'I' => { func => \&cmd_movement_I },
'a' => { func => \&cmd_movement_a },
'A' => { func => \&cmd_movement_A },
+ # replace mode
+ 'r' => { func => \&cmd_movement_r },
# paste
'p' => { func => \&cmd_movement_p },
'P' => { func => \&cmd_movement_P },
@@ -202,6 +205,7 @@ my $movements_multiple =
't' => undef,
'F' => undef,
'T' => undef,
+ 'r' => undef,
};
@@ -498,6 +502,15 @@ sub cmd_movement_A {
_update_mode(M_INS);
}
+sub cmd_movement_r {
+ my ($count, $pos, $char) = @_;
+
+ my $input = _input();
+ substr $input, $pos, 1, $char;
+ _input($input);
+ _input_pos($pos);
+}
+
sub cmd_movement_p {
my ($count, $pos) = @_;
_paste_at_position($count, $pos + 1);