16.04 - How to map the keypad (NUM) keys in vim? - Ask Ubuntu


i using vim version 7.4 2012-dez-06 of ubuntu 16.04 , use putty 0.67 on w10. want map keys of num keypad in .vimrc. tried on command line in vim doesn't work:

map <k1> command map k1 command map <c-k1> command map <s-k1> command map *keypad-1* command map keypad-1 command 

if example:

map 1 dd 

it works , line deleted if hit 1.

if hit in vi num keypad buttons 1, 2, 3 ... q, r, s, t ... if map q command normal q button execute command not 1 on num keypad. .vimrc is:

# cat ~/.vimrc syntax on set t_co=256 colorscheme elflord if &diff     colorscheme apprentice endif 

h keycodes tells me:

… <khome>         anfang auf dem ziffernblock (oben links)*keypad-home* <kend>          ende auf dem ziffernblock (unten links) *keypad-end*                                                         *keypad-page-up* <kpageup>       bild rauf auf dem ziffernblock (oben rechts)                                                         *keypad-page-down* <kpagedown>     bild runter auf dem ziffernblock (unten rechts) <kplus>         + auf dem ziffernblock                  *keypad-plus* <kminus>        - auf dem ziffernblock                  *keypad-minus* <kmultiply>     * auf dem ziffernblock                  *keypad-multiply* <kdivide>       / auf dem ziffernblock                  *keypad-divide* <kenter>        enter auf dem ziffernblock              *keypad-enter* <kpoint>        dezimalzeichen auf dem ziffernblock     *keypad-point* <k0> - <k9>     0 bis 9 auf dem ziffernblock            *keypad-0* *keypad-9* <s-...>         umschalttaste                   *shift* *<s-* <c-...>         steuerungstaste                 *control* *ctrl* *<c-* <m-...>         alt-taste oder meta-taste       *meta* *alt* *<m-* <a-...>         dasselbe wie <m-...>            *<a-* <d-...>         befehlstaste (nur macintosh)    *<d-* <t_xx>          taste mit dem eintrag »xx« in der termcap 

therefore <k1> should correct.

i using putty ssh , folowing keyboard setting:

enter image description here how can map keys of numeric key pad?

the default settings of putty fine. not change in putty-> terminal -> keyboard (see above) or disable in putty-> terminal -> features anything:

enter image description here

you can map in vi num keys in following way:

inoremap <esc>oq 1 inoremap <esc>or 2 inoremap <esc>os 3 inoremap <esc>ot 4 inoremap <esc>ou 5 inoremap <esc>ov 6 inoremap <esc>ow 7 inoremap <esc>ox 8 inoremap <esc>oy 9 inoremap <esc>op 0 inoremap <esc>on . inoremap <esc>oq / inoremap <esc>or * inoremap <esc>ol + inoremap <esc>os - inoremap <esc>om <enter> 

this setting example using num key should be. of course can change mappings usual.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User