I am trying to create custom keybindings in Xterm that will allow me to copy and paste text from/to the X11 clipboard. I am currently able to paste from the clipboard using the default Shift + Insert
(after adding XTerm*selectToClipboard: true
in my ~/.Xresources file) but this is awkward on my keyboard and I would like something else. My terminal has Vi keybindings and I would like to bind p
in command mode to paste and y
to yank/copy. I tried adding this to ~/.Xresources and reloading with xrdb -merge ~/.Xresources
:
!! New copy, paste
XTerm*VT100*translations: #override \n\
p: insert-selection(CLIPBOARD) \n\
y: select-end(CLIPBOARD)
... but it doesn't work. Any ideas how I can fix this?