Vim Flashcards

1
Q

What are the different ways to get into insert mode?

A

i = insert text before the cursor
I = insert at start of line before first non-blank
a = append text after cursor
A = append text at end of the line
o = begin a new line below the cursor and insert txt
O = same but above

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

What are different ways to delete characters or lines?

A

dd = delete a line
D = delete rest of line
x = delete a character
r = replace a character

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

What are different ways to search for characters/segments?

A

/ = search forward
? = search backward
*n = look at next result
N = previous result

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

How can you copy?

A

yy or Y = copy
p = paste before cursor
P = paste before cursor
*whole line

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

what are the following commands?
:w, :q, :wq, :q!, :number, :e

A

:w = save file
:q = quite current window
:wq = save and quit
:q! = quit and discard changes
:number = go to specific line number
:e filename = edit a file

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