Using VIM Flashcards

1
Q

What vim command will substitute all occurances of an old value with a new one?

A

:%s/old/new/g

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

What does the :%s/old/new/g command do?

A

The command will substitute all occurances of an old value with a new one.

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

What vim command will go to the top of the document?

A

gg

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

What does the gg command do?

A

The gg command will go to the top of the document.

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

What vim command will go to the end of the document?

A

G

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

What does the G command do?

A

The G command will go to the end of the document.

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

How do you search forward through a document?

A

/string
Followed by n

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

How do you search backwards through a document?

A

?string

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

How do you modify a file in vim?

A

The i and a commands enter input mode
* i - insert
* a - append

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

What happens when i or a is pressed in command mode?

A

vim will enter input mode

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

What vim command is used to delete the current line?

A

dd

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

What is the dd command used for?

A

The dd command is used to delete the current line.

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

What vim command is used to copy (yank) the current line?

A

yy

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

What is the yy command used for?

A

The yy command is used to copy (yank) the current line.

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

What vim command is used to past the test currently in the buffer?

A

p

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

What does the p command do?

A

The p command is used to past the test currently in the buffer.

17
Q

What vim command is used to undo the last operation?

A

u

18
Q

What does the u command do?

A

The u command is used to undo the last operation

19
Q

What vim command is used to redo the last undone operation?

A

Ctrl+r

20
Q

What does the Ctrl+r combination do?

A

The Ctrl+r command is used to redo the last undone operation.

21
Q

What is the set number command used for?

A

The set number command displays each row number.
A shortened version is se nu.

set nonumber removes the numbering (se nonu)

22
Q

What shell command provides information about vim usage?

The command is executed in the shell session and not in vim.

A

vimtutor