How do I match a pattern only when it is preceded or followed by another pattern, without including that context in the match?
\@=
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@ family of atoms.
399 results for "it at"
\@=
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@ family of atoms.
:{range}!command
The :{range}!command syntax pipes the specified lines through an external shell command and replaces them with the output.
command-line #command-line #shell #filtering #unix #ex-commands
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
:cfdo %s/old/new/ge | update
When you grep across your project and want to perform a search-and-replace on every file that matched, :cfdo is the most efficient approach.
command-line #quickfix #substitute #search #ex-commands #editing
:'<,'>s/\%Vold/new/g
The \%V atom restricts a search pattern to match only within the visual selection area, including visual block selections.
<C-r><C-a>
When you are in command-line mode, inserts the word under the cursor (alphanumeric and _ only).
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
:g/pattern/.-1,.+1d
The :g (global) command normally operates on lines that match a pattern.
<C-o>{command}
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
<C-k>
Vim has a built-in digraph system that lets you type special characters using short two-character codes.
&
The & command in normal mode repeats the last :s substitution on the current line.
search #search #substitution #ex-commands #repeat #normal-mode
<C-g> and <C-t>
While the search prompt is open (with incsearch enabled), pressing advances the cursor to the next match and moves it to the previous match — all without leav
:g/pattern/m 0
The :global command combined with :move lets you restructure a file by relocating all lines that match a pattern.
:let @/ = 'pattern'
Writing to the @/ register via :let @/ = 'pattern' sets Vim's last-search pattern directly — without performing a search or moving the cursor.
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
:%s/\<old\>/new/g
Wrapping your search pattern in \ word boundary anchors ensures that Vim only matches the exact whole word, preventing accidental replacements inside longer wor
gl{motion}{char}
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
:colder / :cnewer
Vim remembers up to 10 previous quickfix lists.
/pattern/+N or /pattern/-N
Vim's search command accepts an offset that places your cursor on a line relative to the match.