How do I run a Vim command without triggering any autocommands?
:noautocmd write
The :noautocmd modifier (abbreviated :noa) runs any subsequent Ex command while temporarily disabling all autocommand events.
2277 results for "@a"
:noautocmd write
The :noautocmd modifier (abbreviated :noa) runs any subsequent Ex command while temporarily disabling all autocommand events.
:set winfixwidth
Setting winfixwidth on a window tells Vim not to adjust its width when other windows are created, closed, or resized with =.
<C-w>TgT
When a split temporarily becomes the center of attention, promoting it to its own tab can reduce layout noise.
<C-v>jjr<C-k>12
Visual block mode combined with the replace command and digraph input lets you replace a column of characters with special Unicode characters.
F{char}
The F command moves the cursor backward to the previous occurrence of a specified character on the current line.
:t {line-number}
The :t (copy/transfer) command duplicates the current line and places it after the specified line number.
:map <unique> {key} {rhs}
The modifier causes Vim to fail with an error if you try to create a mapping for a key that is already mapped in that mode.
:Lexplore %:p:h
When you are editing deep in a project, opening netrw from the working directory often puts you in the wrong place.
zh and zl
When wrap is disabled, long lines extend off-screen.
<C-r><C-r>
In command-line mode, {reg} inserts a register's contents — but it processes certain sequences, potentially misinterpreting backslashes, pipe characters, or e
:w !diff % -
The command :w !diff % - pipes the current buffer's contents to an external diff command that compares it against the saved file on disk.
buffers-windows #buffers-windows #ex-commands #editing #navigation
: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.
\@>
Vim's \@> syntax creates an atomic group in a regular expression.
qa0f:dwj0q
How it works When recording a macro that you plan to repeat across multiple lines, the key technique is to end the macro positioned on the next line, ready for
:g/./,/^$/join
Hard-wrapped text (where each sentence is on its own line) is common in commit messages, email threads, and older documentation.
<C-r><C-r>x
When you press x in insert mode to paste a register, Vim inserts the text "as if you typed it" — meaning autoindent, textwidth, and other insert behaviors can
:set wildmenu wildmode=longest:full,full
By default, Vim's command-line tab completion just cycles through options.
:cnoremap %% <C-r>=expand('%:h').'/'<CR>
By mapping %% in command-line mode, you can type %% wherever you would normally type a path and have Vim automatically expand it to the directory of the current
:ptag {identifier}
:ptag {identifier} opens a small preview window showing the definition of the given tag, while keeping your cursor in the original window.
:bwipeout
The :bwipeout command (:bw) completely removes a buffer from Vim's memory, including its marks, options, and variables.