How do I run the same command across all windows, buffers, or tabs?
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#batch-editing
#ex-commands
How do I find and open a file by name without knowing its full path?
The :find command searches for a file by name across all directories in your path setting and opens it.
category:
buffers-windows
tags:
#buffers
#file-management
#navigation
#workflow
How do I browse through my previous quickfix lists?
Vim remembers up to 10 previous quickfix lists.
category:
buffers-windows
tags:
#buffers
#quickfix
#navigation
#history
How do I switch to a buffer by typing part of its filename?
The :b (buffer) command accepts partial filename matching with tab completion.
category:
buffers-windows
tags:
#buffers
#navigation
#completion
#workflow
How do I use the alternate file register to quickly reference the previous file?
"#p or <C-r># in insert mode
The # register always contains the name of the alternate file — typically the file you were editing just before the current one.
category:
registers
tags:
#registers
#buffers
#file-management
#workflow
How do I use Vim tabs as separate workspaces with different working directories?
:tabnew | lcd /path/to/project
Vim's :lcd (local change directory) sets the working directory per window.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#workflow
#project-management
How do I fuzzy-search and switch between open buffers in Vim?
The fzf.
category:
plugins
tags:
#plugins
#fzf
#buffers
#navigation
#workflow
How do I use tab pages in Vim to organize multiple files?
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#navigation
#productivity
How do I quickly switch between the current file and the last edited file?
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
category:
buffers-windows
tags:
#navigation
#buffers
#normal-mode
#productivity
#windows
How do I switch between buffers without being forced to save first?
By default, Vim refuses to let you switch away from a buffer that has unsaved changes, forcing you to save or discard with :w or :e! before moving on.
category:
config
tags:
#config
#buffers
#vimrc
#productivity
#workflow
How do I rearrange window splits by moving a window to a different side of the screen?
<C-w>H / <C-w>J / <C-w>K / <C-w>L
The H, J, K, and L commands move the current window to the far left, bottom, top, or right of the screen respectively, rearranging your entire split layout.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#splits
#layout
How do I run a macro across all open buffers at once?
The :bufdo command executes an Ex command in every open buffer, and when combined with :normal @a, it replays macro a across all of them.
category:
macros
tags:
#macros
#buffers
#ex-commands
#automation
#productivity
How do I save my entire Vim workspace and restore it later?
:mksession / :source Session.vim
Vim's session feature saves a snapshot of your entire workspace — open buffers, window layout, tab pages, current directory, and more — to a file that you c
category:
buffers-windows
tags:
#buffers
#windows
#config
#productivity
#workflow
#session
How do I browse and manage files using Vim's built-in file explorer?
:Explore / :Vexplore / :Sexplore
Vim ships with netrw, a built-in file explorer that lets you browse directories, open files, create new files, rename, and delete — all without plugins.
category:
buffers-windows
tags:
#navigation
#buffers
#file-management
#netrw
#productivity
How do I open a file path that appears in my code without manually typing it?
The gf command ("go to file") opens the file whose path is under the cursor.
category:
navigation
tags:
#navigation
#normal-mode
#buffers
#productivity
#file-management
How do I set a mark that works across different files?
Uppercase marks (A-Z) are global marks — they remember not only the line and column position, but also the file where they were set.
category:
navigation
tags:
#navigation
#marks
#normal-mode
#buffers
#productivity
How do I create a temporary scratch buffer for quick notes without saving a file?
:enew | setlocal buftype=nofile bufhidden=wipe noswapfile
A scratch buffer is a temporary, unnamed buffer that exists only in memory — it won't prompt you to save when you close it and leaves no trace on disk.
category:
buffers-windows
tags:
#buffers
#editing
#ex-commands
#productivity
#workflow
How do I switch between split windows in Vim?
The (Ctrl+w Ctrl+w) command cycles the cursor to the next window in the current tab.
category:
buffers-windows
tags:
#buffers
#windows
#navigation
#normal-mode
How do I insert the contents of another file into the current buffer?
The :r filename command reads the contents of filename and inserts them into the current buffer below the cursor line.
category:
command-line
tags:
#ex-commands
#editing
#buffers
How do I switch to the next buffer in Vim?
The :bnext (or :bn for short) command switches to the next buffer in Vim's buffer list.
category:
buffers-windows
tags:
#buffers
#ex-commands
#navigation