A
Aura Dev

Vim Cheatsheet

Essential Vim commands and shortcuts.

Global

:help <keyword>

Open help for keyword

:w

Save (write) the file

:q

Quit

:q!

Quit without saving

:wq

Save and quit

Cursor Movement

h

Move left

j

Move down

k

Move up

l

Move right

w

Jump forwards to the start of a word

b

Jump backwards to the start of a word

0

Jump to the start of the line

$

Jump to the end of the line

gg

Go to the first line of the document

G

Go to the last line of the document

Insert Mode

i

Insert before the cursor

I

Insert at the beginning of the line

a

Insert (append) after the cursor

A

Insert (append) at the end of the line

o

Append a new line below and insert

O

Append a new line above and insert

Esc

Exit insert mode

Editing

r

Replace a single character

u

Undo

Ctrl + r

Redo

x

Delete character under cursor

dd

Delete (cut) a line

dw

Delete (cut) a word

yy

Yank (copy) a line

p

Put (paste) the clipboard after cursor

P

Put (paste) before cursor

Search and Replace

/pattern

Search for pattern

n

Repeat search in same direction

N

Repeat search in opposite direction

:%s/old/new/g

Replace all old with new throughout file

:%s/old/new/gc

Replace all old with new with confirmations

Visual Mode

v

Start visual mode, highlight characters

V

Start linewise visual mode

Ctrl + v

Start visual block mode

>

Shift text right

<

Shift text left

y

Yank (copy) marked text

d

Delete (cut) marked text

What is Vim?

Vim is a highly configurable, terminal-based text editor built to enable efficient text editing through keyboard shortcuts.

This cheatsheet helps developers master Vim's modal editing system, covering essential commands for navigation, insertion, and manipulation.