DEPARTMENT OF COMPUTING

IT 1100 : Introduction to Operating Systems

- VI Basic Commands


Command

Action

i

insert mode

<esc>

command mode

h

move left

l

move right

j

move up

k

move down

b

back one word

w

forward one word

W

forward blank-delimited word (ignore punctuation)

e

move to the end of the current word

2w

move ahead 2 words

3e

move to the end of the 3rd word

fc

move forward to character "c"

{

back one paragraph

}

forward one paragraph

0

beginning of line (zero)

$

end of line

o

insert line below

O

insert line above

a

append here (auto insert mode)

A

end of line append (auto insert mode)

x

delete current character

X

delete previous character

dd

delete line (can be anywhere on the line)

de

delete to the end of the current word

dw

delete current word including trailing space

db

delete previous word

d^

delete line to beginning

d$

delete line to end

d2w

delete 2 words

5dd

delete 5 lines

G

go to last line of file

5G

go to line 5

u

undo previous command

U

Undo all changes to the line

ctrl + R

redo previous undo

/text

search forward for "text"

?text

search backward for "text"

:set ruler

show position of cursor

:w

write file (save)

:r filename

read file (insert)

:wq

write and quit

ZZ

write and quit

:q

quit

:q!

quit without saving

Last Updated 12/15/2017