You are not logged in.

#1 2012-09-02 09:04:12

rubik
Member
Registered: 2012-03-23
Posts: 104

[SOLVED] Disabling URxvt Ctrl + Arrow keys shortcut

I'm so used with that shortcut in Vim to jump between words that I'd like to disable that in URxvt tabbed plugin, where it is mapped to switch tabs positions. Since I don't need this feature, I'd like to disable it.

Looking inside /usr/lib/urxvt/perl/tabbed I found this code:

sub tab_key_press {
   my ($self, $tab, $event, $keysym, $str) = @_;

   if ($event->{state} & urxvt::ShiftMask) {
      if ($keysym == 0xff51 || $keysym == 0xff53) {
         my ($idx) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };

         --$idx if $keysym == 0xff51;
         ++$idx if $keysym == 0xff53;

         $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);

         return 1;
      } elsif ($keysym == 0xff54) {
         $self->new_tab;

         return 1;
      }
   }
   #elsif ($event->{state} & urxvt::ControlMask) {
      #if ($keysym == 0xff51 || $keysym == 0xff53) {
         #my ($idx1) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
         #my  $idx2  = ($idx1 + ($keysym == 0xff51 ? -1 : +1)) % @{ $self->{tabs} };

         #($self->{tabs}[$idx1], $self->{tabs}[$idx2]) =
            #($self->{tabs}[$idx2], $self->{tabs}[$idx1]);

         #$self->make_current ($self->{tabs}[$idx2]);

         #return 1;
      #}
   }

   ()
}

I commented out the relevant part and now pressing Ctrl-Arrow key does not switch tab position anymore. However, it still does not work into Vim: it prints "c" every time I press the shortcut.

Is this solvable?

Thanks.

Last edited by rubik (2012-09-02 09:26:14)

Offline

#2 2012-09-02 09:17:44

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: [SOLVED] Disabling URxvt Ctrl + Arrow keys shortcut

Check if this works for you (at least as controlling vim itself is concerned). IIRC, you can re-assign tabbed keystrokes in .Xresources.

Last edited by bohoomil (2012-09-02 09:18:58)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2012-09-02 09:25:03

rubik
Member
Registered: 2012-03-23
Posts: 104

Re: [SOLVED] Disabling URxvt Ctrl + Arrow keys shortcut

Wow so quick! Awesome it worked with these:

URxvt.keysym.Control-Up:     \033[1;5A
URxvt.keysym.Control-Down:   \033[1;5B
URxvt.keysym.Control-Left:   \033[1;5D
URxvt.keysym.Control-Right:  \033[1;5C

Last edited by rubik (2012-09-02 09:25:56)

Offline

Board footer

Powered by FluxBB