Created
May 3, 2011 14:03
-
-
Save denlab/953372 to your computer and use it in GitHub Desktop.
Keyboard remapping for easier Emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------ | |
# A few key remapping on GNU/Linux, for easier Emacs. | |
# | |
# Note: You need a querty keyboard in the first place because it removes the alt-gr key. | |
# | |
# Replace : | |
# - capslock by ctrl | |
# - altgr by alt | |
# | |
# To have an alt on the right and an easier ctrl on the left. | |
# For a much better Emacs experience. | |
# ------------------------------------------------------------------------------ | |
if [[ $(xmodmap) == *ISO_Level3_Shift* ]] | |
then | |
echo "xmodmap not customized !"; | |
# ------------------------------------------------------------------------------ | |
# Keyboard customization : replace caps lock by control | |
# ------------------------------------------------------------------------------ | |
echo " replacing capsLocks by control ...."; | |
xmodmap -e 'remove Lock = Caps_Lock' | |
xmodmap -e 'keysym Caps_Lock = Control_L' | |
xmodmap -e 'add Control = Control_L' | |
# ------------------------------------------------------------------------------ | |
# Keyboard customization : replace altgr by alt | |
# ------------------------------------------------------------------------------ | |
echo " replacing altgr by leftAlt ...."; | |
xmodmap -e 'clear mod5' | |
xmodmap -e 'add mod1 = Mode_switch' | |
xmodmap -e "keysym ISO_Level3_Shift = Alt_L" | |
else | |
echo "xmodmap already customized !"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment