vim Flashcards

1
Q

Move to end of line

A

$

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

Move to beginning of line

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

Move to beginning of file

A

1G or gg

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

Move to end of file

A

G

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

Move to line n

A

:n
or
nG

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

Move page forward

A

Ctrl-F

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

Move page backward

A

Ctrl-B

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

Scroll up (half a screen)

A

Ctrl-U

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

Scroll down (half a screen)

A

Ctrl-D

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

Show current position and file info

A

Ctrl-G

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

Move one character up

A

↑ or k

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

Move one character down

A

↓ or j

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

Move one character left

A

← or h

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

Move one character right

A

→ or l

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

Move one word forward

A

w

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

Move one word backward

A

b

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

Move to end of next word

A

e

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

Insert at cursor
Insert at beginning of line
Append after cursor
AAppend at end of line

A

i
I
a
A

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

Insert blank line below current

Insert blank line above current

A

o

O

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

Append at end of word

A

ea

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

Exit Insert Mode

A

Esc

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

Replace a single character

A

r

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

Join line below to current line

A

J

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

Undo last change

A

u

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Indent current line
>>
26
Unindent current line
<<
27
Indent current line in Insert Mode
Ctrl-T
28
Unindent current line in Insert Mode
Ctrl-D
29
Delete (Cut) a line
dd
30
Delete (Cut) n lines
ndd
31
Delete (Cut) a word
dw
32
Delete (Cut) n words
dnw
33
Delete (Cut) previous word
db
34
Delete (Cut) to end of sentence
d)
35
Delete (Cut) to end of line
D
36
Delete (Cut) current character
x
37
Yank (Copy) a line
yy
38
Yank (Copy) n lines
nyy
39
Yank (Copy) a word
yw
40
Yank (Copy) to end of line
y$
41
Paste after cursor
p
42
Paste before cursor
P
43
Search for text
/text
44
Search backwards for text
?text
45
Repeat search same direction
n
46
Repeat search opposite direction
N
47
Replace all old with new (first occurrance in current line)
:s/old/new/
48
Replace all old with new (all occurrances in current line)
:s/old/new/g
49
Replace all old with new (first occurrance in all lines)
:1,$ s/old/new/
50
Replace all old with new (all occurrances in all lines)
:1,$ s/old/new/g
51
Replace all old with new (all occurrances in all lines, ignore case)
:1,$ s/old/new/gi
52
Replace all old with new (lines x through y)
:x,y s/old/new/g
53
Replace all old with new (lines x through EOF)
:x,$ s/old/new/g
54
Replace beginning of each line with text
:1,$ s/^/text/g
55
Replace end of each line with text
:1,$ s/$/text/g
56
Delete all lines containing text
:g/text/d
57
Delete all lines not containing text
:v/text/d
58
Delete all DOS carriage returns
:1,$ s/\r/g
59
Delete all HTML tags
:1,$ s#]\+>##g
60
Delete lines appearing twice
:1,$ s/^\(.*\)\n\1$/\1/
61
Convert line to lowercase
guu or Vu
62
Convert line to uppercase
gUU or VU
63
Invert line case
g~~
64
Convert word to uppercase
vEU
65
Invert word case
vE~
66
Convert all text to lowercase
ggguG
67
Convert all text to uppercase
gggUG
68
Convert first letter of each word to lowercase
Convert first letter of each word to lowercase
69
Convert first letter of each word to uppercase
:1,$ s/\<./\u&/g
70
Convert first letter of each line to lowercase
:1,$ s/.*/\l&
71
Convert first letter of each line to uppercase
:1,$ s/.*/\u&