Skip to content

Instantly share code, notes, and snippets.

@zenglian
Last active August 30, 2018 05:45
Show Gist options
  • Save zenglian/cc529a78d552cb4bf114de13a4c227b9 to your computer and use it in GitHub Desktop.
Save zenglian/cc529a78d552cb4bf114de13a4c227b9 to your computer and use it in GitHub Desktop.
Optimize Keyboard Layout for Developers

Optimize Keyboard Layout for Developers

Design

For most people, " is much more frequently used than '.
For most developers,Esc is much more frequently used than Caps Lock.
For programmers of Java/JavaScript/C/C++/C# etc, {/} is more frequently used than [/].

So it's not bad to swap them.

Configuration

Linux

Note the first letter of the file name must be upper case. Ohterwise it does not work after reboot. See more info of xmodmap

xmodmap -pke > ~/.Xmodmap
cp ~/.Xmodmap ~/.Xmodmap.bak
vim ~/.Xmodmap      			
xmodmap ~/.Xmodmap 			

~/.Xmodmap (only modified lines, the 2nd column shift+key)


...
keycode  34 = braceleft bracketleft braceleft bracketleft
keycode  35 = braceright bracketright braceright bracketright
...
keycode  48 = quotedbl apostrophe quotedbl apostrophe
...
keycode 254 =
keycode 255 =

! Swap Caps Lock and Esc
! remove Lock = Caps_Lock
! keysym Escape = Caps_Lock
! keysym Caps_Lock = Escape
! add Lock = Caps_Lock
                                                              

Windows

Use Keytweak and Keyboard Layout Manager.

Practice

I used this layout for several years. It's easy to get familiar with it. You can buy sticky paper note and override the chars on these keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment