In order to work correctly the vi need correct terminal type (TERM) setting .The TERM setting depends on the type of terminal you have . Commonly used TERM types are vt100 , vt220 and ansi . In most cases vt100 will work fine . In case vi is not able to understand the TERM you have given, it starts in open mode giving you a line by line display .

Generally TERM is taken from .profile or /etc/profile but can be set at the command line as :

i. ) Command Mode : After a file is opened it is opened in command mode ,that is , input from the keyboard will be treated as vi commands and you will not see the words you are typing on the screen .

ii.) Insert Mode: To enter the text you have to put vi in insert by pressing ‘i’ or ‘a’ after which you can add the text and whatever is being type will be seen on the screen. . To switch between these mode Esc key is used . Esc i (text mode) Esc (command mode)