How do I reset a Vim option back to its compiled default value?
:set {option}&
Append & to any :set command to reset that option to its compiled-in default value — the value Vim shipped with before any vimrc or plugin changed it.
2125 results for "i( a("
:set {option}&
Append & to any :set command to reset that option to its compiled-in default value — the value Vim shipped with before any vimrc or plugin changed it.
/\Cpattern
Vim's ignorecase and smartcase settings change how all searches behave globally.
:let @+ = @"
Vim's :let @{reg} syntax lets you read from one register and write to another.
:s#pattern#replacement#g
Vim's substitution command accepts any non-alphanumeric, non-whitespace character as the delimiter — not just /.
:normal! @q
Recorded macros can become fragile when your config defines mappings that shadow built-in keys.
:'<,'>s/\%Vold/new/g
The \%V atom restricts a search pattern to match only within the visual selection area, including visual block selections.
:set foldcolumn=3
The foldcolumn option adds a narrow column on the left side of the window that visually represents the fold structure of the file.
:g/pattern/Commentary
vim-commentary exposes Commentary as an Ex command that toggles comments on the current line, making it composable with Vim's :global command.
:let @q = substitute(@q, 'old', 'new', 'g')
When a recorded macro has a typo or needs a small tweak, re-recording the entire thing is error-prone.
<C-v>u{code}
In insert mode, followed by u and a 4-digit hex code inserts the Unicode character with that code point.
:set switchbuf=useopen
The switchbuf option controls how Vim decides where to display a buffer when switching to it via commands like :sb, :cc, :cn, quickfix jumps, or .
buffers-windows #buffers-windows #navigation #ex-commands #config
:setlocal winfixheight winfixwidth
If you use a dedicated utility pane (logs, quick notes, REPL output), Vim's default equalization behavior can keep resizing it whenever other splits change.
zG
zG marks the word under the cursor as correctly spelled in Vim's internal word list, which exists only for the current session.
ggVG
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
\u and \l in :s replacement
Vim's substitute command supports special case modifiers in the replacement string that let you change the case of captured text on the fly.
:g/pattern/m0
When working with large files, you sometimes need to reorganize content by pulling all lines matching a certain pattern to the top.
command-line #global #move #ex-commands #editing #command-line
qq{commands}@qq
A recursive macro calls itself at the end of its own definition, causing it to run repeatedly until Vim hits an error — such as reaching the end of the file o
:g/./,/^$/join
Hard-wrapped text (where each sentence is on its own line) is common in commit messages, email threads, and older documentation.
"qp
Macros are stored as plain text in named registers.
:s/pattern//gn
The :s///gn command counts how many times a pattern appears in the file without actually replacing anything.
command-line #search #ex-commands #substitution #command-line