Modes Flashcards

1
Q

Repeats the last change

A

.

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

Increases indentation until end of line

A

> G

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

Scans line for a specific character after the cursor

A

f + char

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

Scans line a specific character before the cursor

A

F + char

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

Repeat last find forward command

A

;

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

Repeat last find backwards command

A

,

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

In one letter,

(1) Delete the character under the cursor
(2) Enter Insert Mode

A

s

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

Undo a change

A

u

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

Delete from the cursor’s position to the beginning of a word

A

db

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

(1) Generally, this is the best way to delete a word

(2) Why so?

A

(1) daw

(2) This is more repeatable via . than alternatives like dbx and bdw

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

Copy a line

A

Y or yy

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

(1) Add by one

(2) Add by five

A

(1)

(2) 5

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

(1) Subtract by one

(2) Subtract by five

A

(1)

(2) 5

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

Delete three words

A

3dw or d3w

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

Two ways to delete a single character

A

x or dl

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

(1) Swap case
(2) Make lowercase
(3) Make uppercase

A

(1) g~
(2) gu
(3) gU

17
Q

(1) Shift left
(2) Shift right
(3) Autoindent

A

(1)

(3) =

18
Q

Operator-Pending mode is a state that only accepts __________ commands.

A

motion

19
Q

List vim’s major modes

A

Normal
Insert
Visual
Command-Line

20
Q

List vim’s minor modes

A

Operator-Pending
Select
Insert-Normal

21
Q

Two ways to switch from Insert to Normal Mode

A
22
Q

Insert-Normal Mode: While in Insert Mode, fire off a single Normal Mode command

A
23
Q

From Insert Mode, delete

1) back one character (backspace
(2) back one word
(3) back to start of line

A

(1)
(2)
(3)

24
Q

From Insert Mode, paste text from register X

A

X

Hence, to paste from register zero, 0

25
Q

From Insert Mode,

(1) Access the expression register
(2) Multiple 8 by 4 with said register

A

(1) =

(2) =8*4

26
Q

Overwrite text

A

R

27
Q

Use Virtual Replace mode

A

gR

This should be preferred to Replace mode whenever possible.

28
Q

(1) Enable character-wise Visual Mode
(2) Enable line-wise Visual Mode
(3) Enable block-wise Visual Mode
(4) Reselect the last visual selection

A

(1) v
(2) V
(3)
(4) gv

29
Q

In Visual Mode,

go to the other end of the selected text

A

o

30
Q

In Visual Mode,

select backwards by two words

A

bb or 2blw

31
Q

In Visual Mode,

(1) Uppercase selected text
(2) lowercase selected text

A

(1) U

(2) u

32
Q

Use Visual Mode to create a column marked by |

A

(1) Enter visual block mode
(2) Use j or k to mark off a column
(3) r|

33
Q

Use Visual Mode to convert all the characters in a line to ————

A

Vr-

34
Q

Using Visual Mode, replace the word “foobar” into a block of text

A

Use j and k to select the block to be replaced
c
foobar

35
Q

Using Visual-Block mode, append a semi-colon to the following code. The cursor starts on 1.

var foo = 1
var bar = 'a'
var foobar = foo + bar
A

jj$

A;