Perform basic file editing operations using vi Flashcards

1
Q

What are the three modes of vi?

A

Command: Ex: Insert:

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

What is the purpose of the Command mode?

A

Accepting instructions for editing

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

What is the purpose of the Ex mode?

A

Manipulate files - saving, exiting etc

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

What is the purpose of the Insert mode?

A

Edit text in the file

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

What key sequence will yank lines?

A

yy

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

What key will paste?

A

p

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

What keys enter vi into the insert mode?

A

a or i

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

What Key enters vi into the replace mode?

A

R

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

What key strokes quit and save a file in vi?

A

:wq

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

What key will change the case of a letter?

A

~

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

What key will undo a change?

A

u

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

What key will open a new line below the current one?

A

o

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

What key returns to the command mode?

A

ESC

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

What key searches forward in a file?

A

/

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

What key searches backwards in a file?

A

?

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

What command changes a word?

A

cw

17
Q

What command changes an entire line?

A

cc

18
Q

What command deletes an entire line?

A

dd

19
Q

What command deletes a word?

A

dw

20
Q

What key defines a line to go to?

A

G

21
Q

What keystrokes globally replace strings?

A

:%s/find/replace

22
Q

What is the equivalent on :wq?

A

ZZ

23
Q

What is an external command run in vi?

A

:!

24
Q

What command will create and load a new file for editing?

A

:e

25
Q

What are the four letters as cursor keys?

A

hjkl