Using Mac shortcuts with XQuartz
Ever tried using XQuartz (formally X11) on your Mac to display apps from a remote Linux machine? It’s easy. When you SSH into the machine, simply use the -X parameter, and the display will forward to your screen.
ssh -X finbarr@ubuntu_machine_ip
The experience works pretty well as long as you have a fast network or are on the LAN. But there is one big problem for me…
Macs use cmd+c, cmd+v to copy paste, but Linux (and Windows) use ctrl+c, ctrl+v shortcuts for the same.
Wouldn’t it be great if all XQuartz apps had the keys remapped to issue ctrl when cmd is pressed. Well you can! Simply create a file in your home directory called .Xmodmap with the following contents:
! ~/.Xmodmap
clear Mod2
clear control
keycode 63 = Control_L
keycode 67 = Control_L
keycode 71 = Control_L
add control = Control_L
Now just restart XQuartz if you had it open, and viola, you can now use cmd+c and cmd+v like you are used to!