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.
:bufdo {cmd}
:bufdo executes an Ex command in each open buffer in sequence, cycling through every buffer in the buffer list.
:sball
The :sball command (short for split all) opens every loaded buffer in its own horizontal split window in one shot.
:args **/*.js
The :args command populates Vim's argument list with files matching a glob pattern, turning any set of files into a navigable list and enabling project-wide bat
- (vim-vinegar)
The vim-vinegar plugin by Tim Pope enhances Neovim's built-in netrw file browser.
:pedit
Vim has a built-in preview window — a special window distinct from regular splits.
:e +/pattern filename
The +{cmd} flag on :edit (and most file-opening commands) runs an Ex command immediately after the file loads.
command-line #command-line #ex-commands #navigation #search #buffers
set path+=**
By adding to Vim's path option, you enable recursive directory search — which makes :find with tab completion a lightweight project-wide fuzzy finder, no plug
:argdo %s/old/new/g | w
:argdo {cmd} executes an Ex command against every file in the argument list—the set of files you opened Vim with or set explicitly with :args.
:sbuffer {N}
:sbuffer {N} opens buffer number N in a new horizontal split, leaving your current window untouched.
buffers-windows #buffers-windows #buffers #windows #navigation
]q
The vim-unimpaired plugin (by Tim Pope) provides a consistent [x / ]x mnemonic for navigating any list-like structure in Vim.
<C-w><C-^>
Press (Ctrl+W followed by Ctrl+6) to open the alternate file in a horizontal split.
set wildmode=lastused
With wildmode=lastused, :b cycles buffers in most-recently-used order instead of alphabetically.
set wildcharm= then nnoremap b :b
wildcharm sets the key that triggers wildmenu expansion inside mappings.
:Telescope buffers
:Telescope buffers opens a fuzzy-searchable list of all open buffers.
:keepalt e {file}
Every time you open a file with :edit, Vim updates the alternate file register (#) to the previous buffer.
buffers-windows #buffers #ex-commands #registers #navigation
:G log -- %
vim-fugitive's :G log -- % loads the git commit history for the current file into a quickfix-style log buffer.
:windo {cmd}
:windo {cmd} executes an Ex command in every window in the current tab page, cycling through each one and applying the command before returning focus to the ori
buffers-windows #windows #buffers #ex-commands #buffers-windows
:e +{line} {file}
The :edit command accepts a +{cmd} prefix that executes an Ex command immediately after the file is loaded.
command-line #buffers #ex-commands #navigation #command-line
:e %:r.html
In Vim's command line, % expands to the current buffer's filename.
command-line #ex-commands #command-line #buffers #navigation
:lcd
:cd changes the global working directory, affecting every window and tab in the session.