How do I jump to the next LSP diagnostic error or warning in Neovim?
vim.diagnostic.goto_next()
Neovim's built-in vim.
category:
plugins
tags:
#plugins
#lsp
#diagnostics
#neovim
#navigation
How do I use cgn to repeat a change on every search match?
/pattern<CR>cgnreplacement<Esc>.
The gn text object selects the next search match, and cgn changes it.
category:
macros
tags:
#macros
#cgn
#search
#interactive-replace
How do I register a Lua callback that fires before every keystroke to react to keyboard input?
vim.
category:
config
tags:
#ex-commands
#vimscript
#config
#macros
How do I search for text in Vim?
The /pattern command searches forward through the file for the given pattern.
category:
search
tags:
#search
#navigation
#normal-mode
How do I search backward for text in Vim?
The ? command searches backward from the cursor position.
category:
search
tags:
#search
#normal-mode
How do I get the current Vim mode as a string for use in expression mappings or the statusline?
The mode() function returns a short string identifying the current editing mode — 'n' for Normal, 'i' for Insert, 'v' for Visual character-wise, 'V' for Visua
category:
macros
tags:
#macros
#normal-mode
#visual-mode
#insert-mode
#editing
How do I embed per-file Vim settings directly in a source file using modelines?
Vim's modeline feature lets you embed editor settings directly into a file.
category:
config
tags:
#config
#formatting
#indentation
How do I count substitution matches before changing anything?
:%s/pattern/replacement/gn
When you are about to run a broad substitution, it is often safer to measure impact first.
category:
command-line
tags:
#command-line
#ex-commands
#substitution
#search
How do I programmatically inject keystrokes into Vim's input queue from a function or mapping?
The feedkeys({keys}, {flags}) function inserts a string of keystrokes into Vim's input queue as if the user had typed them.
category:
command-line
tags:
#ex-commands
#macros
#config
#normal-mode
How do I autocomplete words from a dictionary file while typing in insert mode?
Vim's insert-mode completion system includes dictionary lookup via .
category:
editing
tags:
#completion
#insert-mode
#editing
How do I search forward for text in Vim?
The / command initiates a forward search in the file.
category:
search
tags:
#search
#normal-mode
How do I count the words, lines, and characters in just my visual selection?
In visual mode, pressing g reports detailed statistics for the selected text only — word count, character count, and byte count.
category:
visual-mode
tags:
#visual-mode
#editing
#navigation
How do I create a mapping that calls a script-local function in Vim without namespace collisions?
(Script ID) is a Vimscript token that expands to a unique, per-script prefix at runtime.
category:
config
tags:
#config
#vimscript
#mappings
#functions
#normal-mode
How do I write a Vim search pattern that matches text spanning multiple lines?
Vim's regex engine normally treats .
category:
search
tags:
#search
#regex
#normal-mode
How do I replay macro q from command-line mode without changing @/?
:keeppatterns normal! @q<CR>
When you replay macros from Ex commands, Vim can overwrite @/ (the last search pattern) depending on what the macro does.
category:
macros
tags:
#macros
#registers
#search
#normal-mode
#automation
How do I use non-greedy (lazy) matching in Vim regex?
The \{-} quantifier in Vim regex matches as few characters as possible, unlike which matches as many as possible (greedy).
category:
search
tags:
#search
#normal-mode
How do I write a Vim regex that matches any character including newlines for multi-line pattern matching?
In Vim's regular expressions, .
category:
search
tags:
#search
#regex
#multiline
#advanced
#pattern
How do I join a specific number of lines at once without pressing J multiple times?
The J command joins the current line with the line below, adding a space between them.
category:
editing
tags:
#editing
#normal-mode
#join
#motions
How do I load yanked text into search as a literal pattern without regex escaping headaches?
:let @/='\V'.escape(@", '\\')
When you yank text that contains regex characters like .
category:
search
tags:
#search
#registers
#regex
#command-line
How do I enable fuzzy matching for insert mode completion in Neovim 0.11?
Neovim 0.
category:
config
tags:
#completion
#config
#insert-mode