Neovim Cheatsheet

LazyVim · typescript-tools · Treesitter · Trouble · Conform/Biome


Modes

Key Action
i Insert mode (before cursor)
a Insert mode (after cursor)
I Insert at start of line
A Insert at end of line
o New line below + insert
O New line above + insert
v Visual (character)
V Visual (line)
<C-v> Visual (block)
<Esc> / <C-[> Back to Normal
R Replace mode

Basic Motion

Key Action
h j k l Left / Down / Up / Right
w / b Next / prev word start
e / ge Next / prev word end
W / B / E Same but WORD (whitespace-delimited)
0 Start of line
^ First non-blank character
$ End of line
gg Top of file
G Bottom of file
{N}G Go to line N
% Jump to matching bracket

Scrolling

Key Action
<C-d> Scroll half page down (centered)
<C-u> Scroll half page up (centered)
<C-f> Scroll full page down
<C-b> Scroll full page up
zz Center cursor on screen
zt Cursor to top
zb Cursor to bottom

Searching

Key Action
/pattern Search forward
?pattern Search backward
n Next match (centered)
N Prev match (centered)
* Search word under cursor (forward)
# Search word under cursor (backward)
<leader>nh Clear search highlights
f{c} Jump to next char c on line
F{c} Jump to prev char c on line
t{c} / T{c} Jump before/after char c
; / , Repeat / reverse last f/t

Editing

Operators (combine with motions)

d{motion}   delete
c{motion}   change (delete + insert)
y{motion}   yank (copy)
>{motion}   indent right
<{motion}   indent left
={motion}   auto-indent
g~{motion}  toggle case
gu{motion}  lowercase
gU{motion}  uppercase

Common Combos

Key Action
dd Delete line
cc Change line
yy Yank line
D Delete to end of line
C Change to end of line
Y Yank to end of line
x Delete character
r{c} Replace character with c
s Delete char + insert
S Delete line + insert
u Undo
<C-r> Redo
. Repeat last change

Text Objects

i = inner,  a = around

diw  delete inner word
daw  delete word + space
di"  delete inside quotes
da"  delete quotes + content
di(  delete inside parens
da(  delete parens + content
dit  delete inner tag
dat  delete around tag
dip  delete inner paragraph

Visual Mode Editing

Key Action
J Move selected lines down
K Move selected lines up
> / < Indent / unindent selection
y Yank selection
d Delete selection
c Change selection

Clipboard

Key Action
p Paste after cursor
P Paste before cursor
"+y Yank to system clipboard
"+p Paste from system clipboard

LSP

Key Action
gd Go to definition
gr References (Trouble)
gI Go to implementation
gD Go to declaration
K Hover docs
<leader>ca Code action
<leader>cr Rename symbol
<leader>cd Line diagnostics (float)
]d Next diagnostic
[d Prev diagnostic

TypeScript (typescript-tools)

Key Action
<leader>to Organize imports
<leader>ta Add missing imports
<leader>tf Fix all TS errors
<leader>tr Rename file (updates imports)

Trouble (Diagnostics)

Key Action
<leader>xx Toggle diagnostics (project)
<leader>xX Toggle diagnostics (buffer)
<leader>xs Toggle symbols panel

Buffers & Windows

Buffers

Key Action
<S-h> Prev buffer
<S-l> Next buffer
<leader>bd Delete buffer
<leader>, Switch buffer (fuzzy)

Splits

Key Action
<leader>- Horizontal split
<leader>| Vertical split
<C-h/j/k/l> Navigate between splits
<C-w>= Equalize split sizes
<C-w>o Close all other splits

File Navigation

Key Action
<leader><space> Find files
<leader>/ Grep in project
<leader>ff Find files
<leader>fg Live grep
<leader>fb Find buffers
<leader>fr Recent files
<leader>e File explorer (neo-tree)

Git (gitsigns)

Key Action
]h Next hunk
[h Prev hunk
<leader>ghs Stage hunk
<leader>ghr Reset hunk
<leader>ghp Preview hunk
<leader>ghb Blame line
<leader>gg Lazygit (if installed)

Formatting

Biome runs automatically on save for .ts, .tsx, .js, .json.

Key Action
<leader>cf Format file manually

Quality of Life

Key Action
<C-d> Scroll down (cursor centered)
<C-u> Scroll up (cursor centered)
n / N Search next/prev (centered)
J (visual) Move lines down
K (visual) Move lines up
<leader>nh Clear highlights
gcc Toggle line comment
gc (visual) Toggle comment block

Lazy Plugin Manager

Key Action
<leader>l Open Lazy UI
S (in Lazy) Sync all plugins
U (in Lazy) Update all plugins
X (in Lazy) Clean unused plugins
C (in Lazy) Check for updates

Mason (LSP/Tool Installer)

Command Action
:Mason Open Mason UI
:MasonInstall {tool} Install a tool manually
:MasonUpdate Update all installed tools

Useful Commands

:checkhealth          " check nvim + plugin health
:checkhealth nvim-treesitter
:Lazy sync            " sync all plugins
:Mason                " manage LSP servers & tools
:LspInfo              " active LSP clients for buffer
:LspRestart           " restart LSP
:TSInstall {lang}     " install treesitter parser
:TSUpdate             " update all parsers
:set filetype?        " check detected filetype
:messages             " view recent error messages
:noa w                " save without triggering autocmds (no format)

Config File Locations

~/.config/nvim/
├── lua/
│   ├── config/
│   │   ├── keymaps.lua       ← custom keymaps
│   │   ├── options.lua       ← editor options
│   │   └── autocmds.lua      ← auto commands
│   └── plugins/
│       ├── lsp.lua           ← LSP + Mason config
│       ├── typescript.lua    ← typescript-tools + Biome
│       ├── treesitter.lua    ← syntax highlighting
│       ├── ui.lua            ← theme, bufferline, lualine
│       └── editor.lua        ← editor enhancements

Generated for LazyVim + typescript-tools + Biome setup on WSL2