How do I paste the contents of a register into the command line or search prompt?
:<C-r>"
When typing an Ex command or search pattern, you often need to insert text you've already yanked or deleted.
795 results for "G"
:<C-r>"
When typing an Ex command or search pattern, you often need to insert text you've already yanked or deleted.
/colour\%[s]
Vim's \%[.
:Telescope resume
The :Telescope resume command reopens the most recent Telescope picker, restoring the exact query string, filtered results, and cursor position from the last ti
:lvimgrep /pattern/gj **/*.js | lopen
When you already rely on the global quickfix list for compiler errors or another search, running :vimgrep can wipe that context.
/\c
Vim lets you override the ignorecase and smartcase settings on a per-search basis using the \c (case-insensitive) and \C (case-sensitive) atoms directly inside
\n in search, \r in replacement
Vim uses \n and \r differently depending on whether they appear in a search pattern or a replacement string, and mixing them up is a common source of confusion.
[[:alpha:]]
Vim's regex engine supports POSIX character classes inside bracket expressions, giving you locale-aware, readable alternatives to manual character ranges like [
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
{count}n
Like most Vim motions, the n and N search repeat commands accept a count prefix.
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.
:find
The :find command searches for a file by name across all directories listed in Vim's path option, so you can open files without typing full paths.
:diffupdate
After making edits in a vimdiff session, the diff highlighting can become out of sync with the actual content — showing incorrect change markers or missing hu
/pattern\c
Vim's \c and \C atoms let you override the global ignorecase and smartcase settings on a per-search basis.
<C-f> (command-line mode)
Pressing while in the command-line (:, /, or ? prompt) opens the command-line window with your partially-typed command already loaded and ready for full Vim edi
command-line #command-line #ex-commands #editing #navigation
:%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
<C-a> / <C-x>
Pressing increments and decrements the number under or after the cursor.
\@<= and \@=
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@ atom.
:execute
:execute evaluates a string as an Ex command, letting you build commands dynamically or embed special key sequences (like or ) as literal characters.
"/
Vim stores the last search pattern in the special / register.
/pattern\C
Appending \C anywhere in a search pattern forces the entire search to be case-sensitive, regardless of whether ignorecase or smartcase is set.
search #search #case-sensitive #ignorecase #smartcase #normal-mode