OSX Style Keymap: Swapping WIN and ALT keys on Ubuntu to act as ALT and META keys (respectively)
I’m 100% lost without the Rubymine keymap for OS X. (Not ‘Default for OS X’, but ‘OS X’). This is available on the Ubuntu version, however, my keymap out of the box was not supported. By default, my left ALT key sends ‘left ALT’, and my Win key sends ‘Win’ (which, yes, is pretty sensible). I wanted my left ALT key to send ‘Meta’ (essentially ‘Command’), and my left Win key to send ALT. After tweaking with xmodmap for about an hour, I finally came up with an .Xmodmap file that does what I want (just drop this in your user dir — note the case-sensitivity — and Ubuntu should prompt you to load it automatically next time you login):
clear mod1
clear mod4
keycode 133 = Alt_L
keycode 64 = Meta_L
add mod1 = Alt_L
add mod4 = Meta_L
I probably need to remap all the keys to be more mac-y (IE, copy on META+C, instead of CTRL + C), but at least the Rubymine keymap seems to be acting mostly as I’d expect.