Chapter 2 Using the vi Text Editor Flashcards
Append text at the end of the current line
A
Change current word
cw
Changes current line
cc
Changes from the current cursor position to the end of the line
C
Continue the search in the opposite direction
N
Continue the search in the same direction
n
Copies the current line and the next two lines into the buffer
3yy
Foward search
/<string></string>
enter command line mode
:
Insert text left of the cursor
i
Move cursor to the beginning of the line
^ carot symbol
move cursor left to the previous word
b
move cursor to first line of the document
gg
move cursor to specific line
<line>G
</line>
Move the cursor right to the next word
w
Open a new line above the current line and start inserting text
O
Open a newline below the current line and start inserting text
o
Pastes the lines from the buffer in the line above the cursor
P
Quit vi if file has not been modified
:q
Quit vi if the file has been modified but any modifications will be lost
:q!
move down half a page
ctrl + d
write current file to disk and quit
:x
:wq
zz
Yank(copies) current line into the buffer
yy
append text to the right of the cursor
a