How do I load a pre-built compiler configuration to set makeprg and errorformat together?
The :compiler command loads a compiler plugin from Vim's runtime path, setting both makeprg (the build command) and errorformat (the error parsing pattern) in o
category:
command-line
tags:
#ex-commands
#command-line
How do I make a single search case-insensitive without changing my global ignorecase setting?
Vim's \c and \C atoms let you override the global ignorecase and smartcase settings on a per-search basis.
category:
search
tags:
#search
#case-sensitivity
#normal-mode
#regex
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 move all lines matching a pattern to the top of the file?
When working with large files, you sometimes need to reorganize content by pulling all lines matching a certain pattern to the top.
category:
command-line
tags:
#global
#move
#ex-commands
#editing
#command-line
How do I zero-pad every number in a buffer using one substitute expression?
:%s/\d\+/\=printf('%04d', submatch(0))/g
When you need fixed-width numeric fields, manually editing each number is slow and error-prone.
category:
editing
tags:
#editing
#ex-commands
#formatting
#regex
How do I use case modifiers like \u and \U in a substitution replacement to change capitalization?
Vim's substitute command supports case-modifier escapes in the replacement string: \u uppercases the next character, \U uppercases all text until \E or end of r
category:
search
tags:
#search
#editing
#substitute
#regex
#ex-commands
How do I record a macro that uses text objects and complex motions?
qa ci"replacement<Esc> /next<CR> q
Macros can contain any Vim command including text objects, searches, and multi-key motions.
category:
macros
tags:
#macros
#text-objects
#normal-mode
How do I delete text from the cursor to the next occurrence of a pattern?
Vim lets you use a / search as a motion for any operator.
category:
editing
tags:
#editing
#search
#motions
#delete
#normal-mode
How do I center, right-align, or left-align lines of text within a fixed column width using Ex commands?
Vim has built-in Ex commands for text alignment: :center, :right, and :left.
category:
command-line
tags:
#ex-commands
#formatting
#editing
#command-line
How do I delete all blocks of text between two patterns throughout a file?
The :g (global) command can operate on ranges, not just single lines.
category:
search
tags:
#search
#editing
#ex-commands
How do I force a case-sensitive search in Vim even when ignorecase is enabled?
Appending \C anywhere in a search pattern forces the entire search to be case-sensitive, regardless of whether ignorecase or smartcase is set.
category:
search
tags:
#search
#case-sensitive
#ignorecase
#smartcase
#normal-mode
How do I use \zs to set the start of a search match so only part of the pattern is highlighted or operated on?
Vim's \zs atom marks the start of the match within a longer pattern.
category:
search
tags:
#search
#regex
#patterns
#normal-mode
How do I look up which two-character code produces a special character when using Vim's digraph system?
:digraphs (abbreviated :dig) displays a full reference table of every digraph registered in Vim.
category:
command-line
tags:
#editing
#special-characters
#insert-mode
#command-line
How do I run a substitute command without overwriting my last search pattern?
:keeppatterns %s/old/new/g
The :keeppatterns modifier runs any Ex command without modifying Vim's last search pattern (stored in @/).
category:
command-line
tags:
#search
#ex-commands
#command-line
#substitute
#registers
How do I force a case-sensitive or case-insensitive search for just one pattern without changing my settings?
Vim's \C and \c atoms let you override ignorecase and smartcase on a per-pattern basis.
category:
search
tags:
#search
#normal-mode
#ex-commands
How do I define custom fold boundaries using a Vimscript expression in Vim?
Setting foldmethod=expr tells Vim to call the foldexpr expression for every line to compute its fold level.
category:
config
tags:
#folding
#config
#normal-mode
How do I configure a language server in Neovim 0.11 without any plugins using the built-in vim.lsp.config?
vim.lsp.config('*', { ... })
Neovim 0.
category:
plugins
tags:
#lsp
#plugins
#neovim
#config
#nvim-0-11
How do I keep project search results window-local with a location list?
:lvimgrep /TODO/j **/* | lopen
When you are working in split-heavy sessions, global quickfix results can become noisy because every window shares the same list.
category:
search
tags:
#search
#quickfix
#buffers
#windows
#command-line
How do I jump to a match across included files using Vim's include search?
:ijump is an include-aware jump command that searches the current file plus files discovered through your include and path settings, then jumps directly to a se
category:
navigation
tags:
#navigation
#search
#include
#command-line
How do I run a single normal-mode command without leaving insert mode?
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#motions