The following script allows you to switch Vim to a special "VimLock" mode (like pressing the Num Lock key). In this mode, pressing keys on the home row (a, s, d, ...) will generate digits (1, 2, 3, ...) rather than letters. Press Escape to exit from VimLock mode. Put the following in your vimrc: Now you can press Ctrl-i to enter insert mode and map the keys "a s d f g h j k l ;" to the digits "1 2 3 4 5 6 7 8 9 0". Pressing Esc will end this mode and restore the letter keys. Since Ctrl-i is Tab, you can just press the Tab key to enter VimLock mode.
Attributes | Values |
---|
rdfs:label
| - VimLock mode to enter numbers
|
rdfs:comment
| - The following script allows you to switch Vim to a special "VimLock" mode (like pressing the Num Lock key). In this mode, pressing keys on the home row (a, s, d, ...) will generate digits (1, 2, 3, ...) rather than letters. Press Escape to exit from VimLock mode. Put the following in your vimrc: Now you can press Ctrl-i to enter insert mode and map the keys "a s d f g h j k l ;" to the digits "1 2 3 4 5 6 7 8 9 0". Pressing Esc will end this mode and restore the letter keys. Since Ctrl-i is Tab, you can just press the Tab key to enter VimLock mode.
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Author
| |
Subpage
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
abstract
| - The following script allows you to switch Vim to a special "VimLock" mode (like pressing the Num Lock key). In this mode, pressing keys on the home row (a, s, d, ...) will generate digits (1, 2, 3, ...) rather than letters. Press Escape to exit from VimLock mode. Put the following in your vimrc: nnoremap :call VimLock(1)i function! VimLock(enable) if a:enable inoremap a 1 inoremap s 2 inoremap d 3 inoremap f 4 inoremap g 5 inoremap h 6 inoremap j 7 inoremap k 8 inoremap l 9 inoremap ; 0 inoremap :call VimLock(0) else iunmap a iunmap s iunmap d iunmap f iunmap g iunmap h iunmap j iunmap k iunmap l iunmap ; iunmap endif endfunction Now you can press Ctrl-i to enter insert mode and map the keys "a s d f g h j k l ;" to the digits "1 2 3 4 5 6 7 8 9 0". Pressing Esc will end this mode and restore the letter keys. Since Ctrl-i is Tab, you can just press the Tab key to enter VimLock mode. The mappings assume a QWERTY US keyboard where the ; key is on the right of L. If necessary, change ; to suit your keyboard.
|