Perform basic file editing operations using vi Flashcards
What are the three modes of vi?
Command: Ex: Insert:
What is the purpose of the Command mode?
Accepting instructions for editing
What is the purpose of the Ex mode?
Manipulate files - saving, exiting etc
What is the purpose of the Insert mode?
Edit text in the file
What key sequence will yank lines?
yy
What key will paste?
p
What keys enter vi into the insert mode?
a or i
What Key enters vi into the replace mode?
R
What key strokes quit and save a file in vi?
:wq
What key will change the case of a letter?
~
What key will undo a change?
u
What key will open a new line below the current one?
o
What key returns to the command mode?
ESC
What key searches forward in a file?
/
What key searches backwards in a file?
?
What command changes a word?
cw
What command changes an entire line?
cc
What command deletes an entire line?
dd
What command deletes a word?
dw
What key defines a line to go to?
G
What keystrokes globally replace strings?
:%s/find/replace
What is the equivalent on :wq?
ZZ
What is an external command run in vi?
:!
What command will create and load a new file for editing?
:e
What are the four letters as cursor keys?
hjkl