Vi Flashcards
1
Q
vi filename
A
Edit file.
2
Q
vim filename
A
Same as vi, but more features.
3
Q
view filename
A
Starts vim in read-only mode.
4
Q
3 Types of Modes
A
Command Mode, Insert Mode, Line Mode
5
Q
k
A
Up one line
6
Q
j
A
Down one line
7
Q
h
A
left one character
8
Q
l
A
right one character
9
Q
w
A
right one word
10
Q
b
A
left one word
11
Q
A
go to the beginning of the line
12
Q
$
A
go to the end of the line
13
Q
i
A
insert at the cursor position
14
Q
I (this is a upper case i)
A
insert at the beginning of the line
15
Q
a
A
Append after the cursor position
16
Q
A
A
Append at the end of the line
17
Q
:w
A
writes(saves) the file
18
Q
:w!
A
forces the file to be saved
19
Q
:q
A
Quit
20
Q
:q!
A
Quit without saving changes
21
Q
:wq
A
write and quit
22
Q
:x
A
same as :wq
23
Q
:n
A
position the cursor at linen
24
Q
:$
A
position the cursor on the last line
25
:set nu
turn on line numbering
26
:set nonu
Turn off line numbering
27
:help[subcommand]
get help
28
What are the vi modes? (4 modes)
Mode=key
command=esc
insert i, a or A
line= :
29
x
delete
30
dw
delete word
31
dd
delete a line
32
D
delete from cursor position
33
r
Replace the current character
34
yy
copy the current line
35
p
Paster the most current copied text
36
u
undo
37
crtl-R
redo
38
/
start a forward search
39
?
start a reverse search