How do I apply a macro across multiple files at once?
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
macros #macros #batch-editing #multi-file #ex-commands #workflow
1029 results for "i" a""
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
macros #macros #batch-editing #multi-file #ex-commands #workflow
<C-t> / <C-d>
While in Insert mode, you can adjust indentation without switching back to Normal mode.
zt
The zt command repositions the viewport so that the line where your cursor sits moves to the top of the screen, without changing your cursor position within the
navigation #navigation #scrolling #normal-mode #viewport #productivity
vim: set ts=2 sw=2 et:
Modelines are special comments at the top or bottom of a file that Vim reads to apply file-specific settings.
<C-x><C-l>
The command triggers whole-line completion in insert mode.
augroup name | autocmd! | ... | augroup END
Using augroup with autocmd! inside prevents duplicate autocommands from accumulating when you reload your vimrc.
<C-n> / <C-p>
Vim has a powerful built-in completion system that requires zero plugins.
:compiler gcc | :make
Vim ships with built-in compiler plugins that configure makeprg and errorformat for popular tools.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
gv
The gv command reselects the exact same area that was last selected in visual mode.
<C-v>jjlU
Visual block mode lets you select rectangular regions of text, which means you can target a specific column and apply case changes only to that area.
cc
The cc command deletes the entire content of the current line (preserving indentation) and enters insert mode.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
:set cursorline
The cursorline option highlights the entire line where the cursor is positioned.
f{char} ; ,
The f, F, t, and T motions search for a character on the current line.
g]
g] is the disambiguation-aware alternative to .
M to move to the middle, L to move to the bottom
How it works Vim offers three commands to jump the cursor to specific vertical positions on the visible screen without scrolling: H moves to the top of the scre
<C-r>=
The expression register (=) lets you evaluate Vimscript expressions on the fly and insert the result directly into your text.
registers #editing #insert-mode #registers #productivity #math
:set lazyredraw
When Vim runs a macro or an :argdo / :bufdo loop, it redraws the screen after every command by default.
:windo diffthis
The :windo diffthis command activates Vim's built-in diff mode across all visible windows, highlighting the differences between them.