How do I replace every character in a visual selection with a single character?
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
210 results for "insert mode"
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode
qa0f=20i <Esc>20|C= <Esc>lDjq
How it works Aligning text on a delimiter such as = without plugins requires a clever macro technique.
g; and g,
Vim tracks every position where you made a change in the changelist.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
highlight TrailingWhitespace ctermbg=red and match TrailingWhitespace /\s\+$/
How it works Vim's highlight and match commands let you create custom visual indicators.
"+p
The "+p command pastes the contents of the system clipboard into Vim.
<C-v>jj$A text<Esc>
Visual block mode combined with $A lets you append text to the end of multiple lines simultaneously, even when those lines have different lengths.
visual-mode #editing #visual-mode #block-mode #productivity #insert-mode
:set showmatch
How it works The :set showmatch option makes Vim briefly jump the cursor to the matching opening bracket when you type a closing bracket.
:set mouse=a
How it works The :set mouse=a command enables mouse support in all Vim modes.
":
The : register contains the last Ex command that was executed.
"/ register
The / register contains the most recent search pattern.
:reg a
The :reg a command shows the contents of register a, which reveals the keystrokes stored in the macro.
"# register
The # register contains the name of the alternate file — the previously edited file in the current window.
auto-pairs plugin
auto-pairs automatically inserts closing brackets, parentheses, and quotes when you type the opening one.
:set autoindent
The autoindent option copies the indentation from the current line when starting a new line.
qaI"<Esc>A": "",<Esc>jq
This macro transforms a plain word into a JSON key-value pair format, useful for converting lists of field names into JSON structure.
<C-v>jjI1. <Esc>
Visual block insert can add numbered prefixes to lines.
qa I1. <Esc>j q
This simple macro inserts a list number prefix at the beginning of each line.
qaI// <Esc>jq
This macro adds a // comment prefix to the beginning of the current line and moves down.