How do I run a command on all open buffers at once?
:bufdo {cmd}
:bufdo executes an Ex command in each open buffer in sequence, cycling through every buffer in the buffer list.
488 results for ":e!"
:bufdo {cmd}
:bufdo executes an Ex command in each open buffer in sequence, cycling through every buffer in the buffer list.
:s/pattern/replace/flags
The substitute command supports several flags that modify its behavior.
y/{pattern}<CR>
Any operator in Vim can take a search motion as its argument.
autocmd BufNewFile *.py 0r ~/.vim/templates/python.py
When you create a new file in Vim (e.
:argdo %s/old/new/ge | update
Use :argdo to execute a command in every file in the argument list.
:set wildmode=list:longest
Vim's wildmode option controls how the command line behaves when you press to complete filenames, buffer names, or Ex commands.
:wn
:wn (short for :wnext) writes the current buffer to disk and immediately advances to the next file in the argument list.
:set jumpoptions=stack
By default Vim's jump list is a ring: if you press to go back several positions and then make a new jump, the list wraps around and future entries are preserved
xp
The xp command swaps the character under the cursor with the character to its right.
:%s/\w\+/(&)/g
In a Vim substitution, & in the replacement string expands to the entire matched text.
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
!{motion}{program}
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.
:'<,'>s/\%V\s\+$//
Sometimes you need to clean alignment artifacts in a rectangular region without touching the rest of each line.
visual-mode #visual-mode #substitution #regex #formatting #editing
de
The de command deletes from the cursor position to the end of the current word.
<C-w>d
Neovim 0.
buffers-windows #diagnostics #lsp #floating-window #neovim #buffers #windows
]q and [q
The vim-unimpaired plugin by Tim Pope provides pairs of bracket mappings for common navigation and toggling tasks.
yss"
The yss{char} mapping from the vim-surround plugin surrounds the entire current line (ignoring leading whitespace) with the chosen delimiter.
:cexpr system('rg --vimgrep "TODO"')
When you already know you want an external search tool, :cexpr lets you import results directly into quickfix without opening a terminal buffer or shelling out
:%s/\w\+/\u&/g
Vim's substitute command supports case-conversion modifiers in the replacement string.
:set wildoptions=fuzzy
Enables fuzzy matching for Neovim's command-line tab completion (wildmenu), so you can match any part of a filename, command, or option — not just from the be
command-line #completion #command-line #neovim #config #wildmenu