How do I view or manipulate the search pattern register in Vim?
:echo @/
The / register holds the most recent search pattern.
795 results for "g* g#"
:echo @/
The / register holds the most recent search pattern.
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
:NERDTreeToggle
The NERDTree plugin provides a full-featured file explorer sidebar in Vim, giving you a visual directory tree that you can navigate, search, and manipulate file
:set sessionoptions+=globals
By default, :mksession restores windows, buffers, and many editor states, but it skips most global variables.
:Explore
Netrw is Vim's built-in file explorer plugin that comes with every Vim installation.
u
The u command undoes the last change you made in normal mode.
:set inccommand=split
Neovim's inccommand option provides real-time visual feedback as you type substitution commands.
:args **/*.py | argdo %s/old/new/gc | update
Vim can perform search-and-replace across multiple files without any plugins by combining the arglist with :argdo.
search #search #substitution #ex-commands #productivity #quickfix #arglist
/\v
Vim's default regex syntax requires backslashes before most special characters like +, (, ), {, and , which is the opposite of what most developers expect from
:oldfiles
:oldfiles displays a numbered list of every file Vim has recorded in its viminfo (or shada in Neovim) file.
gj
The gj command moves the cursor down by one display line rather than one physical line.
\c
Vim lets you embed \c or \C directly inside a search pattern to control case sensitivity for that search only, regardless of your 'ignorecase' and 'smartcase' s
:%s/pattern/replacement/gn
When you are about to run a broad substitution, it is often safer to measure impact first.
command-line #command-line #ex-commands #substitution #search
/\zs and \ze
The \zs and \ze atoms let you define where the actual match starts and ends within a larger pattern.
:/BEGIN/,/END/-1s/\s\+$//
When you need to clean or refactor block-like regions, Ex ranges can target lines between two search patterns without selecting text manually.
command-line #command-line #ex-commands #ranges #search #editing
:undojoin<CR>
By default, separate edits often become separate undo entries, which makes replaying or backing out a multi-part change noisy.
\d \w \s \a \l \u
How it works Vim provides shorthand character classes that save you from writing out full bracket expressions.
!{motion}{program}
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.
/\%d{decimal}
Vim's regex engine supports special atoms that match characters by their numeric value rather than their glyph.
:[range]join
The :[range]join Ex command lets you join lines by specifying an explicit line range — without having to navigate there or use visual selection.