Modes Flashcards

(35 cards)

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

18
Q

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

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

22
Q

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

23
Q

From Insert Mode, delete

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

24
Q

From Insert Mode, paste text from register X

A

X

Hence, to paste from register zero, 0

25
From Insert Mode, (1) Access the expression register (2) Multiple 8 by 4 with said register
(1) = | (2) =8*4
26
Overwrite text
R
27
Use Virtual Replace mode
gR This should be preferred to Replace mode whenever possible.
28
(1) Enable character-wise Visual Mode (2) Enable line-wise Visual Mode (3) Enable block-wise Visual Mode (4) Reselect the last visual selection
(1) v (2) V (3) (4) gv
29
In Visual Mode, | go to the other end of the selected text
o
30
In Visual Mode, | select backwards by two words
bb or 2blw
31
In Visual Mode, (1) Uppercase selected text (2) lowercase selected text
(1) U | (2) u
32
Use Visual Mode to create a column marked by |
(1) Enter visual block mode (2) Use j or k to mark off a column (3) r|
33
Use Visual Mode to convert all the characters in a line to ------------
Vr-
34
Using Visual Mode, replace the word "foobar" into a block of text
Use j and k to select the block to be replaced c foobar
35
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 ```
jj$ | A;