2.9 KiB
2.9 KiB
Neovim command and keybind cheat sheet
Some of these are plain Vim commands, others are specific to Neovim.
Basics
Spaceleader key
Plugins
:soSource file:checkhealthcheck base and all plugins:checkhealth <pluginname>check for problems of a plugin:Lazyshow package manager UI:Masonshow Mason UI:verbose set expandtab?check whereexpandtabhas been set last
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 windows
Buffer
Space+Spaceshows open buffers (viaTelescope buffers):bdclose current 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
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 wordyycopy (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 files or text
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
Navigation in Telescope live_grep, find_files, git_status and file_browser
↓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
Treesitter
:TSUpdateupdate all parsers:TSModuleInfoshow installed parsers
LSP
LspInfoshow attached LSP client info