Shared publicly  - 
 
#vim: How to remap the Esc key?

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〔☛ Programer Hand Health: vi Esc Key Syndrome#comment-1426377905〕)

if you have a special keyboard (such as the ergodox 〔☛ 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

updated at Emergency vi (vi tutorial)

and, get vimrc-mode to make your vimrc pretty:

(autoload 'vimrc-mode "vimrc-mode" "loads vimrc-mode" "INTERACTIVE")

(when (fboundp 'vimrc-mode)
  (add-to-list 'auto-mode-alist '(".vim\\(rc\\)?$" . vimrc-mode))
)

and, an interesting thing about vimrc syntax is that its comment starts with "

that's right, a single double quote at the beginning of line. I used another quote at the end of line just to make it familiar and save myself trouble of creating another css to deal with vimrc mode.

• on vi Keybinding vs Emacs Keybinding
http://ergoemacs.org/misc/on_vi_keybinding.html

• vi, vim: 3 Decades Pile of History
http://ergoemacs.org/emacs/vi_vim_pile_of_history.html

• History of Emacs & vi Keys (Keyboard Influence on Keybinding Design)
http://xahlee.info/kbd/keyboard_hardware_and_key_choices.html

• Arrow Keys Layout Efficiency: vi's {H J K L} vs Inverted T {I J K L}
http://xahlee.info/kbd/vi_hjkl_vs_inverted_t_ijkl_arrow_keys.html
Here's a keybinding design for vi. It is based on the principle that most frequently used commands be placed on the most easy-to-press keys. 〔 ErgoVim Key Mappings 2011-01-01 By Harrison Ainsworth. @ www.hxa.name…〕 At one point in my hand health crisis, i was planning to do this in emacs.
1
2
Xah Lee's profile photoRob Shinn's profile photoErgoEmacs's profile photoMarius Piedallu van Wyk's profile photo
5 comments
 
In vi,  one does not move the end of the line ($) and then do 'i'.  This demonstrates a lack of vi mastery.  There is one efficient command for the operation you are trying to perform and that is 'A', +Xah Lee.
Xah Lee
 
+Rob Shinn you are right i lack mastery of vi.

though, the situation also indicate inefficiency of vi.

A is 2 keys, involving a chord. Shift + a.
If the keys to move are all single key, let's say to end of line is 4. Then, 4i would do it, and is superior to Shift+pinky.
 
But 4i is already a command.  :)  Typing '4i*<esc>' will insert '****' at the cursor.  (That's 4 asterisks)

And 'A' isn't two keys to a touch typist.

Something you may find interesting is that I learned vi shortly (~1 year) after learning to touch type.
Add a comment...