Vi Flashcards

1
Q

vi filename

A

Edit file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

vim filename

A

Same as vi, but more features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

view filename

A

Starts vim in read-only mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

3 Types of Modes

A

Command Mode, Insert Mode, Line Mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

k

A

Up one line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

j

A

Down one line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

h

A

left one character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

l

A

right one character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

w

A

right one word

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

b

A

left one word

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A

go to the beginning of the line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

$

A

go to the end of the line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

i

A

insert at the cursor position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

I (this is a upper case i)

A

insert at the beginning of the line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

a

A

Append after the cursor position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

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