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
Q

Indent current line

A

> >

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

Unindent current line

A

«

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

Indent current line in Insert Mode

A

Ctrl-T

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

Unindent current line in Insert Mode

A

Ctrl-D

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

Delete (Cut) a line

A

dd

30
Q

Delete (Cut) n lines

A

ndd

31
Q

Delete (Cut) a word

A

dw

32
Q

Delete (Cut) n words

A

dnw

33
Q

Delete (Cut) previous word

A

db

34
Q

Delete (Cut) to end of sentence

A

d)

35
Q

Delete (Cut) to end of line

A

D

36
Q

Delete (Cut) current character

A

x

37
Q

Yank (Copy) a line

A

yy

38
Q

Yank (Copy) n lines

A

nyy

39
Q

Yank (Copy) a word

A

yw

40
Q

Yank (Copy) to end of line

A

y$

41
Q

Paste after cursor

A

p

42
Q

Paste before cursor

A

P

43
Q

Search for text

A

/text

44
Q

Search backwards for text

A

?text

45
Q

Repeat search same direction

A

n

46
Q

Repeat search opposite direction

A

N

47
Q

Replace all old with new (first occurrance in current line)

A

:s/old/new/

48
Q

Replace all old with new (all occurrances in current line)

A

:s/old/new/g

49
Q

Replace all old with new (first occurrance in all lines)

A

:1,$ s/old/new/

50
Q

Replace all old with new (all occurrances in all lines)

A

:1,$ s/old/new/g

51
Q

Replace all old with new (all occurrances in all lines, ignore case)

A

:1,$ s/old/new/gi

52
Q

Replace all old with new (lines x through y)

A

:x,y s/old/new/g

53
Q

Replace all old with new (lines x through EOF)

A

:x,$ s/old/new/g

54
Q

Replace beginning of each line with text

A

:1,$ s/^/text/g

55
Q

Replace end of each line with text

A

:1,$ s/$/text/g

56
Q

Delete all lines containing text

A

:g/text/d

57
Q

Delete all lines not containing text

A

:v/text/d

58
Q

Delete all DOS carriage returns

A

:1,$ s/\r/g

59
Q

Delete all HTML tags

A

:1,$ s#]+>##g

60
Q

Delete lines appearing twice

A

:1,$ s/^(.*)\n\1$/\1/

61
Q

Convert line to lowercase

A

guu or Vu

62
Q

Convert line to uppercase

A

gUU or VU

63
Q

Invert line case

A

g~~

64
Q

Convert word to uppercase

A

vEU

65
Q

Invert word case

A

vE~

66
Q

Convert all text to lowercase

A

ggguG

67
Q

Convert all text to uppercase

A

gggUG

68
Q

Convert first letter of each word to lowercase

A

Convert first letter of each word to lowercase

69
Q

Convert first letter of each word to uppercase

A

:1,$ s/<./\u&/g

70
Q

Convert first letter of each line to lowercase

A

:1,$ s/.*/\l&

71
Q

Convert first letter of each line to uppercase

A

:1,$ s/.*/\u&