Vim


Operators

x

Delete character on cursor

i

Input text behind cursor

I

Input text at start of line

a

Append text in front of cursor

A

Input text at end of line

dm

Delete operator, takes a motion

D

Delete from end of line to cursor

dd

Delete line

u

Undo

p

Paste at cursor

y

Yank (copy)

yy

Yank (copy) line

r

Replace character at cursor

cm

Change operator, takes a motion

cc

Change line

vm

Highlight operator, can take a motion

V

Highlight line

R

Replace mode

/

Finds a phrase in the file

J

Join line below with current line

=

Automatically indent line

K

Summons vim manual

~

Capitalise characte on cursor

q

Start recording macro

>>

Indent line

<>

Outdent line

.

Repeat previous operator

Motions

h

Left

j

Down

k

Up

l

Right

e

End of current/next word

ge

End of current/previous word

w

Start of current/next word

b

Start of current/previous word

$

End of line to cursor

^

Beggining of line to cursor

%

Paired bracket

n%

Jumps to n% mark in file

ngg

Jumps to the nth line of the file, jumps to head of the file if number not provided

nG

Jumps to the nth line of the file, jumps to foot of the file if number not provided

M

Jumps to middle line on screen

n|

Jumps to the nth column, jumps to first column if number not provided

+

Jumps to the next line

-

Jumps to the previous line

g0

Jumps to the first character of the current line

g^

Jumps to the first character of the current line

g$

Jumps to the last character of the current line

fx

Jumps to the next occurence of character x on the current line

Fx

Jumps to the previous occurence of character x on the current line

tx

Jumps to the character before the next occurence of character x on the current line

Tx

Jumps to the character after the previous occurence of character x on the current line

H

Jumps to the top of the visible page

L

Jumps to the bottom of the visible page

n

Jumps to the next instance of a search pattern

N

Jumps to the previous instance of a search pattern

Commands

:wq

Write and quit

:q!

Quit without saving

:!

Execute system command

:w

Write

:r

Read

:s

Substitute

:reg x

Show contents of clipboard register x, shows all clipboards if variable not provided

:s

Substitute

Numbers

n

Repeats an operator or motion n times, in some particular cases it can be used for indexing

Search expressions

/

Search

/<

Begginging of word

/>

End of word

*

No, single, or multiple characters

[]

Single character included within brackets

!

Single character not included within brackets

?

Single character

$

End of line

^

Beggining of line

/s

Space character

/+

Trailing previous character

#282C34