From be9175c54d0345eb53ca0ae4c1e4203b6a9efe7f Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 26 Sep 2010 17:51:31 +0200 Subject: vim_mode: Add ~. --- vim-mode/vim_mode.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 621cc4b..e372050 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -11,6 +11,7 @@ # * Insert mode at start: I # * insert mode at end: A # * yank and paste: y p P +# * switch case: ~ # * Combinations like in Vi, e.g. d5fx # Installation: @@ -149,6 +150,8 @@ my $movements # paste 'p' => { func => \&cmd_movement_p }, 'P' => { func => \&cmd_movement_P }, + # misc + '~' => { func => \&cmd_movement_tilde }, }; # special movements which take an additional key @@ -433,6 +436,18 @@ sub _paste_at_position { _input_pos($pos - 1 + length $string); } +sub cmd_movement_tilde { + my ($count, $pos) = @_; + + my $input = _input(); + my $string = substr $input, $pos, $count; + $string =~ tr/a-zA-Z/A-Za-z/; + substr $input, $pos, $count, $string; + + _input($input); + _input_pos($pos + $count); +} + sub cmd_ex_command { my $arg_str = join '', @ex_buf; if ($arg_str =~ m|s/(.+)/(.*)/([ig]*)|) { -- cgit v1.2.3