Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using numpad in Vi (Vim) via PuTTY

Tags:

vim

putty

People also ask

Why does PuTTY not recognize input from the numeric keypad?

If PuTTY appears not to recognize input from the numeric keypad, disabling Application Keypad mode will sometimes resolve the problem: Click the PuTTY icon in the upper-left corner of the window. From the drop-down menu, click Change Settings. Click Terminal, and then click Features.

How do I use numpad commands without numpad?

To activate the number pad, find the number lock key (usually labeled NumLock, Num Lk, or Num). After locating it, look for the Fn or Alt key. If either the Fn or Alt key's color matches the alternate numbers, press it in conjunction with the number lock key.

How do I open a numpad virtual machine?

Open On-Screen Keyboard by clicking the Start button, clicking All Programs, clicking Accessories, clicking Ease of Access, and then clicking On-Screen Keyboard. Click Options, select the Turn on numeric key pad check box, and then click OK.


The answer is in Numpad in PuTTY while using vi [Cialug]:

In the configuration, go to Terminal->Features and check "Disable application keypad mode". Save the settings and enjoy a numeric pad that works!


I have always used this set of mappings to interpret the escape sequences as numbers when $TERM=xterm

imap <Esc>Oq 1
imap <Esc>Or 2
imap <Esc>Os 3
imap <Esc>Ot 4
imap <Esc>Ou 5
imap <Esc>Ov 6
imap <Esc>Ow 7
imap <Esc>Ox 8
imap <Esc>Oy 9
imap <Esc>Op 0
imap <Esc>On .
imap <Esc>OR *
imap <Esc>OQ /
imap <Esc>Ol +
imap <Esc>OS -

I think this was my original source.


And for Mac, the answer is in a comment by HaPsantran on this same page and there is a similar answer by nfechner with German screenshots in this answer.

For Mac, go to your Terminal application. Select Preferences, Profiles, Advanced and deselect Allow VT100 application keypad mode.

enter image description here


If using SSH through a terminal you can just go to

Edit -> Num Lock (third from bottom)

It needs to have a checkmark to the left of it.


The previous answers by kirby, michael-berkowski, and pykler are great.

I had this issue in Vim on macOS's terminal. Checking TerminalPreferencesProfilesKeyboard showed that "Clear (Keypad)" was mapped to "Num Lock". Pressing clear fixed the issue for me.