- add autocmds to highlight yanking and disabling line numbers in Oil - lsp-zero: fix 'gd' command by setting 'preserve_mappings' to false - lualine: show clock, simplify statusline, shorten mode name - oil: decrease float window size, add 'q' hotkey to close window - prefs: show line numbers again, disable additional mode showing - add todo-comments.nvim - remap: add keymap to find all TODOs/FIXME/XXX etc.
4.1 KiB
4.1 KiB
Neovim command and keybind cheat sheet
BASICS
Spaceleader key:checkhealth [<pluginname>]check base or status:verbose set expandtab?check whereexpandtabhas been set last:Lazyshow package manager UI:Lazy restorerevert plugins to the state reflected inlazy-lock.json:Masonshow Mason UI:TSUpdateupdate all treesitter parsers:TSModuleInfoshow installed treesitter parsers:LspInfoshow currently attached LSP client details:ConformInfouseful to debug why a formatter times out
NAVIGATING
Tabs
gtorgTswitch forward/reverse between tabs
Windows/splits
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
Buffers
Space+Spaceshows buffers sorted by last used (viaTelescope buffers):bdclose current buffer:bngo to next buffer:bpgo to previous buffer
Text
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+0start of lineCtrl+$end of lineCtrl+dscroll down 1/2 page while keeping the cursor centeredCtrl+uscroll up 1/2 page while keeping the cursor centeredCtrl+ojump to location you were before (e.g. after usinggg)Ctrl+ijump back to location you were before (after usingCtrl+o)f<char>jump forward to<char>F<char>jump backwards to<char>;jump to next occurence of on same line,jump to previous occurence of onx same line
LSP, Code & Diagnostics
Ctrl+n/pscroll down/up through LSP suggestionsCtrl+laccept selected suggestiongdgo to definitiongrshow references of functionleader+qqtoggletrouble.nvimquickfix listleader+dago to next diagnostic (any severity)leader+dwgo to next diagnostic (warning severity)leader+dego to next diagnostic (error severity)
Telescope
↓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 tabCtrl+qsend all items to quickfix listAlt+qsend selected items to quickfix list
Oil
Ctrl+dbottom of file listCtrl+utop of file listCtrl+ppreview fileCtrl+vopen file in vertical splitCtrl+xopen file in horizontal splitCtrl+topen file in new tab
EDITING
Code editing
leader+ore-format whole file or visual w/conform.nvimiinsert mode at cursor positionIinsert mode at beginning of lineainsert mode after the current charAinsert mode at end of 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 the current lineyap"yank-around-paragraph"ppaste yanked line belowPpaste yanked line above
SELECTING
Visual mode
vat cursor positionVline modeCtrl+vblock mode
Code selection
leader+Spacecontext-sensitive text selection w/treesitterBackspacereduce context-sensitive selection
SEARCH/OPEN
leader+fgsearch text in files (also searches for text under cursor)leader+ffsearch files (respects.gitignore)leader+etoggles Oil file explorerleader+forecently opened filesgfopen file under cursor in a new buffergxopen link under cursor in default browser*search marked word