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 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 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 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 join wrapped paragraph lines while keeping blank-line paragraph separators?
When text is hard-wrapped (for example from email, logs, or copied docs), joining entire paragraphs manually is slow and error-prone.
category:
editing
tags:
#editing
#formatting
#ex-commands
#text-manipulation
How do I append keystrokes to a macro without re-recording it?
Re-recording a long macro just to add one extra keystroke is wasteful and error-prone.
category:
macros
tags:
#macros
#registers
#automation
#editing
How do I swap the first two comma-separated fields on each line with one substitute command?
:%s/\v^([^,]+),([^,]+),/\2,\1,/<CR>
When CSV-like data has two columns in the wrong order, manually fixing each line is slow and error-prone.
category:
editing
tags:
#editing
#regex
#ex-commands
#formatting
How do I indent the current line without changing local marks in Vim?
When you run editing commands from the command line, Vim usually updates special marks like '[ and '] to the changed text.
category:
editing
tags:
#editing
#ex-commands
#marks
#normal-mode
How do I uppercase text inside an HTML tag without changing the tags?
When editing markup-heavy files, you often need to transform only the tag contents while preserving the surrounding structure.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#html
How do I delete just the current search match with dgn?
When you are reviewing repetitive text, you often need to remove one specific match without running a broad substitute.
category:
search
tags:
#search
#editing
#normal-mode
#patterns
How do I make Ctrl-A increment 007 as decimal instead of octal?
:set nrformats-=octal\<CR>
If you work with IDs, ticket numbers, or zero-padded counters, Vim's default octal behavior can be surprising.
category:
config
tags:
#config
#editing
#command-line
#formatting
How do I duplicate every non-blank line in a buffer with one Ex command?
The :global command can apply an Ex action to every line that matches a pattern.
category:
editing
tags:
#editing
#ex-commands
#normal-mode
#search
How do I title-case every word in a buffer using one Vim substitution?
:%s/\v<(\w)(\w*)>/\u\1\L\2/g
When you need to normalize casing across headings, labels, or generated docs, editing words one by one is tedious.
category:
editing
tags:
#editing
#substitution
#regex
#formatting
How do I trim trailing whitespace while preserving marks, jumplist, and search state?
:lockmarks keepjumps keeppatterns %s/\s\+$//e
Bulk cleanup commands are easy to automate, but many implementations quietly damage editor state by moving marks, polluting the jumplist, or replacing your last
category:
command-line
tags:
#command-line
#substitute
#automation
#editing
How do I insert the unnamed register literally in Insert mode without auto-indent side effects?
In Insert mode, plain {register} inserts register content but may reindent or auto-format depending on context.
category:
registers
tags:
#registers
#insert-mode
#editing
#indentation
#text
How do I open and edit a file directly inside a tar archive in Vim?
:e archive.tar::path/to/file
Vim's built-in tar.
category:
plugins
tags:
#plugins
#buffers
#editing
#workflow
How do I prepend text to every line in a visual block selection?
When you need to add the same prefix to many adjacent lines, Visual Block insert is faster and safer than repeating macros or substitutions.
category:
visual-mode
tags:
#visual-mode
#editing
#blockwise
#insert-mode