Editing Flashcards

1
Q

How do you replace ‘foo’ with ‘bar’ on the current line?

A

:s/foo/bar/g

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

How do you replace ‘foo’ with ‘bar’ in the entire file?

A

:%s/foo/bar/g

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

How do you delete the current XML/HTML tag and all its contents?

A

dat

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

How do you repeat the last editing action?

A

Press the ‘.’ key.

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

How do you start editing a new line above/below the current cursor?

A

O/o

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

How do you jump to the beginning/end of the file?

A

gg/G

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

How do you open a file for editing?

A

:e

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

How do you write the buffer to a file?

A

:w []

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

How do you delete/replace the character under the cursor?

A

x/r

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

How do you move to the next start/end of a word?

A

w/e

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

How do you move to the start/end of a line?

A

0/$

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

How do you undo/redo?

A

u/Ctrl-r

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

How do you copy/paste?

A

y/p

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

How do you move the current cursor position to the middle/top/bottom of the screen

A

zz/zt/zb

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

How do you search forward/backward for , and then move to next/prev occurences?

A

”/”/”?” to search, then n/N

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

How do you increase/decrease indent on a selection?

A

> /

17
Q

How do you jump to a matching brace?

A

%