vi - A Full Screen Text Editor
(Page 3 of 4)
With Vim in Linux, the arrow keys will move the cursor around the screen. Entering a number before depressing the arrow key will cause arrow key to be repeated that many times. So 5-left arrows would move the cursor five spaces to the left. When the vi was written, terminals at that point in time did not have arrow keys (or a mouse either) so the h, j, k and l keys work just like the arrow keys as shown by table X. To maintain compatibility with the original version of vi, vim also supports this functionality of those keys when in the command mode, in insert modes those keys merely enter the character associated with each key.
There are several commands, which will move the cursor around the file. Learning these commands will speed your ability to move around the file under edit and in the non graphical interface. Individual keys can move you from the beginning of the file to the middle of file to the end of the file or to the top of the screen to the middle of screen or to the bottom a screen.
There are several insert modes within vi, however, only four of them will be dealt with here: In command mode and pressing i will start insert mode immediately under the cursor. Text can then be entered as necessary.
Insert mode is terminated by pressing <esc> and the editor will return to command mode.
Append mode is entered the by pressing the a key, which will start text entry at the character position immediately following the cursor.
Two other important insert modes are what are known as open modes which are the o and the O keys. The lowercase o will cause an empty line to be inserted immediately below or after the current line, the cursor will be moved to the beginning of that line and text entry will start there. The uppercase O will open an empty line above or before the current line and start text entry at the beginning of this line. Again all insert modes can be exited by pressing the <esc> key to return to command mode.
Home - Table Of Contents - Contact Us
CertiGuide to A+ (A+ 4 Real) (http://www.CertiGuide.com/apfr/) on CertiGuide.com
Version 1.0 - Version Date: March 29, 2005
Adapted with permission from a work created by Tcat Houser et al.
CertiGuide.com Version © Copyright 2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.