Getting numbers from Numeric keypad in VIM

Solving the problem by avoiding it :-)    

When you use vim via putty to a Linux system, the numeric keypad does not produce numbers.

Instead the keys are available to be programmed via the :map command.

 

Rather than going through all that, and being unsuccessful at finding someone else's :map commands, I  realized that if vim did not know about the numeric keypad, it could not put it into VT100 Application mode.

 

So first I check what the current setting of the environment variable TERM is via:

 

 

 

 



prompt$ echo $TERM
xterm
prompt$


and now we set the environment variable TERM and export it to subprocesses via
prompt$ export TERM=ansi
prompt$ echo $TERM
ansi
prompt$ 

 

 


and now you can edit you file in vim.

 


 


Another method for getting numbers in VIM with PUTTY

Tim Powell suggests another way to get the numeric keypad to work with VI or VIM is:

 

From: Powell, Tim 

Date: Nov 3, 2006 9:49 AM

Subject: Getting numbers from Numeric keypad in VIM


I happened to see your post while looking for a solution to the number problem. I believe I found a better one:

You need to configure PuTTY to ignore the application keypad mode. Go to settings, terminal, features and check the checkbox labeled "Disable application keypad mode". When you hit apply, you'll be able to type numbers with the keypad in vim if numlock is set. If Num Lock is off, you'll get cursor movement keys.

Enjoy! 

Tim 


You can check out Tim Powell's   vi/vim cheatsheet at http://worldtimzone.com/res/vi.html

 

Reversing line order in ed/vi/vim/gvim     a.k.a. Shameless self-prompotion :-)

In VIM/GVIM/CREAM, if you go: :help 12.4  

you will see the help on "Reverse line order". This explains using the :g/^/m0 command to reverse the lines in a file. This is a trick I've been using since UNIX ed days.  Bram Moolenaar was nice enought to include it in the "Clever tricks" sections of usr_12.txt