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.
:lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})
Neovim's built-in diagnostic system (vim.
g0
When wrap is on, a long buffer line can span multiple screen (display) lines.
navigation #navigation #motions #wrap #display-lines #normal-mode
'^
Vim automatically maintains a special mark ^ that records the exact position of the cursor the last time you left insert mode.
:packadd! matchit
Vim's % command jumps between matching brackets by default.
plugins #navigation #plugins #text-objects #matching #normal-mode
nnoremap <nowait> {key} {action}
The flag on a mapping tells Vim not to delay waiting for a longer key sequence.
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
:let @/ = @"
After yanking text, you can promote it directly to the search register with :let @/ = @".
zA
The zA command toggles the fold under the cursor together with all nested sub-folds in one keystroke.
gq{motion}
The gq{motion} operator reformats text to fit within Vim's textwidth setting, inserting hard line breaks where lines are too long.
:normal! {cmds}
:normal {cmds} executes normal-mode keystrokes from the command line, but it honors your custom key mappings — so remapped keys produce unexpected results in
command-line #ex-commands #macros #normal-mode #command-line
qqq then qq{commands}@qq
A recursive macro in Vim calls itself at the end of its body, repeating automatically until one of its commands fails.
g$
The g$ command moves the cursor to the last character of the current screen line, not the end of the logical line.
z<CR> and z. and z-
Vim has two sets of scroll-and-position commands: zt/zz/zb (which reposition the screen but keep the cursor column intact) and z/z.
2<C-g>
Pressing prints the current filename, buffer status, and cursor position in the status line.
:%s/,/,\r/g
In Vim substitutions, \n and \r behave differently depending on whether they appear in the search pattern or the replacement string — a common gotcha that sur
"1p and .
When you paste from a numbered register with "1p, Vim's dot command (.
:execute "normal! \<{key}>"
When building dynamic :execute normal! calls in Vimscript, you must use double-quoted strings with the \ notation so Vim interprets the special key codes.
m'
Vim's jump list automatically records your position whenever you make large motions (like G, /pattern, or ).
z. / z-
Vim has scroll-positioning commands that come in two flavors: those that leave the cursor in the current column (zz, zt, zb) and those that also move the cursor
:[range]normal @a
The :[range]normal @a command runs a recorded macro against every line in a given range.
macros #macros #registers #ex-commands #normal-mode #advanced