How do I use keyword completion that searches included files and headers in Vim?
<C-x><C-i>
Vim's completion mode searches for keyword matches not just in the current buffer, but also in all files reachable via include directives (e.
162 results for "{n}G"
<C-x><C-i>
Vim's completion mode searches for keyword matches not just in the current buffer, but also in all files reachable via include directives (e.
<C-k>{two-chars}
Vim's digraph system lets you type hundreds of special characters — arrows, fractions, accented letters, currency symbols, and more — using intuitive two-ch
:set makeprg={command}
Vim's :make command runs a build program and automatically loads its output into the quickfix list so you can jump directly to errors and warnings.
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
:set incsearch hlsearch
The combination of incsearch and hlsearch gives you live, interactive search highlighting.
:pop or <C-t>
When you jump to a tag definition with , Vim pushes your location onto a tag stack.
set foldmarker=start,end
When using foldmethod=marker, Vim uses {{{ and }}} as the default fold open and close markers.
:s/pattern/\=expr/g
Vim's :s command normally replaces matches with a literal string.
command-line #search #editing #ex-commands #command-line #registers
:s/\(\w\+\) \(\w\+\)/\=submatch(2) . ' ' . submatch(1)/
The submatch(N) function lets you access individual capture groups inside a \= (expression replacement) in a substitution.
<C-\><C-o>
In a Neovim terminal buffer, exits to normal mode permanently.
buffers-windows #terminal #buffers-windows #insert-mode #neovim #normal-mode
:%sort u
The :sort u command sorts all lines in the file and removes duplicate lines in one operation.
command-line #command-line #ex-commands #editing #text-manipulation #sort
:g/^$/d
The :g/^$/d command deletes every blank line in the file using Vim's powerful 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.
/\%V
The \%V pattern atom restricts a search to the region spanned by the last visual selection.
: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.
<C-y>,
The emmet-vim plugin brings the full power of Emmet (formerly Zen Coding) to Vim, letting you type a short CSS-like abbreviation and expand it into a complete H
:{range}command
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
command-line #command-line #ex-commands #ranges #editing #productivity
:tabnew / gt / gT
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
buffers-windows #buffers #windows #tabs #navigation #productivity
:keeppattern {cmd}
Many Ex commands silently overwrite the search register (@/), which changes your hlsearch highlighting and n/N behavior.
:argdo %s/old/new/g | w
:argdo {cmd} executes an Ex command against every file in the argument list—the set of files you opened Vim with or set explicitly with :args.