Vi Flashcards

1
Q

vi filename

A

Edit file.

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

vim filename

A

Same as vi, but more features.

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

view filename

A

Starts vim in read-only mode.

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

3 Types of Modes

A

Command Mode, Insert Mode, Line Mode

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

k

A

Up one line

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

j

A

Down one line

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

h

A

left one character

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

l

A

right one character

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

w

A

right one word

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

b

A

left one word

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

go to the beginning of the line

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

$

A

go to the end of the line

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

i

A

insert at the cursor position

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

I (this is a upper case i)

A

insert at the beginning of the line

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

a

A

Append after the cursor position

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

A

A

Append at the end of the line

17
Q

:w

A

writes(saves) the file

18
Q

:w!

A

forces the file to be saved

19
Q

:q

A

Quit

20
Q

:q!

A

Quit without saving changes

21
Q

:wq

A

write and quit

22
Q

:x

A

same as :wq

23
Q

:n

A

position the cursor at linen

24
Q

:$

A

position the cursor on the last line

25
Q

:set nu

A

turn on line numbering

26
Q

:set nonu

A

Turn off line numbering

27
Q

:help[subcommand]

A

get help

28
Q

What are the vi modes? (4 modes)

A

Mode=key
command=esc
insert i, a or A
line= :

29
Q

x

A

delete

30
Q

dw

A

delete word

31
Q

dd

A

delete a line

32
Q

D

A

delete from cursor position

33
Q

r

A

Replace the current character

34
Q

yy

A

copy the current line

35
Q

p

A

Paster the most current copied text

36
Q

u

A

undo

37
Q

crtl-R

A

redo

38
Q

/

A

start a forward search

39
Q

?

A

start a reverse search