Can I use CMD-C
and CMD-V
to trigger the X11 clipboard functionality?
I do not want to remap CMD
to send CTRL
. This is not just about ergonomics and muscle memory. Existing answers seem to ignore the fact that ^C
is a valid, useful character with its own meaning to lots of programs. I want to bind window manager commands (like copy/paste) to key combinations that don't already have decades-old conventions associated with them in popular programs, like Vim and Emacs. Something like CMD-C
.
I want my CTRL
key to keep doing what it was designed to do.
CTRL-C
should continue to send an^c
character to my terminal to kill processesCTRL-V
should continue to send a^v
character (the escape sequence in Vim)CTRL-X
should continue to send a^x
character (vim's key for "subtractcount
from number under cursor)
I want to use the CMD
key to send commands to my window manager:
CMD-C
should set the highlighted text/object to the X11CLIPBOARD
selection.CMD-V
should paste from the X11CLIPBOARD
buffer -no matter what is in there-- into the active target, likeCTL-V
or Edit->Paste does by default in almost every X application.
MacOS does system-wide shortcuts really well. It took some muscle memory adjustment, but now that I've realized that I can send actual control characters to my applications, I can't ever go back.
Can I configure my linux box to do the same thing, at least for copy & paste? The biggest sticking point is that CTRL-C
/CTRL-V
for copy/paste conflicts with vim keybindings, but generally I'd like to separate terminal control characters from window-manager command sequences.
There's a bit of useful documentation on Jamie Zawinski's site on the underlying mechanisms for how X11 handles copy/paste buffers. This is exactly the functionality I want to directly control with my keyboard. How do I configure it?