Vim Tips Wiki
(Replace merged tip with redirect)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
#REDIRECT [[Map caps lock to escape in Windows]]
{{TipImported
 
|id=353
 
|previous=352
 
|next=354
 
|created=October 29, 2002
 
|complexity=basic
 
|author=Jacques Petit
 
|version=5.7
 
|rating=73/27
 
|category1=
 
|category2=
 
}}
 
This will allow you to use the caps-lock key as a control key. Makes using vim in win32 much nicer in my opinion.
 
 
Place the following text into a text file with the extension *.reg and update your registry by double-clicking the file:
 
 
<pre>
 
REGEDIT4
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
 
</pre>
 
 
====How to create an undo registry file====
 
Place the following into a file called "un-caps2ctrl.reg":
 
 
<pre>
 
REGEDIT4
 
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 
</pre>
 
 
This will allow you to reverse the change by invoking the registry script. Alternatively, you can simply delete the key using the registry editor.
 
 
Note that you will probably need to reboot your machine, for this system change to take effect.
 
 
====Swapping keys rather than replacing CAPS====
 
The registry entry above sets the caps to ctrl. The following registry entry actually swaps the caps-lock and registry keys on your keyboard. Useful if you like using caps-lock from time to time.
 
 
<pre>
 
REGEDIT4
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
 
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
 
</pre>
 
 
====Setting the key layout for the current user====
 
If the machine has multiple users who might not like this new layout, consider instead of using [HKEY_LOCAL_MACHINE\....] to specifying [HKEY_CURRENT_USER\Keyboard Layout]. This will make the changes for one user account only.
 
 
 
'''This site has an explanation on what's going on here:'''
 
 
http://www.annoyances.org/exec/forum/winxp/t1004806455
 

Latest revision as of 11:51, 19 July 2009