vim Flashcards

1
Q

vim: The easiest way to get to the middle of a line is

A

hit w a lot

to find a character and repeat it until you get to the right one. e.g.

fg will look for letter g on the current line, and repeating that command will keep going to next

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

vim: to move to the next word, type

A

w

b

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

vim: to move down a half screen, aka next page, type

A

control d

control u

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

vim: to undo, type

A

u

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

vim: To split the screen vertically

A

:vsplit

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

vim: To split the screen vertically and have the new screen be a new file, type

A

:vsplit filename.txt

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

vim: To switch active pane in split view, type

A

control w, let go, then an arrow direction

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

vim: To copy and paste, type

A

Select it with v or shift v

Press y, and p

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

vim: To indent a visual block by one space, type

A

gotta learn this

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

vim: To set up vim for convenient visual block indentation, type

A

set shiftwidth=1
vmap >gv
vmap

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

vim: Vim does not reload if you change branches, so you need to run

A

:bufdo e

to clear all the bufffers

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