Pt. 2 Ch. 12 A Gentle Introduction to vi Flashcards
What’s the second most import thing to learn about vi?
It is a modal editor
When vi starts, it begins in what mode
Command mode
How do you exit vi?
:q
How do you enter insert mode in vi?
i
How do you exit insert mode and return to command mode in vi?
Esc
How do we save the change we just made to our file in vi?
an ex command such as :
How do we write our modified file in vi?
follow the colon with a w and then press enter
How can you undo the last change that you made in vi in command mode?
u
How do we append a text in vi?
a
How are the two ways we can insert a text by “opening a line”?
o the line below the current line
O the line above the current line
In vi what command deletes the current character?
x
in vi what deletes the current character and the next two characters?
3x
in Vi what deletes the current line?
dd
in vi what deletes the current line and the next four lines?
5dd
in vi what deletes from the current cursor position to the beginning of the next word?
dW
in vi what deletes from the current cursor location to the end of the current line?
d$
in vi what deletes from the current cursor location to the beginning of the line?
d0
in vi what deletes from the current cursor location to the first non-whitespace character in the line?
d^