I saw the vim wiki tips and it says that in order to remap Esc to CAPS LOCK you have to edit the following windows code:
REGEDIT4 [HKEY_CURRENT_USER\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00
Is it possible to remap Esc to CAPS LOCK by only adding or modifying lines in the _vimrc?
If you use Vim in a terminal, simply press alt/meta+normal_mode_key. Most terminals send an escape character followed by the normal_mode_key that you pressed, removing the need to press escape yourself. Thus in insert mode pressing alt+h alt+j alt+k alt+l all take you to normal mode and move in the expected direction.
vim - Software Caps Lock : vim online. This plugin enables a software caps lock. This is advantageous over a regular caps lock in that normal mode commands, other buffers, and other applications are unaffected. The default mapping is <C-G>c but if you use this feature regularly, you will probably want a shorter one.
I recommend that you use AutoHotkey for this.
You can do a per-application hotkey change:
SetTitleMatchMode,2 #IfWinActive,VIM CAPSLOCK::ESC return #IfWinActive CAPSLOCK::CTRL return
This script, for example sets caps to escape in vim, and control everywhere else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With