How can I change a command and cursor key bindings globally?

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?


Solution 1:

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