Vim: Remap Escape Key
How to make Caps Lock key do Escape key?
You can't do this with vim or emacs, because the CapsLock is not seen at software applications layer.
Use Operating System's keymap mechanism to make CapsLock send Esc.
For Linux, see:
for Mac:
for Microsoft Windows:
Or, buy a programable keyboards with onboard memory
How to make vim use some other key to do Escape?
Create a file at ~/.vimrc, and put the following
"make jj do esc" inoremap jj <Esc> "make esc do nothing" inoremap <Esc> <Nop>
this will make 【jj】 do Esc, and disable the Esc key. (thanks to 00Davo〔see Programer Hand Health: vi Esc Key Syndrome#comment-1426377905〕)
if you have a special keyboard (such as the ergodox 〔see Ergonomic Keyboards〕 ) where the {Home, End} keys are right under your thumbs, then you can make them do command mode and insert mode, like this:
"make home key do esc when in insertion mode" :imap <Home> <Esc> "make end key go to insertion mode, when in command mode" :map <End> i "turn on line numbering" :set number
in vim, how to find what a key does? (in emacs its “describe-key”.)
Type :help key to show it in help.
Type :map key to show customized key in command mode . (that is, defined in init file.)
Type :imap key to show customized key in insert mode . (that is, defined in init file.)
on vi vim text editor
- Emergency vim Tutorial
- Vim: Remap Escape Key
- on vi Keybinding vs Emacs Keybinding (2013)
- Programer Hand Pain. vim Escape Key Syndrome (2010)
- History of vi Keys
- Interview with Bill Joy (creator of vi), 1984.
- History of Key Shortcuts: Emacs, vim, WASD
- Arrow Keys. vim HJKL vs Inverted T
- Design of vim Mode Activation Key
- Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++) (2010)
- Vim Keybinding, 30 Years Pile of Shit (2014)
- Ubuntu Linux. vim Location and Versions
- Linux: Ctrl+s Freeze vim
- Microsoft Clippy in Vim