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 toggle common Vim options like spell, wrap, and number with single keystrokes using vim-unimpaired?
The vim-unimpaired plugin adds a set of paired bracket mappings, including a powerful family of option toggles.
category:
plugins
tags:
#config
#plugins
#editing
How do I create a self-repeating recursive macro that runs until it reaches the end of the file?
A recursive macro calls itself at the end of its recording, causing it to repeat automatically until an error — such as reaching the end of the file — stops
category:
macros
tags:
#macros
#registers
#editing
How do I undo or redo to a specific point in time using time-based undo navigation?
:earlier {time} and :later {time}
Vim's :earlier and :later commands let you navigate the undo history by elapsed time rather than by edit count.
category:
command-line
tags:
#undo-redo
#ex-commands
#editing
How do I match text only when it is followed by a specific pattern using zero-width lookahead?
Vim's regex engine supports zero-width positive lookahead via the \@= operator.
category:
search
tags:
#search
#regex
#lookahead
#advanced
#pattern
How do I insert an actual newline in a substitution replacement, and why does backslash-n not work?
In Vim substitutions, \r in the replacement string inserts a line break, creating a new line.
category:
editing
tags:
#editing
#search
#substitute
#newline
#regex
How do I check which language servers are attached to the current buffer and debug my LSP setup in Neovim?
The :LspInfo command, provided by the nvim-lspconfig plugin, opens a diagnostic floating window showing every active LSP client and its configuration for the cu
category:
plugins
tags:
#plugins
#lsp
#neovim
#debugging
#lspconfig
How do I execute Lua code directly from the Neovim command line without writing a script file?
Neovim's :lua command lets you run arbitrary Lua code inline from the command line.
category:
command-line
tags:
#command-line
#lua
#neovim
#vimscript
#advanced
How do I write a Vim regex that matches any character including newlines for multi-line pattern matching?
In Vim's regular expressions, .
category:
search
tags:
#search
#regex
#multiline
#advanced
#pattern
How do I jump to the start or end of a C-style block comment from anywhere inside or near it?
The [ and ] motions (also written as [/ and ]/) let you jump directly to the opening / or closing / of a C-style block comment.
category:
navigation
tags:
#navigation
#search
#normal-mode
How do I read or modify the lines of a buffer that is not currently displayed without switching to it?
getbufline() / setbufline()
The getbufline() and setbufline() functions let you inspect and update any loaded buffer's contents from Vimscript without switching the active window.
category:
buffers-windows
tags:
#buffers-windows
#ex-commands
How do I access event-specific data like yank contents or inserted characters inside a Vim autocommand?
The v:event dictionary is populated inside certain autocommand callbacks with data specific to that event.
category:
config
tags:
#config
#ex-commands
#registers
How do I scope a Vimscript variable to a specific buffer, window, tab, or script to avoid conflicts?
Vimscript variables are prefixed with a one-letter scope identifier followed by a colon.
category:
config
tags:
#config
#ex-commands
How do I zero-pad or reformat numbers during a substitution using printf in Vim?
:%s/\d\+/\=printf('%03d', submatch(0))/g
Combining Vim's \= expression substitution with the printf() function lets you apply arbitrary formatting to matched text.
category:
search
tags:
#search
#substitution
#ex-commands
#editing
How do I make Tab and Enter behave differently when the completion popup menu is open?
The pumvisible() function returns 1 when the insert-mode completion popup menu (pum) is visible, and 0 otherwise.
category:
config
tags:
#config
#insert-mode
#completion
How do I highlight a custom pattern persistently in a window without changing the search register?
The matchadd() function adds a persistent highlight for a pattern in the current window without touching your search register or interfering with n/N navigation
category:
search
tags:
#search
#config
#visual-mode
#normal-mode
How do I use the patience diff algorithm in Vim to get cleaner diffs on source code?
:set diffopt+=algorithm:patience
Vim's default diff algorithm (Myers) can produce noisy diffs when working with code — it sometimes matches unrelated lines containing common tokens like {, },
category:
config
tags:
#config
#diff
How do I scroll the view left and right one column at a time when line wrapping is off?
When wrap is disabled, long lines extend off-screen.
category:
navigation
tags:
#navigation
#scrolling
How do I jump back to where the cursor was when I last left a buffer?
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
category:
navigation
tags:
#navigation
#marks
#buffers
How do I search for the word under my cursor across all project files using Telescope?
require('telescope.builtin').grep_string()
Telescope's grepstring() function performs a project-wide search for the exact word currently under the cursor, displaying live-previewed results in an interact
category:
plugins
tags:
#plugins
#search
#navigation
#telescope