VI commands Flashcards

1
Q

:set nu

A

gives line number

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

:1.14 co 5

A

copies line 1-14 at line number 5

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

o

A

inserts a line

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

G

A

last line of the file

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

dd or (ndd, dw, dnw, d, db, D)

A

removes a line (delete n lines) delete word

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

x

A

removes a character

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

:g/word to replace/s/word to replace /new word/g

A

global replace of a word

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

p and P

A

Put general buffer after (before) cursor

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

yy or Y

A

Yank (copy) line to general buffer

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

“z6yy

A

Yank 6 lines to buffer z

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

yw

A

Yank work to general buffer

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

“a9dd

A

Delete 9 lines to buffer a

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

“A9dd

A

Delete 9 lines: Append to buffer a

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

“ap

A

Put text from buffer a after cursor

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

J

A

Join lines

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

a

A

append after cursor

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

i

A

insert before cursor

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

o

A

Open line below

19
Q

O

A

Open line above

20
Q

:r

A

file Insert file after current line

21
Q

cw

A

Change word (Esc)

22
Q

cc

A

Change line (Esc) - blanks line

23
Q

c$

A

Change to end of line

24
Q

rc

A

Replace character with c

25
Q

R

A

Replace (Esc) - typeover

26
Q

s

A

Substitute (Esc) -1 char with string

27
Q

S

A

Substitute (Esc) - Rest of line with text

28
Q

.

A

Repeat last change

29
Q

H

A

move to upper left corner (home_

30
Q

M

A

move to middle line

31
Q

L

A

move to lower left corner

32
Q
A

Beginning of line

33
Q

$

A

End of line

34
Q

l

A

Forward a character

35
Q

w

A

One word forward

36
Q

b

A

back one word

37
Q

fc

A

Find c

38
Q

;

A

Repeat find (find next c)

39
Q

:w name

A

write edit buffer to file name

40
Q

:wq

A

write to file and quit

41
Q

:q!

A

quit without saving changes

42
Q

ZZ

A

same as :wq

43
Q

:sh

A

Execute shell commands (d)