How do I paste the unnamed register after transforming it to uppercase?
Registers in Vim are not only for raw replay; you can treat them as string data and transform them at paste time.
category:
registers
tags:
#registers
#expression-register
#editing
#vimscript
How do I remove accidental Enter keystrokes from a recorded macro?
:let @q = substitute(@q, '\n', '', 'g')
A common macro failure mode is accidentally hitting while recording.
category:
macros
tags:
#macros
#registers
#debugging
#vimscript
How do I search non-greedily across multiple lines between two markers?
Multiline searches in Vim often overmatch because .
category:
search
tags:
#search
#regex
#multiline
#patterns
How do I open the current file in a preview window at a specific pattern?
When you need a second read-only view of the same file, opening more normal splits can disrupt your working layout.
category:
buffers-windows
tags:
#buffers
#windows
#preview
#workflow
How do I normalize curly quotes to straight quotes in the current buffer?
:%s/[“”]/"/ge<CR>:%s/[‘’]/'/ge<CR>
When text comes from docs, email, or CMS exports, it often contains typographic quotes (“”‘’) that break code snippets, Markdown tooling, or shell comma
category:
editing
tags:
#editing
#substitute
#formatting
#text-cleanup
How do I join a wrapped paragraph into one line without manual cursor moves?
When text is hard-wrapped for readability in git diffs or markdown source, you sometimes need the paragraph as a single line for refactoring, search, or export.
category:
editing
tags:
#editing
#visual-mode
#formatting
#text-objects
How do I let h/l and arrow keys wrap to adjacent lines at line boundaries?
By default, h and l stop at line boundaries.
category:
config
tags:
#config
#navigation
#motions
#editing
How do I prepend text to every selected line even with uneven indentation?
Visual Block insert (I.
category:
visual-mode
tags:
#visual-mode
#ex-commands
#normal-mode
#editing
How do I paste multiline clipboard text as a comma-separated list in Insert mode?
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
When you paste from the system clipboard into code or config, multiline text often needs to be flattened first.
category:
registers
tags:
#registers
#insert-mode
#expression-register
#text-processing
How do I search only the message part of TODO comments using match boundaries?
/\vTODO:\s*\zs.{-}\ze\s*($|#)
When TODO comments include prefixes, owners, or trailing metadata, a plain search often lands on the wrong part of the line.
category:
search
tags:
#search
#regex
#patterns
#comments
How do I search for 'bar' that is not preceded by 'foo'?
Vim regex supports zero-width assertions, so you can match text based on context without consuming the context itself.
category:
search
tags:
#search
#regex
#lookbehind
#patterns
How do I keep an argument list change local to the current window?
By default, Vim's argument list is global, so changing it in one window can unexpectedly affect another workflow in a different tab or split.
category:
command-line
tags:
#command-line
#arglist
#workflow
#windows
How do I collapse long runs of blank lines to a single empty line?
When files pass through formatters, generators, or repeated edits, they often accumulate noisy vertical gaps.
category:
editing
tags:
#editing
#substitute
#formatting
#cleanup
How do I keep the quickfix window height from resizing when splitting?
Quickfix windows are easy to disturb when you open, close, or rebalance other splits.
category:
buffers-windows
tags:
#buffers
#windows
#quickfix
#layout
How do I make mksession restore globals and local options too?
:set sessionoptions+=globals,localoptions
If you rely on sessions for context switching, default :mksession can feel incomplete because some state does not come back.
category:
config
tags:
#config
#sessions
#workflow
#state
How do I lazy-load cfilter from vimrc without interrupting startup when it is unavailable?
If you share a Vim config across machines, optional plugins can cause noisy startup behavior when a package is missing.
category:
plugins
tags:
#plugins
#packadd
#quickfix
#location-list
#config
How do I insert a register in Insert mode without reindenting each inserted line?
When you paste multiline snippets from a register while in Insert mode, default insertion can trigger indentation and formatting side effects line by line.
category:
registers
tags:
#registers
#insert-mode
#formatting
#indentation
#editing
How do I execute a macro from bottom to top over a selected range?
Running a macro over a range usually goes top to bottom, but that can break when the macro inserts or deletes lines.
category:
macros
tags:
#macros
#ex-commands
#visual-mode
#normal-mode
#refactoring
How do I restrict a search to a specific line-number window without selecting text first?
Vim's search engine can constrain matches by line number, which is useful when you want to scan a known section without touching the rest of the buffer.
category:
search
tags:
#search
#patterns
#regex
#navigation
#advanced
How do I apply an Ex command only to the exact range of my last change or yank?
When you need to run a command on exactly the text you just changed, yanked, or pasted, Vim's automatic marks are faster and safer than reselecting manually.
category:
command-line
tags:
#command-line
#marks
#indentation
#ex-commands
#normal-mode