How to change the default shortcuts for copy/paste in urxvt?
Asked Answered
B

2

10

I'm trying to set up copy/paste actions using ctrl+shift+c/p like it is done in GNOME terminal but for urxvt. I didn't find any simple solution - it seems like it always requires scripts, hacks etc which gets me annoyed when it comes to such a basic things. That's why I'm wondering if it is possible to just change/add some entries in ~/.Xresource to move the default behavior from ctrl+alt+c/p to ctrl+shift+c/p - since the former already works as expected.

Also, there is a lot of notions regarding clipboard itself: X calls them "selections" rather than "clipboards"; there are PRIMARY and CLIPBOARD selections; etc. I don't really understand all these subtleties - so feel free to be verbose!

I use Xorg server with i3 WM if it makes sense and rxvt-unicode v9.22 - released: 2016-01-23

Billups answered 9/4, 2017 at 9:34 Comment(0)
S
-3

short: no, you can't

longer: I pointed out in Rebinding CTRL-ALT-[C|V] to CTRL-SHIFT-[C|V] in URxvt >= 9.20 that the binding for these is essentially hardcoded in urxvt without an easy way to change them (aside from external scripts or modifying the program itself).

Subcortex answered 9/4, 2017 at 10:33 Comment(1)
Please, could you provide more details on how to apply this script and finally get urxvt using the new bindings?Billups
L
31

Contrary to Thomas' answer, it looks like you can. In the same question he referenced Spencer and Enno both mention that you can bind the native eval extensions in your .Xresources file. This would look like the following:

URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard

To disable the previous keybindings, you'll also need:

URxvt.keysym.Control-Meta-c: builtin-string:
URxvt.keysym.Control-Meta-v: builtin-string:

You can reload the file with:

xrdb -load .Xresources

You'll need to restart rxvt for the changes to take effect.

Lareine answered 28/4, 2017 at 16:52 Comment(1)
I recommend to put URxvt.iso14755 : false before it. It turns off this "yellow box" at the bottom.Commercialize
S
-3

short: no, you can't

longer: I pointed out in Rebinding CTRL-ALT-[C|V] to CTRL-SHIFT-[C|V] in URxvt >= 9.20 that the binding for these is essentially hardcoded in urxvt without an easy way to change them (aside from external scripts or modifying the program itself).

Subcortex answered 9/4, 2017 at 10:33 Comment(1)
Please, could you provide more details on how to apply this script and finally get urxvt using the new bindings?Billups

© 2022 - 2024 — McMap. All rights reserved.