Reassigning the caps lock key on Windows or OS X

You need Autohotkey and this script:

;Deactive CapsLock key 
$CapsLock:: 
return

Autohotkey is THE most powerful way to do this sort of thing on a WIndows PC. Also see this page for more details on re-mapping CAPS,


I've used SharpKeys (for windows) to remap CapsLock to ESC.

Works great for vim. VI-style editing really shines if you can keep your fingers near the home row at all times.


Here's how to swap the Caps Lock key with left Ctrl:

Windows

  1. Click Start > Run
  2. Type "regedit"
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
  4. While Keyboard Layout has focus, go to Edit > New > Binary Value
  5. Enter "Scancode Map" as the name
  6. Enter the following as the Data:

    0000: 00 00 00 00 00 00 00 00
    0008: 03 00 00 00 3A 00 1D 00
    0010: 1D 00 3A 00 00 00 00 00
    
  7. Exit the Registry Editor

  8. Log out and log back into Windows

Linux

  1. Create a file in your home directory called .xmodmap if it doesn't already exist
  2. Paste the following lines into the file:

    remove Lock = Caps_Lock
    remove Control = Control_L
    keysym Control_L = Caps_Lock
    keysym Caps_Lock = Control_L
    add Lock = Caps_Lock
    add Control = Control_L
    
  3. Add the following line into ~/.bash_profile

    xmodmap ~/.xmodmap
    

Source