VI commands Flashcards
(43 cards)
:set nu
gives line number
:1.14 co 5
copies line 1-14 at line number 5
o
inserts a line
G
last line of the file
dd or (ndd, dw, dnw, d, db, D)
removes a line (delete n lines) delete word
x
removes a character
:g/word to replace/s/word to replace /new word/g
global replace of a word
p and P
Put general buffer after (before) cursor
yy or Y
Yank (copy) line to general buffer
“z6yy
Yank 6 lines to buffer z
yw
Yank work to general buffer
“a9dd
Delete 9 lines to buffer a
“A9dd
Delete 9 lines: Append to buffer a
“ap
Put text from buffer a after cursor
J
Join lines
a
append after cursor
i
insert before cursor
o
Open line below
O
Open line above
:r
file Insert file after current line
cw
Change word (Esc)
cc
Change line (Esc) - blanks line
c$
Change to end of line
rc
Replace character with c