Vim and NeoVim Shortcut Filter

Delete (cut) current line

dd

Delete (cut) word

dw

Delete (cut) to end of line

d$

Delete (cut) character under cursor

x

Delete (cut) to end of line (same as d$)

D

Yank (copy) current line

yy

Yank (copy) word

yw

Yank (copy) to end of line

y$

Yank (copy) current line (same as yy)

Y

Paste after cursor

p

Paste before cursor

P

Paste from register "a"

"ap

Paste from system clipboard

"*p

Paste and leave cursor after new text

gp

Paste before and leave cursor after new text

gP

Indent line right

>>

Indent line left

<<

Join lines

J

Move cursor left

h

Move cursor down

j

Move cursor up

k

Move cursor right

l

Move to next word

w

Move to beginning of word

b

Move to beginning of line

0

Move to end of line

$

Find character forward in line

f<char>

Move to before character in line

t<char>

Repeat last f/t command

;

Go to beginning of file

gg

Go to end of file

G

Delete current line

dd

Delete to end of file

dG

Delete to beginning of file

dgg

Delete all lines in the file

%d

Delete to end of line and enter insert mode

C

Change entire line

cc

Change word

cw

Quit (close current window/buffer)

:q

Quit without saving

:q!

Write and quit

:wq

Write and quit (only if changes were made)

:x

Save and quit (shortcut for :wq)

ZZ

Quit without saving (shortcut for :q!)

ZQ

Write (save) the current file

:w

Save to a new file

:w new_file

Save all open files

:wa

Search forward

/

Search backward

?

Next search result

n

Previous search result

N

Replace all occurrences of "old" with "new" globally

:%s/old/new/g

Replace all occurrences with confirmation

:%s/old/new/gc

Search for word under cursor forward

*

Search for word under cursor backward

#

Start diffing current buffer with another

:diffthis

Open a new window with diff of current file

:diffsplit

Jump to next diff hunk

]c

Jump to previous diff hunk

[c

Open a new tab

:tabnew

Go to next tab

gt

Go to previous tab

gT

Close current tab

:tabclose

List all tabs

:tabs

Set mark "a" at current position

ma

Jump to mark "a" (exact position)

`a

Jump to mark "a" (beginning of line)

'a

Jump to last edit position (exact)

``

Jump to last edit position (beginning of line)

''

Start visual mode (character-wise)

v

Start visual line mode (line-wise)

V

Start visual block mode (block-wise)

Ctrl+v

Yank (copy) visual selection

y

Delete visual selection

d

Start recording macro into register (e.g., qa)

q<register>

Stop recording macro

q

Execute macro from register (e.g., @a)

@<register>

Repeat last executed macro

@@

Search for pattern in files

:grep <pattern> <files>

Vim-specific grep

:vimgrep <pattern> <files>

List files in argument list

:args

Go to next file in argument list

:next

Go to previous file in argument list

:prev

Insert before cursor

i

Insert at beginning of line

I

Append after cursor

a

Append at end of line

A

Open new line below and insert

o

Open new line above and insert

O

Delete character and insert

s

Delete line and insert

S

Replace characters (overwrite)

R

Replace single character

r

Auto-indent current line

==

Auto-indent entire file

gg=G

Indent selected text (visual mode)

>

Unindent selected text (visual mode)

<

Page down (forward)

Ctrl+f

Page up (backward)

Ctrl+b

Scroll down half page

Ctrl+d

Scroll up half page

Ctrl+u

Center screen on cursor

zz

Move cursor line to top of screen

zt

Move cursor line to bottom of screen

zb

Yank into register "a"

"ay

Paste from register "a"

"ap

Display contents of all registers

:reg

Display content of register "a"

:reg a

Yank to system clipboard

"+y

Paste from system clipboard

"+p

Undo last change

u

Redo last change

Ctrl+r

Undo all changes on current line

U

Go back in time (e.g., :earlier 1h)

:earlier <time>

Go forward in time

:later <time>

Split window horizontally

:sp

Split window vertically

:vsp

Move to left window

Ctrl+w h

Move to lower window

Ctrl+w j

Move to upper window

Ctrl+w k

Move to right window

Ctrl+w l

Close current window

Ctrl+w q

Close all other windows

Ctrl+w o

Make all windows equal size

Ctrl+w =

Rotate windows

Ctrl+w r