How do I turn custom command output like file:line:col:message into a navigable quickfix list?
:setlocal errorformat=%f:%l:%c:%m | cexpr system('tool %') | copen
Not every linter or internal script speaks Vim quickfix format out of the box.
category:
command-line
tags:
#command-line
#quickfix
#errorformat
#linting
#workflow
How do I make Tab trigger wildmenu completion inside a custom mapping?
By default, pressing in a : mapping inserts a literal tab character rather than triggering wildmenu completion.
category:
config
tags:
#config
#ex-commands
#completion
#command-line
How do I create a normal mode mapping that correctly captures and passes a count prefix to a function?
nnoremap <key> :<C-u>call MyFunc(v:count)<CR>
When writing custom mappings that call Vimscript functions, a common pitfall is that any count you type before the key (e.
category:
config
tags:
#config
#macros
#ex-commands
#normal-mode
How do I execute a recorded macro a specific number of times?
Prefix the @ macro-execution command with a count to run the macro that many times in a row.
category:
macros
tags:
#macros
#registers
#normal-mode
#editing
How do I mark multiple files in netrw and batch copy or move them to another directory?
Netrw, Vim's built-in file browser, supports a full marking system that lets you select multiple files and then perform bulk copy, move, or delete operations on
category:
buffers-windows
tags:
#buffers-windows
#navigation
#editing
How do I apply a recorded macro to every line in a visual selection?
Combining :normal with a visual range lets you replay a macro on each line of a selection individually — far more targeted than recursive macros or @@ repeati
category:
macros
tags:
#macros
#ex-commands
#normal-mode
#visual-mode
How do I align key=value pairs on one line using a substitute expression in Vim?
:s/\v(\S+)\s*=\s*(.*)/\=printf('%-20s = %s', submatch(1), submatch(2))/
When a line contains uneven key = value spacing, quick manual fixes are easy to get wrong.
category:
editing
tags:
#editing
#substitute
#regex
#formatting
How do I send Telescope results to the quickfix list for bulk editing?
While inside any Telescope picker, pressing sends all current results to the quickfix list and closes the picker.
category:
plugins
tags:
#plugins
#search
#quickfix
#buffers-windows
How do I paste from a register while staying in insert mode?
Pressing followed by a register name in insert mode inserts the contents of that register at the cursor position without leaving insert mode.
category:
registers
tags:
#editing
#insert-mode
#registers
#productivity
How do I run the same command across all open buffers at once?
When you need to apply the same change to every file you have open in Vim, switching to each buffer manually is tedious and error-prone.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing
#batch
How do I navigate quickfix and location list entries with intuitive bracket mappings?
The vim-unimpaired plugin by Tim Pope provides bracket-pair mappings for navigating quickfix and location list entries: [q moves to the previous entry and ]q mo
category:
plugins
tags:
#plugins
#navigation
#quickfix
How do I run a find-and-replace across multiple files at once using the argument list?
:args **/*.py | argdo %s/old/new/ge | update
Combining :args, :argdo, and :update gives you a powerful in-editor multi-file search and replace without leaving Vim.
category:
command-line
tags:
#ex-commands
#editing
#macros
#search
How do I make my macros robust regardless of cursor position?
A common macro pitfall is assuming the cursor starts at a specific column.
category:
macros
tags:
#macros
#recording
#best-practices
#workflow
How do I make a macro repeat itself until it fails?
A recursive macro calls itself at the end of its recording, causing it to repeat indefinitely until a command inside it fails (like a search hitting the end of
category:
macros
tags:
#macros
#registers
#editing
#automation
How do I browse and edit my backward search history in a full Vim buffer?
Vim provides three command-line history windows accessible from normal mode: q: for Ex commands, q/ for forward searches, and q? for backward searches.
category:
search
tags:
#search
#command-line
#navigation
How do I mark and delete multiple files at once from within Vim's built-in file explorer netrw?
Vim's built-in file browser netrw (opened with :Explore or :Ex) supports a full file management workflow beyond simple navigation.
category:
plugins
tags:
#navigation
#buffers
#ex-commands
How do I make j and k navigate display lines normally but physical lines when given a count?
nnoremap <expr> j v:count == 0 ? 'gj' : 'j'
By default, j and k move by physical lines (newline-delimited), which jumps over the entire visual span of a long wrapped line in a single keystroke.
category:
config
tags:
#navigation
#config
#motions
#normal-mode
How do I edit the contents of a macro register without re-recording it?
: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.
category:
macros
tags:
#macros
#registers
#editing
#normal-mode
How do I cycle through the numbered delete registers using the dot command?
When you paste from a numbered register with "1p, Vim's dot command (.
category:
registers
tags:
#registers
#editing
#normal-mode
#undo-redo
How do I insert the entire current line into the command line without typing it?
Pressing on the command line inserts the full text of the current buffer line (the line the cursor is on when you pressed :) directly at the command-line cursor
category:
command-line
tags:
#command-line
#editing
#navigation