neovim shortcuts
I'm trying to learn neovim more thoroughly. It's heavily shortcut based that I need to learn little by little. Here is a list to help me memorize them:
Neovim Shortcuts Summary
Editing
D— Delete to end of lined$— Same asD3D— Delete to end of line, 3 linesd0— Delete backward to the start of the linedw— Delete word forwarddb— Delete word backwarddB— Delete word backward (incl. punctuation)$dB— Delete last word of the lineggVG— Select entire buffer"+y— Yank selection to system clipboardggVG"+y— Select + copy whole buffer to clipboard
Windows / Splits
Ctrl-w v— Vertical splitCtrl-w s— Horizontal split:vsp filename— Vertical split with new file:sp filename— Horizontal split with new file:q/Ctrl-w q— Close current splitCtrl-w c— Close current split:close— Close current window (not last one):only/Ctrl-w o— Close all other splits
Tabs
:tabnew file— Open file in new tabgt/gT— Next / previous tab:tabclose— Close current tab:tabs— List all tabs2gt— Jump to tab 2
LSP / Diagnostics
gd— Go to definitiongD— Go to declarationgi— Go to implementationgr— Go to referencesK— Hover docs<leader>rn— Rename symbol<leader>ca— Code action<C-k>— Signature help<leader>e(custom) — Open diagnostic float<F5>— DAP: continue<F10>— DAP: step over<F11>— DAP: step into<leader>b(custom) — Toggle breakpoint<leader>x(custom, trouble.nvim) — Toggle diagnostics panel
File browser
<leader>ff— Find files<leader>fg— Live grep (requires rgrep)<leader>fb— List buffers<leader>fh— Help tags<leader>fo— Recently opened files
Command-line / Ex Commands
:%s/.../.../g— Substitute over whole buffer:g/^ /d— Delete all lines starting with two spaces:g/^ /— Preview matches without deleting:g/^ /normal dd— Delete matches via global+normal:make— Run build (viamakeprg):copen— Open quickfix list:checkhealth nvim-treesitter— Check treesitter health:checkhealth provider— Check clipboard provider
Misc
:qa— Quit vim and all buffers<leader>— Custom prefix key, default\, commonly remapped toSpaceviavim.g.mapleader = " "