3.1 KiB
3.1 KiB
Neovim command and keybind cheat sheet
Some of these are plain Vim commands, others are specific to Neovim.
BASICS
Spaceleader key:soSource file:checkhealthcheck base and all plugins:checkhealth <pluginname>check for problems of a plugin:verbose set expandtab?check whereexpandtabhas been set last
Lazy
:Lazyshow package manager UI:Lazy restorerevert plugins to the state reflected inlazy-lock.json
Mason
:Masonshow Mason UI
Treesitter
:TSUpdateupdate all parsers:TSModuleInfoshow installed parsers
LSP
:LspInfoshow currently attached LSP client details
NAVIGATION
Tabs
Use buffers in situations where
Ctrl+topen a file in e.g. a Telescope finder in a new tabgtorgTswitch between open tabs (forward/reverse direction)
Window/split
Ctrl+wqclose windowCtrl+wssplit window horizontallyCtrl+wvsplit window verticallyCtrl+<h/j/k/l>move between split windowsCtrl+w=equalize split window width and heightCtrl+wrswap position of two windowsCtrl+wTmove active split window to new tab
Buffer
Space+Spaceshows buffers sorted by last used (viaTelescope buffers):bdclose current buffer:bngo to next buffer:bpgo to previous buffer
Code
wmove to start of next word (ignores punctuation due to remap)emove to end of next word (ignores punctuation due to remap)bmove to start of previous word (ignores punctuation due to remap)Ctrl+dscroll down 1/2 page while keeping the cursor centeredCtrl+uscroll up 1/2 page while keeping the cursor centered
Telescope windows
↓orCtrl+nscroll down (next) file list↑orCtrl+pscroll up (previous) file listCtrl+dscroll down in preview paneCtrl+uscroll up in preview paneCtrl+/helpCtrl+vopen file in vertical splitCtrl+xopen file in horizontal splitCtrl+topen file in new tab
EDITING
Code editing
leader+ire-indent whole fileleader+ore-format whole file or visual withconform.nvimiinsert mode at cursor positionIinsert mode at the beginning of the lineainsert mode one character after the current oneAinsert mode at the end of the lineoinsert mode a line below the cursorOinsert mode a line above the cursorsdelete character and replace (substitute) itcwreplace the current wordccreplace whole lineCreplace to the end of the lineyycopy (yank) the current lineppaste yanked line belowPpaste yanked line above"3predo (put) e.g. your third last delete source
Visual mode
vat cursor positionVline modeCtrl+vblock mode
SEARCH
leader+fgsearch text in files (also searches for text under cursor)leader+ffsearch files (respects.gitignore)leader+efile browser (disregards.gitignore)leader+forecently opened files