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.
2125 results for "i" a""
:lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})
Neovim's built-in diagnostic system (vim.
has('nvim')
The has() function tests whether a feature or capability is available, returning 1 (true) or 0 (false).
set complete=.,w,b,u,t
The complete option controls which sources Vim scans when you press or for generic keyword completion.
<C-x><C-d>
in insert mode triggers defined identifier completion — it searches for identifiers that match the partial word before the cursor by scanning #define statemen
zj and zk
How it works When working with folded code in Vim, you often want to skip from one fold to another without unfolding anything.
g0
When wrap is on, a long buffer line can span multiple screen (display) lines.
navigation #navigation #motions #wrap #display-lines #normal-mode
:set diffopt+=algorithm:patience
Vim's default diff algorithm (Myers) can produce noisy diffs when working with code — it sometimes matches unrelated lines containing common tokens like {, },
yy
The yy command yanks (copies) the entire current line, including the newline character.
cgn
The cgn command combines the change operator with the gn motion to change the next occurrence of your last search pattern.
<C-e>
The command scrolls the window down one line at a time while keeping the cursor on its current line (until the cursor would go off-screen).
d2i(
Vim text objects accept a count prefix that lets you target outer layers of nested delimiters.
crs / crm / crc / cru
The vim-abolish plugin by Tim Pope adds a cr (coerce) prefix command that instantly converts the word under the cursor between common naming conventions.
z{height}<CR>
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
buffers-windows #buffers-windows #windows #resize #navigation
[#
Vim includes built-in motions for navigating C preprocessor conditional blocks: [# jumps backward to the previous unmatched #if or #else, and ]# jumps forward t
:diffget / :diffput
When comparing two files side by side with :diffsplit or vim -d, you often want to pull specific changes from one file into another rather than accepting all di
:set scrolloff=999
By default, Vim only scrolls the viewport when the cursor reaches the very top or bottom of the screen.
navigation #navigation #scrolling #config #cursor #scrolloff
[d
The [d command searches from the beginning of the file for the first line matching the define pattern for the word under the cursor, and displays it in the stat
:windo lcd %:p:h<CR>
When multiple splits point at files from different projects, relative-path commands can become inconsistent and error-prone.
"1p then u.u.u.
Vim stores your last 9 deletions (of one line or more) in the numbered registers "1 through "9.
registers #registers #editing #normal-mode #undo-redo #paste
<C-h> / <C-w> / <C-u>
Vim provides three levels of deletion directly in insert mode, so you don't need to switch to normal mode for small corrections.