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 set a different working directory for each split window in Vim?
:lcd (local cd) sets the working directory for the current window only, leaving other windows at their previous directory.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
#config
How do I quickly switch between the current file and the last file I was editing?
:e # opens the alternate file — the file you were editing just before the current one.
category:
buffers-windows
tags:
#buffers
#editing
#ex-commands
#navigation
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 run the same command across all open buffers at once?
When you need to apply the same change to every file you have open in Vim, switching to each buffer manually is tedious and error-prone.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing
#batch
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 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 list only modified or active buffers in Vim?
The :ls command (or :buffers) supports filter flags that narrow the buffer list to specific states.
category:
buffers-windows
tags:
#buffers
#ex-commands
#workflow
#navigation
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 automatically equalize window sizes when the terminal is resized?
:autocmd WinResized * wincmd =
When you resize your terminal window, Vim's split layout can become unbalanced.
category:
buffers-windows
tags:
#buffers-windows
#autocmd
#resize
#layout
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 create a floating window in Neovim?
:lua vim.api.nvim_open_win(0, true, {relative='editor', width=80, height=20, row=5, col=10})
Neovim's floating windows hover above the main layout, creating popup-like UI elements.
category:
buffers-windows
tags:
#buffers-windows
#floating
#neovim
#api
How do I preview quickfix entries without leaving the quickfix window?
The preview window shows file contents temporarily without switching your editing context.
category:
buffers-windows
tags:
#buffers-windows
#quickfix
#preview
#navigation