Show Menu
Cheatography

LazyVim (neovim) Cheat Sheet (DRAFT) by

Comprehensive Guide to Editing and Code Navigation

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Core Navigation

<C-­f>
Forward (Page down)
<C-­d>
Move down (Half a page)
<C-­b>
Backward (Page up)
<C-­u>
Move up (Half a page)
<C-­o>
Jump back
<C-­i>
Jump forward
gg
Go to first line
Shift-G
Go to last line
:10, 10gg
Jump to line# 10
10j
(Relative) Jump down 10 lines
10k
(Relative) Jump up 10 lines
J
Join lines

UI/UX

<le­ade­r>uC
Colors­cheme with preview
<le­ade­r>uD
Enable code block dimming
<le­ade­r>ul
Toggle line number
<le­ade­r>uL
Toggle relative number
<le­ade­r>uw
Toggle word wrap
<C-­/>
Toggle Terminal window
:Neotree
Neotree file picker

Buffer Management

<le­ade­r>fb
List open buffers
<Sh­ift­>l/h
Next/Prev buffer
<le­ade­r>bd
Close current buffer
<C-­w>v
Split vertical
<C-­w>s
Split horizontal
<C-­w>h­/j/k/l
Navigate splits

Text Objects

viw
Select inner word
vi"
Select inner quotes
vi{
Select inner curly braces
vip
Select inner paragraph
va[
Select around [] braces
dap
Delete around paragraph
 

Code Folding

zR
Open all folds
zM
Close all folds
za
Toggle fold
zA
Toggle all folds under cursor
zc
Close fold
zo
Open fold
zO
Open all folds under cursor

Marks & Bookmarks

m[a-z]
Set local mark
'[a-z]
Jump to mark
:marks
List all marks
' '
Jump to last position
`[a-z]
Jump to exact position
:delmarks a-z
Del lowercase marks (a-z)
:delmarks ax
Del "­a" and "­x" marks
:delmarks!
Del marks (except A-Z,0-9)

Functions & Symbols

<le­ade­r>cs
Document symbols
gr
Find all references
gd
Go to definition
gD
Go to declar­ation
K
Show doscst­rin­g/type hints
[[ or ]]
Prev/Next object matches

Diagno­stics

]d
Next diagnostic
[d
Prev diagnostic
<le­ade­r>sd
Document diagno­stics
<le­ade­r>sD
Workspace diagno­stics

Code Actions

<le­ade­r>cr
Rename symbols
<le­ade­r>cf
Format code
<le­ade­r>ca
Code actions

Indent­ation

>
Indent right
<
Indent left
=
Auto-i­ndent as per language
gg=G
Auto-i­ndent entire file
=ip
Current paragraph
 

Search

<le­ade­r>sr
Search and Replace
<le­ade­r>ff
Search files (Project root)
<le­ade­r>sg
Search text (Project root)
<le­ade­r>ss
Symbol search
<le­ade­r>sc
Command history
<le­ade­r>/
Grep (Root dir)
<le­ade­r>sw
Search word under cursor
<le­ade­r>sk
Search all keymaps
<le­ade­r>st
Search TODO|W­ARNING

Git

<le­ade­r>gc
Commit log texts search
<le­ade­r>gs
Status (file search)
<le­ade­r>ge
Git explorer (Neotree)
<le­ade­r>gf
Current file history

LazyGit

<le­ade­r>gg
Open LazyGit window
<C-­r>
Switch to recent repo
<C-­b>
Filter files by status
p
Git pull
P
Git push
<sp­ace>
Stage
a
Stage all
c
Commit
s
Stash
z
Undo
<C-­z>
Redo
i
Add to .gitignore
q
Quit