Thursday, June 4, 2009

Save your emacs Fingers

To save my emacs fingers, I swapped all CTRL and ALT keys in the keyboard, and also mapped the CAPS LOCK key to the ALT.

Here is the xmodmap code in my Thinkpad T41p for swapping CTRL and ALT keys.

These keycodes are system-specific. Use `xev` to find out the keycodes in your system before applying this `xmodmap` script.


!
! This is an `xmodmap' input file for
! PC 105 key, wide Delete, tall Enter (XFree86; US) keyboards.
! Automatically generated on Sat Nov 22 23:28:24 2008 by xxxxx with
! XKeyCaps 2.47; Copyright (c) 1991-1999 Jamie Zawinski; 2005-2006 Christoph Berg.
! http://www.jwz.org/xkeycaps/
!
! This file presupposes that the keyboard is in the default state, and
! may malfunction if it is not.
!
remove Lock = Caps_Lock
remove Control = Control_L Control_R
remove Mod1 = Alt_L Alt_R
remove Mod4 = Meta_L Meta_R
remove Mod5 = Scroll_Lock

keycode 0x42 = Alt_L Meta_L
keycode 0x25 = Alt_L Meta_L
keycode 0x40 = Control_L
keycode 0x71 = Control_R
keycode 0x6D = Alt_R Meta_R

add Control = Control_L Control_R
add Mod1 = Alt_R Alt_L 0x009C Alt_L Alt_R Alt_L Alt_L
add Mod4 = 0x007F 0x0080
add Mod5 = Mode_switch ISO_Level3_Shift
!
! For Mouse Swap.
!# pointer = 3 2 1 4 5


Check more tips at , http://steve.yegge.googlepages.com/effective-emacs

0 comments: