How do I allow split windows to collapse completely to just their status line?
By default, Vim enforces a minimum window height of 1 line, which means you can never fully collapse a split.
category:
buffers-windows
tags:
#buffers-windows
#windows
#splits
#navigation
How do I jump between matching #if, #else, and #endif preprocessor directives in C code?
Vim includes built-in motions for navigating C preprocessor conditional blocks: [# jumps backward to the previous unmatched #if or #else, and ]# jumps forward t
category:
navigation
tags:
#navigation
#normal-mode
#motions
How do I navigate to an older undo state that is not on my current undo branch?
Vim's undo history is a tree, not a linear stack.
category:
editing
tags:
#undo-redo
#navigation
#normal-mode
How do I control how many columns Vim scrolls horizontally at once when the cursor reaches the screen edge?
When wrap is off and the cursor moves past the edge of the screen, Vim jumps the view horizontally by a number of columns determined by sidescroll.
category:
config
tags:
#config
#navigation
#editing
How do I get just the filename without its path or extension to use in a command?
Vim's % special character expands to the current filename and accepts a chain of colon-delimited modifiers.
category:
command-line
tags:
#command-line
#ex-commands
#editing
#navigation
How do I resize the current window to an exact number of lines from the command line?
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
category:
buffers-windows
tags:
#buffers-windows
#windows
#resize
#navigation
How do I jump to the local or global declaration of the variable under the cursor without ctags?
Vim's gd and gD commands jump to the declaration of the identifier under the cursor by searching upward through the file — no ctags setup required.
category:
navigation
tags:
#navigation
#editing
#normal-mode
How do I make Neovim restore the scroll position when navigating back through the jump list?
By default, when you navigate the jump list with (older) or (newer), Neovim restores the cursor's line and column but does NOT restore where the window was scro
category:
navigation
tags:
#neovim
#navigation
#jumplist
#config
How do I read man pages inside Neovim with syntax highlighting and tag navigation?
Neovim ships with a built-in :Man command (the man.
category:
command-line
tags:
#neovim
#navigation
#documentation
#command-line
How do I step through the files in my argument list one at a time?
When Vim is opened with multiple files (e.
category:
command-line
tags:
#buffers-windows
#ex-commands
#navigation
#editing
How do I jump directly to the first or last entry in the quickfix list?
:cfirst and :clast jump directly to the first or last entry in the quickfix list, skipping all intermediate results.
category:
command-line
tags:
#ex-commands
#navigation
#search
How do I close all folds and then open just the one containing the cursor to focus on it?
The zMzv sequence collapses every fold in the file and then re-opens only the one containing your cursor.
category:
editing
tags:
#folding
#navigation
#normal-mode
How do I open the command-line window while I am already typing a command?
<C-f> (command-line mode)
Pressing while in the command-line (:, /, or ? prompt) opens the command-line window with your partially-typed command already loaded and ready for full Vim edi
category:
command-line
tags:
#command-line
#ex-commands
#editing
#navigation
How do I close a preview window from any other window without having to jump to it first?
Pressing z closes the preview window from any window in the current tab page.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#normal-mode
How do I jump only to error-level diagnostics and skip warnings and hints in Neovim?
:lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})
Neovim's built-in diagnostic system (vim.
category:
plugins
tags:
#navigation
#lsp
#diagnostics
#neovim
#normal-mode
How do I move to the start of the current screen line rather than the start of the buffer line when text is soft-wrapped?
When wrap is on, a long buffer line can span multiple screen (display) lines.
category:
navigation
tags:
#navigation
#motions
#wrap
#display-lines
#normal-mode
How do I use the caret mark to jump to the exact cursor position where I last left insert mode?
Vim automatically maintains a special mark ^ that records the exact position of the cursor the last time you left insert mode.
category:
navigation
tags:
#navigation
#marks
#insert-mode
#normal-mode
How do I use Neovim's built-in default LSP keymaps for rename, references, and code actions?
Neovim 0.
category:
plugins
tags:
#navigation
#completion
How do I view all symbols in the current file using Neovim's built-in LSP?
Since Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#navigation
#symbols
#plugins
How do I rename a symbol under the cursor using Neovim's built-in LSP without any plugin configuration?
Since Neovim 0.
category:
plugins
tags:
#lsp
#neovim
#navigation
#rename
#code-action