How do I run the same Ex command in every open window at once?
: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
category:
buffers-windows
tags:
#windows
#buffers
#ex-commands
#buffers-windows
How do I change the working directory for only the current window without affecting other windows or tabs?
:cd changes the global working directory, affecting every window and tab in the session.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#navigation
How do I open a split window that spans the full width or height of the editor instead of splitting only the current window?
When you split a window with :split or :vsplit, Vim subdivides only the current window.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#command-line
How do I open the current buffer in a new tab so I can view it independently?
:tab split opens the current buffer in a brand new tab page, giving you a second independent view of the same file.
category:
buffers-windows
tags:
#tabs
#buffers
#windows
#normal-mode
How do I accept or reject individual changes in Vim's diff mode?
When reviewing differences between files in Vim's built-in diff mode, dp and do let you selectively apply individual hunks without leaving the editor.
category:
buffers-windows
tags:
#buffers
#windows
#diff
#editing
How do I open the alternate (previously visited) buffer in a new split window?
Vim tracks the alternate buffer — the last file you were editing before the current one.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#windows
How do I control exactly where a new split window appears in Vim?
By default, Vim places horizontal splits below and vertical splits to the right (controlled by splitbelow and splitright).
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
#splits
How do I open a file in a new tab or switch to it if it is already open?
When working with many tabs, you often want to open a file — but only if it is not already open somewhere.
category:
buffers-windows
tags:
#buffers
#tabs
#navigation
#windows
How do I diff two files that are already open in Vim splits?
You often have two files open side by side and want to compare them without leaving Vim or launching vimdiff.
category:
navigation
tags:
#buffers
#windows
#editing
#navigation
How do I selectively merge changes between two files in Vim's diff mode?
When comparing two files side by side with :diffsplit or vim -d, you often want to pull specific changes from one file into another rather than accepting all di
category:
buffers-windows
tags:
#buffers
#windows
#editing
#ex-commands
How do I open a terminal in the current window instead of a new split?
By default, :terminal opens a new split window for the terminal emulator.
category:
buffers-windows
tags:
#terminal
#buffers
#windows
#shell
#ex-commands
How do I transfer diff hunks between files in Vim's diff mode?
When comparing two files side by side in Vim's diff mode (:diffsplit or vim -d file1 file2), you often want to accept or push individual changes between the fil
category:
navigation
tags:
#navigation
#editing
#buffers
#windows
How do I scroll and copy text from a terminal buffer in Vim?
When using Vim's built-in :terminal, the buffer is in Terminal-Job mode by default, meaning all keystrokes go to the running shell.
category:
buffers-windows
tags:
#terminal
#buffers
#windows
#normal-mode
How do I preview a tag definition in a preview window using :ptag?
The :ptag command opens a tag definition in a small preview window at the top of the screen, letting you read the definition without losing your place in the cu
category:
buffers-windows
tags:
#buffers
#windows
#tags
#preview
#navigation
How do I prevent a split window from being resized by Vim?
When you have a specific window you want to keep at a fixed size — like a terminal, log viewer, or reference file — winfixheight and winfixwidth prevent Vim
category:
buffers-windows
tags:
#buffers-windows
#windows
#resize
#layout
How do I rotate or swap window positions in Vim?
Vim provides commands to rotate windows within a row or column, and to swap the current window with another.
category:
buffers-windows
tags:
#buffers-windows
#windows
#rotate
#layout
How do I temporarily maximize a split window to full height or width?
When working with multiple splits, you sometimes need to focus on one window temporarily without closing the others.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#editing
How do I maximize a window to full height or make all windows equal size?
When working with multiple splits, you often want to focus on one window by making it as large as possible, then restore equal sizing when you're done.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#normal-mode
How do I open an existing buffer in a new split window?
The :sb (short for :sbuffer) command opens a buffer that is already loaded in Vim in a new horizontal split window.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
How do I open a file in a new tab in Vim?
Vim's tab pages let you keep separate window layouts open at the same time, each with its own set of splits.
category:
buffers-windows
tags:
#buffers
#tabs
#windows
#ex-commands