Keyboard Shortcuts – How to Copy/Paste with Keyboard in rxvt

keyboard shortcutsrxvt

I know that I can copy and paste text in rxvt by using the middle mouse button, but I was wondering if there was a way to define keyboard-shortcuts in the .Xdefaults for copy and pasting text.

Moreover it would be really awesome if it would be possible to select the text with the keyboard as well.

EDIT:

Trying to use urxvt-perls does not seem to work (maybe because of the zsh-VI-bindings?). When I try running the script from the command line I also get the following errors:

% perl keyboard-select 
Bareword "urxvt::ControlMask" not allowed while "strict subs" in use at keyboard-select line 137.
Bareword "urxvt::ControlMask" not allowed while "strict subs" in use at keyboard-select line 151.
Execution of keyboard-select aborted due to compilation errors.

Unfortunately I know nothing about a perl and have no idea if this is anyhow related to it not working in urxvt itself.strong text

Best Answer

You can use urxvt-perls to enable keyboards shortcuts for copy and paste in urxvt.

Place the required scripts in /usr/lib/urxvt/perl/ and add these lines to your .X{resources,defaults}:

URxvt.perl-ext-common: ...,keyboard-select
URxvt.keysym.M-Escape: perl:keyboard-select:activate
Related Question