Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Through the day I work on both a Mac and Ubuntu.
What's the best option for mapping the Mac keyboard (an external, non-Mac one) to Ubuntu style keys - when using the Mac (OS X).

Basically I want to have:

Control on keyboard to trigger Command ⌘ keystroke on the Mac
Alt on keyboard to trigger Option ⌥ keystroke on the Mac
Windows on keyboard key to trigger Command ⌘ keystroke on the Mac

Aside from whether this is a good idea or not and which one I should pick, I am just posing the question of how to make the Mac, when used with the external keyboard, to be more Ubuntu-like. My biggest interest is in making sure that vi/vim/macvim and tmux, both of which have a large number of keyboard commands, work the same for my fingers.

I initially thought about this posting on Ask Ubuntu but it actually seems more suitable here.

share|improve this question
How do you intend to trigger a <kbd>Control ⌃</kbd> keystroke on the Mac? –  CajunLuke Jun 28 '12 at 0:51
I don't understand your concern. Other than remapping the control/command/alt/etc (modifiers), what else is different in Ubuntu? I mean, Cmd+S(ave) is going to be Control+S(ave) on Ubuntu… which is the same. Control+Tab (cmd+tab Mac)… etc. Both OS's have similar shortcuts (which you can redefine under Mac anyway). <puzzled> I use vi on a Mac (and vim) and sometimes under Linux and they are exactly the same… –  Martín Marconcini Jun 28 '12 at 0:54
Mac's not handy, I can check in a bit. –  Michael Durrant Jun 28 '12 at 1:00
I'd say that the "biggest" difference between LInux/Windows and Mac is the CMD key being the centerpiece (instead of Control), which you should swap. Option is Alt and Windows Key is Command. But There's no "Mac" key (like Windows Key) on Mac (or "Linux" key under Linux) so by swapping Cmd<->Control you're pretty much there. Instead of CMD+C to copy, you'd press Control-C (like LInux) and the OS will be doing a CMD+C. :) Other than that… I don't see a huge difference. –  Martín Marconcini Jun 28 '12 at 1:01
@ephsmith That sounds good ! –  Michael Durrant Jun 28 '12 at 1:05

1 Answer 1

up vote 3 down vote accepted

Ok, what you want to do is remap your modifiers:

Go to System Preferences and select Modifier Keys:


Then swap Cmd and Control.


note: in the shot they are not swapped

For reference, I do this with an external Razer Blackwidow for Windows (I want it to be like my Mac keyboard because I've been using Mac keyboards for 10 years).

share|improve this answer
Yes this works well for me. I like the fact that I have the choice and am applying it to my external keyboards only so my colleagues are not freaked out when they use the mac keyboard temporarily ! –  Michael Durrant Jul 9 '12 at 2:10
+1 for the diagrams they are helpful ! –  Michael Durrant Jul 9 '12 at 2:12
What do you do when you have a VM which inherits those Modifier changes, so when you go do CTRL+C in your VM it does CMD+C?.. –  George Katsanos Sep 3 at 20:08
@GeorgeKatsanos I am not sure exactly what you mean, but the host OS determines what the action is. In the case of VMWare and Parallels, their drivers used to be "clever enough" to do the right thing (i.e.: cmd+C would do copy in the virtual OS too). But I haven't used either in a long time! –  Martín Marconcini Sep 3 at 22:36
I used the key modifier settings in OSX to swap command and control, this way I can do ctrl+c for copy etc (like windows)(habits), the result was that my ubuntu VM now sees my control function attached not to the control key but to the windows duper key (so basically the keys in ubuntu also swapped). –  George Katsanos Sep 4 at 5:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.