Xshell Knowledge Base

Using number pad in VI

Last modified: Thursday, January 31, 2013 10:16 PM


This article explains how you can configure Xshell and terminal to allow entering numbers using the number pad in the vi editor.


This problem occurs when the terminal type is not set to 'vt220' or 'ansi'. To use the color feature such as the syntax highlighting feature in vi, change the terminal type to ansi.

To change the terminal type from terminal, enter one of the following commands:

$export TERM=ansi 


$setenv TERM ansi

Alternatively, you can set the terminal type in Xshell session properties. Selected terminal type will be used every time you open the session. To change the terminal type in Xshell:

1. Open the Session Properties dialog box 
2. Click on the Terminal menu. 
3. From the Terminal Type list, select 'ansi' 
4. Click OK to save the changes. 


If you want to set the terminal type for the vi editor only, you can create a script and execute it when you open vi. To do this:

First, create a script file in home directory with the following command:

$ vi $HOME/vi

Then, save the following lines:

export TERM
exec /usr/bin/vi $@

Change the permission on the file to 755:

$chmod 755 $HOME/vi

Lastly, open the login script file such as .profile.cshrc or .login and add the following line:

$alias vi='$HOME/vi'

(If you are using C Shell, use $alias vi '$HOME/vi')

affected software

All Xshell