How to swap alt and ctrl on Linux for Emacs? It will be more easier to press the ctrl keys which is a very important key for Emacs.
Save this as a file modmap:
clear control
clear mod1
keycode 64 = Control_L NoSymbol Control_L
keycode 37 = Alt_L Meta_L Alt_L Meta_L
keycode 108 = Control_R NoSymbol Control_R
keycode 105 = Alt_R Meta_R Alt_R Meta_R
add mod1 = Alt_R Alt_L Meta_R Meta_L
add control = Control_R Control_L
And then run:
xmodmap modmap
If you want to make it permanent (reloaded each time you start X), save the file content to ~/.xmodmap
and add this line to your ~/.xsession
:
xmodmap ~/.xmodmap