How do I search for a pattern that spans multiple lines in Vim?
/pattern\_s\+next
Vim's regular expressions support multi-line matching through underscore-prefixed atoms.
2277 results for "@a"
/pattern\_s\+next
Vim's regular expressions support multi-line matching through underscore-prefixed atoms.
:let @q = 'commands'
Macros in Vim are just text stored in named registers.
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
The map modifier turns a mapping's right-hand side into a Vimscript expression that is evaluated at the time the key is pressed, with its return value used as t
@q
A recursive macro is a macro that calls itself as its last step, causing it to loop automatically until an operation fails (such as reaching the end of the file
:lua require'dap'.toggle_breakpoint()
The nvim-dap plugin implements the Debug Adapter Protocol in Neovim, providing a full debugging experience with breakpoints, step-through execution, variable in
:echo string(getreg('q'))
Macros can fail for subtle reasons: hidden control keys, extra whitespace, or unexpected register contents.
registers #registers #macros #debugging #automation #command-line
:tag /pattern
When working with ctags, you typically jump to exact tag names with .
80i-<Esc>
Vim's insert commands accept a count prefix that repeats everything you type.
globpath(&rtp, 'pattern')
globpath() is a Vimscript function that searches all directories in a given path list for files matching a glob pattern.
vim.snippet.expand()
Neovim 0.
:r !command
The :r !command command executes a shell command and inserts its output directly into the current buffer below the cursor line.
:execute "normal! gg=G"<CR>
:execute lets you build and run Ex commands dynamically, which is critical when a command depends on variables, conditionals, or string composition.
command-line #command-line #ex-commands #normal-mode #automation
:lfdo normal! @q | update
When you already have a curated location list, :lfdo lets you apply a change only to those files instead of touching your whole project.
macros #macros #location-list #refactoring #command-line #normal-mode
vipJ
When text is hard-wrapped for readability in git diffs or markdown source, you sometimes need the paragraph as a single line for refactoring, search, or export.
:wincmd {key}
:wincmd is the Ex command equivalent of any keystroke.
:set nrformats-=octal
Vim's and increment and decrement numbers under the cursor.
<C-v> (command-line mode)
In command-line mode (after : or /), pressing followed by any key inserts that key literally — bypassing all key notation, mappings, and special interpretatio
:%!xxd
Vim can serve as a hex editor by piping buffer contents through xxd, a hex dump utility that ships with Vim.
5<C-o>
Most Vim users know jumps backward in the jumplist, but fewer use a count with it.
:'<,'>norm {commands}
The :normal (or :norm) command lets you execute normal mode keystrokes from the command line.
command-line #editing #ex-commands #normal-mode #productivity #ranges