You are working with the vi editor and writing a textfile. Which of the following commands will you
use if you want to move the cursor 3 characters to the right?
A.
3b
B.
3w
C.
3l
D.
3h
Explanation:
The 3l command in vi will move the cursor 3 characters to the right when you are in command
mode of vi editor. You can go into command mode by pressing the <escape> key.
What is the vi editor?
The vi editor is an interactive, cryptic, and screen-based text editor used to create and edit a file. It
operates in either
Input mode or Command mode. In Input mode, the vi editor accepts a keystroke as text and
displays it on the screen, whereas in Command mode, it interprets keystrokes as commands. Asthe vi editor is case sensitive, it interprets the same character or characters as different
commands, depending upon whether the user enters a lowercase or uppercase character. When a
user starts a new session with vi, he must put the editor in Input mode by pressing the “I” key. If he
is not able to see the entered text on the vi editor’s screen, it means that he has not put the editor
in
Insert mode. The user must change the editor to Input mode before entering any text so that he
can see the text he has entered.
Answer option D is incorrect. The 3h command will move the cursor 3 characters to the left.
Answer option B is incorrect. The 3w command will move the cursor forward by 3 words.
Answer option A is incorrect. The 3b command will move the cursor backward by 3 words.