1

I want to assign "Go to previous word" command to cmd and "Go to beginning of the line" command to alt.

In short, I want to switch the actions of cmd and alt. Similarly for cmd and alt as well. How can I accomplish this?

  • What shell emulator? Terminal? iTerm? – willWorkForCookies Oct 3 '15 at 17:34
  • @willWorkForCookies I didn't quite understand what you mean. I want this behaviour to occur in every text field. – Utku Oct 3 '15 at 17:35
  • My bad; those are shortcuts frequently used in terminal so I made a poor assumption. – willWorkForCookies Oct 3 '15 at 17:37
  • @willWorkForCookies Actually this question did not solve my issue. I have written another one. I would be grateful if you have time to check it out. – Utku Oct 3 '15 at 17:39
2

To swap the key bindings download, install and start Karabiner.

Open the menulet Karabiner -> Preferences... in the menubar, search for arrow and enable the swapping of the two command like in the example below (FYI KeyRemap4MacBook shown in the screenshot is the predecessor of Karabiner):

enter image description here

  • By the way, this will change the behaviour for all text fields I will be editing. Is that right? – Utku Oct 3 '15 at 14:09
  • 1
    @Utku Not necessarily. If an editor uses a completely different shortcut it might fail. But I have tested it in several editors or browsers and it worked for all of them. – klanomath Oct 3 '15 at 14:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .