Vimtutor Flashcards

1
Q

Direction Controls

A

h (left), j (down), k (up), l (right)

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

Delete any character under the cursor

A

x

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

Insert text

A

i

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

Append text

A

a

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

Delete word

A

dw

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

Delete to the end of a line

A

d$

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

Delete operator

A

d

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

Delete motions

A

w - start of the next word excluding the first character
e - to the end of the current word including the last character
$ - to the end of the line including the last character

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

Moving through a line

A

nw - n words forward
ne - to move the cursor to the end of the nth word forward
0 - moves to the start of the line

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

Delete an entire line

A

dd

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

Undo last command

A

u

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

Redo last command

A

CTRL-r

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

Put command

A

After deleting, press p to paste

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

Replace

A

r and then whatever letter you want to replace it with

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

Change

A

c
ce - until the end of a word

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

Show location and file status

A

CTRL-g

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

Move to bottom of file

A

G

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

Move to top of file

19
Q

Move to a specific line in a file

A

<number>G
</number>

20
Q

Searching for a phrase

21
Q

Search for a phrase again

22
Q

Search for the same phrase in the opposite direction

23
Q

Searching backwards

24
Q

Go back where you came from

25
Go forward in a search
CRTL-i
26
Find a matching parentheses
% when on one
27
Substitute new for old
:s/new/old/g
28
Change every occurrence of a character string between two lines
:#,#s/old/new/g where #,# are the line numbers of the range of lines where the substitution is to be done.
29
Change every occurrence in the whole file
:%s/old/new/g
30
Execute an external shell method
:!
31
Save the changes to a new file
:w FILENAME
32
Visual selection
v
33
Insert the contents of a file
:r FILENAME
34
Insert a line below
o
35
Insert a line above
O
36
Replace more than one character
R
37
Copy text
y
38
Paste text
p
39
Set ignore case
:set ic
40
Set hlsearch
:set hls
41
Set incsearch
:set is
42
Ignore case for one search command
/phrase\c
43
Show list of matching commands
CTRL-d
44
Command line completion
Tab