How do I keep multiple split windows scrolling and cursoring in sync?
:windo setlocal scrollbind cursorbind
When reviewing related files side by side, alignment drifts quickly if each window scrolls independently.
category:
buffers-windows
tags:
#buffers-windows
#windows
#scrolling
#comparison
How do I show the current buffer in a new tab without re-reading it from disk?
Sometimes you want a second workspace for the same file: one tab for broad navigation, another for focused edits or test-driven jumps.
category:
buffers-windows
tags:
#buffers-windows
#tabs
#workflow
#navigation
How do I continuously record and restore sessions with vim-obsession?
If you routinely work across many files, tabs, and split layouts, rebuilding your workspace after a restart is costly.
category:
plugins
tags:
#plugins
#sessions
#workflow
#buffers-windows
#productivity
How do I improve Vim diff readability for moved or reindented code blocks?
:set diffopt+=algorithm:histogram,indent-heuristic
Default diff behavior can produce noisy hunks when code is moved or indentation changes significantly.
category:
config
tags:
#config
#buffers-windows
#ex-commands
#formatting
How do I enable diff mode in every open split at once?
If you already have several related files open in splits, enabling diff mode one window at a time is slow and error-prone.
category:
buffers-windows
tags:
#buffers-windows
#diff
#windows
#ex-commands
How do I open a scratch split that is not listed and disappears when I close it?
:vnew | setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
For quick throwaway notes, command output cleanup, or temporary edits, a normal buffer is noisy: it appears in :ls, can prompt you to save, and may leave swap a
category:
buffers-windows
tags:
#buffers-windows
#buffers
#windows
#scratch
#workflow
How do I tune Vim diff mode for more readable side-by-side hunks?
:set diffopt+=vertical,algorithm:patience,indent-heuristic
Default diff behavior can look noisy on refactors where blocks move or indentation shifts.
category:
config
tags:
#config
#diff
#review
#buffers-windows
How do I jump to an already-open file window instead of opening duplicate buffers?
When the same file is already open elsewhere, using :edit can create extra navigation friction because you stay in the current window and may lose layout contex
category:
buffers-windows
tags:
#buffers-windows
#windows
#buffers
#workflow
How do I integrate a custom build tool like cargo or pytest with Vim's :make and quickfix workflow?
The makeprg option defines the command that :make runs.
category:
config
tags:
#config
#ex-commands
#buffers-windows
How do I execute a single normal mode command inside a Neovim terminal buffer without fully leaving terminal mode?
In a Neovim terminal buffer, exits to normal mode permanently.
category:
buffers-windows
tags:
#terminal
#buffers-windows
#insert-mode
#neovim
#normal-mode
How do I open a file in Vim without triggering any autocmds for faster loading?
When you have heavy autocmds registered for BufRead, BufEnter, or FileType events — such as LSP clients, formatters, or syntax processors — opening a large
category:
command-line
tags:
#command-line
#ex-commands
#buffers-windows
#config
How do I control windows using Ex commands in scripts and mappings instead of Ctrl-W shortcuts?
:wincmd {key} is the Ex command equivalent of every {key} window shortcut.
category:
buffers-windows
tags:
#buffers-windows
#windows
#ex-commands
#normal-mode
How do I save multiple different views of the same file with independent fold and cursor states?
:mkview 2 and :loadview 2
Vim supports up to 9 numbered view slots per file.
category:
buffers-windows
tags:
#folding
#buffers-windows
#navigation
#config
How do I push or pull a single diff hunk between buffers with a single keystroke in diff mode?
In Vim's diff mode, dp (diff put) and do (diff obtain) are single-keystroke shorthands for :diffput and :diffget.
category:
buffers-windows
tags:
#diff
#buffers-windows
#editing
#normal-mode
How do I open a file under the cursor in a new split and jump to its line number in Vim?
F opens the filename under the cursor in a new horizontal split window and jumps to the line number that follows the filename.
category:
buffers-windows
tags:
#navigation
#buffers-windows
#windows
#editing
How do I mark multiple files in netrw and batch copy or move them to another directory?
Netrw, Vim's built-in file browser, supports a full marking system that lets you select multiple files and then perform bulk copy, move, or delete operations on
category:
buffers-windows
tags:
#buffers-windows
#navigation
#editing
How do I read or modify the lines of a buffer that is not currently displayed without switching to it?
getbufline() / setbufline()
The getbufline() and setbufline() functions let you inspect and update any loaded buffer's contents from Vimscript without switching the active window.
category:
buffers-windows
tags:
#buffers-windows
#ex-commands
How do I allow split windows to collapse completely to just their status line?
By default, Vim enforces a minimum window height of 1 line, which means you can never fully collapse a split.
category:
buffers-windows
tags:
#buffers-windows
#windows
#splits
#navigation
How do I clear all entries from the quickfix list in Vim?
After a :grep, :make, or :vimgrep run, the quickfix list fills with results.
category:
command-line
tags:
#command-line
#buffers-windows
#quickfix
#ex-commands
How do I resize the current window to an exact number of lines from the command line?
The z{height} command simultaneously resizes the current window to exactly {height} lines, scrolls so the current line sits at the top of the window, and moves
category:
buffers-windows
tags:
#buffers-windows
#windows
#resize
#navigation