Please enable JavaScript.
Coggle requires JavaScript to display documents.
The vi Editor (Cursor Move Commands (h, <= , Backspace (l, => ,…
The
vi
Editor
Add Text Commands
i
Inserts text before the current character
I
Inserts text at the beginning of the current line
a
Appends text after the current character
A
Appends text at the end of the current line.
o
Opens an empty text line for new text after the current line
O
Opens an empty text line for new text before the current line
Cursor Move Commands
h, <= , Backspace
Moves the cursor one character to the left
l, => , Spacebar
Moves the cursor one character to the right
0
Moves the cursor to the beginning of the current line
$
Moves the cursor to the end of the current line
k, up arrow
Moves the cursor one line up
j, down arrow
Moves the cursor one line down
-
Moves the cursor to the beginning of the previous line
+, return
Moves the cursor to the beginning of the next line
Deleting Text
x
Deletes the current character
dd
Deletes the current line
Join
J
Joins two consecutive lines
Scrolling
ctrl+y
Scrolls up one line
ctrl+e
Scrolls down one line
ctrl+u
Scrolls up half a screen
ctrl+d
Scrolls down half a screen
ctrl+f
Scrolls down whole screen
ctrl+b
Scrolls up whole screen
Undo
u
Undoes only the last edit
U
Undoes all changes on the current line
Saving and Quitting
:w
Saves buffer contents to original file and continues
:w filename
Saves buffer contents to filename and continues
:wq , ZZ
Saves the contents of the buffer and exits
:q
Quits if contents have not been changed
:q!
Exits vi without saving
Prepared by:
Srinivas Adapa
, Associate Professor, CSE Department, CITM