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

A

gg

19
Q

Move to a specific line in a file

A

<number>G
</number>

20
Q

Searching for a phrase

A

/phrase

21
Q

Search for a phrase again

A

n

22
Q

Search for the same phrase in the opposite direction

A

N

23
Q

Searching backwards

A

?phrase

24
Q

Go back where you came from

A

CTRL-o

25
Q

Go forward in a search

A

CRTL-i

26
Q

Find a matching parentheses

A

% when on one

27
Q

Substitute new for old

A

:s/new/old/g

28
Q

Change every occurrence of a character string between two lines

A

:#,#s/old/new/g

where #,# are the line numbers of the range of lines where the substitution is to be done.

29
Q

Change every occurrence in the whole file

A

:%s/old/new/g

30
Q

Execute an external shell method

A

:!<method></method>

31
Q

Save the changes to a new file

A

:w FILENAME

32
Q

Visual selection

A

v

33
Q

Insert the contents of a file

A

:r FILENAME

34
Q

Insert a line below

A

o

35
Q

Insert a line above

A

O

36
Q

Replace more than one character

A

R

37
Q

Copy text

A

y

38
Q

Paste text

A

p

39
Q

Set ignore case

A

:set ic

40
Q

Set hlsearch

A

:set hls

41
Q

Set incsearch

A

:set is

42
Q

Ignore case for one search command

A

/phrase\c

43
Q

Show list of matching commands

A

CTRL-d

44
Q

Command line completion

A

Tab