Vim Commands Summary

Vim is so cool....

Reference: keycdn.comarrow-up-right, velog.io/@recordboyarrow-up-right

Opening Files

Command
Description

vi FILE

Open a file

vi FILE_1 FILE_2

Open two files sequentially

view FILE

Open in read-only mode (method 1)

vi -R FILE

Open in read-only mode (method 2)

vi + FILE

Open with cursor at the last line

vi +n FILE

Open with cursor at line n

vi -r FILE

Recover a damaged file

Insert modes

Command
Description

i

Switch to insert mode at cursor position

l

Insert character to the left of cursor

a

Switch to insert mode at the end of cursor's line

A

Insert character to the right of cursor

o

Insert a blank line below the cursor's line

O

Insert a blank line above the cursor's line

R

Switch to Replace mode

Moving the Cursor

Command
Description

^

Move to the beginning of line (method 1)

0

Move to the beginning of line (method 2)

$

Move to the end of line

H

Move to the top

M

Move to the middle

L

Move to the bottom

w

Move to the start of next word

e

Move to the end of next word

b

Move to the previous word

Last updated