How do I make Vim highlight matching brackets when typing?
: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.
370 results for "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.
: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.
:ALEToggle
The ALE (Asynchronous Lint Engine) plugin provides real-time linting and automatic fixing for dozens of languages without blocking your editor.
diw
The diw command deletes the inner word under the cursor.
qaciw"<C-r>""<Esc>wq
This macro wraps the current word in double quotes by changing the word, inserting quotes around the original content, and moving to the next word.
qaI<li><Esc>A</li><Esc>jq
This macro wraps each line in tags by inserting the opening tag at the start and appending the closing tag at the end.
c""<Esc>P
Without a surround plugin, you can manually wrap selected text by changing it, typing the delimiters, and pasting the original text back.
qaqqa...@aq
A recursive macro calls itself at the end of its recording, creating a loop that repeats until a motion or command fails (like reaching the end of the file or f
<C-v>selection c
In visual block mode, pressing c changes (replaces) all the text in the selected rectangle.
Paste with "ap and execute keys manually
To debug a macro, paste its contents into the buffer, read each keystroke, and execute them one at a time to find where the macro goes wrong.
/[\x00-\x1f]
Files sometimes contain hidden control characters that cause subtle bugs.