Vim Cheat Sheet

Vim/Neovim Command Reference

Action
Command

Open/Close sidebar

<leader>e

Open helpbar

<leader>

Close helpbar

<Esc>

Delete

d

Move

m

Rename

r

File Navigation

Action
Command

Search files

<leader>ff

Exit

<Esc><Esc>

Go to top

gg

Go to bottom

G

Start of line

0

End of line

$

Forward fast

e

Backward fast

b

Search codebase

<leader>sg

Search and replace all

:%s/old/new/g

Split Windows

Action
Command

Open vertical split

<leader>|

Exit window

<Esc>:q!

Window Navigation

Action
Command

Go right

<Ctrl>l

Go left

<Ctrl>h

LSP (Language Server Protocol)

Action
Command

Go to definition

<leader>gd

Read docs/typedef

K

Code action

<leader>c

Format code

<leader>cf or :q!

Replace all refs & remove unused imports

<leader>cr

Quick fix

<leader>ca

Organize imports

<leader>co

Buffer Navigation

Action
Command

Previous buffer

[b

Next buffer

]b

Close current buffer

<leader>bd

Line Navigation

Action
Command

Move up n lines

nk

Move down n lines

nj

Terminal

Action
Command

Open terminal

<leader>ft

File Explorer

Action
Command

Open explorer

:Explore

Add file

%

Add folder

d

Rename file

R

Editing

Action
Command

Undo

u

Redo

<Ctrl>r

Delete line

dd

Paste

p

Copy

"y

Visual Mode

Action
Command

Enter visual mode

v

Delete selection

d

Copy selection

y

Select inside parentheses

vi)

Select inside quotes

vi"

Exit visual mode

<Esc>

Miscellaneous

Action
Command

Search

/

Next search result

n

Toggle word wrap

:set wrap!

Last updated