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.
:autocmd WinResized * wincmd =
When you resize your terminal window, Vim's split layout can become unbalanced.
:set winfixheight
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
: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.
<C-w>z or :pclose
The preview window shows file contents temporarily without switching your editing context.
buffers-windows #buffers-windows #quickfix #preview #navigation
<C-w>R
Vim provides commands to rotate windows within a row or column, and to swap the current window with another.
:setlocal nobuflisted
Setting nobuflisted removes a buffer from the :ls output and buffer-switching commands like :bnext/:bprev, while keeping it loaded and accessible.
buffers-windows #buffers-windows #buffers #unlisted #management
:tabonly | %bdelete | edit #
When your Vim session becomes cluttered with many tabs and buffers, you can clean up by closing all tabs except the current one with :tabonly, then deleting all
:set autoread | autocmd FocusGained * checktime
When working with Git, build tools, or collaborators, files may change outside Vim.
buffers-windows #buffers-windows #autoread #file-detection #external-changes
:nnoremap ]b :bnext<CR>
Mapping ]b and [b to :bnext and :bprev creates an intuitive bracket-style navigation for buffers, matching the convention used by unimpaired.
buffers-windows #buffers-windows #navigation #mapping #buffers
:setlocal nomodifiable
While :set readonly prevents accidental writes, nomodifiable goes further by preventing any changes to the buffer contents entirely.
buffers-windows #buffers-windows #readonly #modifiable #protection
<C-w>_ and <C-w>|
When working with multiple splits, you sometimes need to focus on one window temporarily without closing the others.
:checktime
The :checktime command tells Vim to check whether any open buffers have been modified outside of Vim and prompt you to reload them.
:bufdo %s/old/new/ge | update
The :bufdo command executes an Ex command in every loaded buffer.
buffers-windows #buffers #ex-commands #editing #substitution
<C-w>_ and <C-w>=
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.
:resize +N / :resize -N
:resize adjusts the height of the current window by a relative or absolute amount.
:sb {buffer}
The :sb (short for :sbuffer) command opens a buffer that is already loaded in Vim in a new horizontal split window.
:ls!
:ls (or :buffers) shows Vim's buffer list, but it hides unlisted buffers — help files, directory listings (netrw), terminal buffers, and scratch buffers marke
<C-w>n
n creates a new empty buffer and opens it in a horizontal split above the current window.
:vertical diffsplit {file}
Vim has a built-in diff mode that highlights added, removed, and changed lines between two (or more) buffers.
:cnext
The quickfix list is Vim's built-in way to collect a list of positions — typically compiler errors, grep results, or linter warnings — and jump between them