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 vertical diff between index and working tree for the current file in vim-fugitive?
When reviewing staged versus unstaged changes, jumping between terminal git commands and editor windows is slow.
category:
plugins
tags:
#plugins
#git
#diff
#fugitive
#review
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 make Vim diff ignore whitespace and use patience algorithm for clearer hunks?
:set diffopt+=iwhite,algorithm:patience
When whitespace-only churn and noisy line matching make diffs hard to review, tuning diffopt can dramatically improve signal.
category:
config
tags:
#config
#diff
#review
#whitespace
How do I tune diffopt so diffs align moved code and produce cleaner hunks?
:set diffopt+=algorithm:patience,indent-heuristic,linematch:60
Default diff settings can produce noisy hunks when code is moved, re-indented, or lightly refactored.
category:
config
tags:
#config
#diff
#review
#productivity
How do I put all visible windows into diff mode and balance their sizes in Vim?
:windo diffthis | wincmd =<CR>
When you already have multiple related buffers open, you can enter diff mode across all visible windows in one shot and then normalize layout width/height immed
category:
buffers-windows
tags:
#buffers
#windows
#diff
#ex-commands
How do I make Vim diff produce cleaner hunks and avoid hidden buffer errors?
:set diffopt+=algorithm:histogram,hiddenoff
Default diff behavior is fine for small changes, but larger refactors often produce noisy hunks and annoying warnings about hidden buffers.
category:
config
tags:
#config
#diff
#workflow
#options
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 use the patience diff algorithm in Vim to get cleaner diffs on source code?
:set diffopt+=algorithm:patience
Vim's default diff algorithm (Myers) can produce noisy diffs when working with code — it sometimes matches unrelated lines containing common tokens like {, },
category:
config
tags:
#config
#diff
How do I pull a diff change from another window into the current buffer in Vim?
The do command (diff obtain) is shorthand for :diffget.
category:
buffers-windows
tags:
#diff
#buffers
#editing
#normal-mode
How do I diff the current file against a specific git commit using vim-fugitive?
vim-fugitive's :Gdiffsplit opens a vertical split showing the current file diff against any git revision — not just HEAD.
category:
plugins
tags:
#plugins
#diff
#git
#buffers-windows
How do I jump between merge conflict markers in a file?
During a git merge, Vim can navigate directly between conflict markers (>>>>>>) using ]n and [n.
category:
navigation
tags:
#navigation
#diff
#merge
#conflicts
How do I resolve a 3-way merge conflict in vim-fugitive by picking a specific version?
When resolving Git merge conflicts with vim-fugitive, running :Gvdiffsplit! opens a 3-way split: your current branch (left), the working file with conflict mark
category:
plugins
tags:
#plugins
#git
#fugitive
#diff
#merge
How do I open a diff between my current buffer and the last saved version of the file?
:DiffOrig opens a side-by-side split comparing your current (unsaved) buffer against the version on disk.
category:
buffers-windows
tags:
#diff
#buffers
#editing
#workflow
#buffers-windows
How do I apply or reverse a diff change from one side to the other when using Vim's built-in diff mode?
When comparing files with :vimdiff or :diffthis, Vim highlights each difference as a hunk.
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
#vimdiff
How do I enable inline character-level diff highlighting in Neovim's diff mode?
:set diffopt+=linematch:60
Neovim's linematch diffopt enables intra-line diff highlighting — instead of marking an entire changed line, Neovim highlights only the specific characters th
category:
config
tags:
#config
#diff
#buffers-windows
How do I refresh the diff highlighting in Vim when it becomes stale after editing?
After making edits in a vimdiff session, the diff highlighting can become out of sync with the actual content — showing incorrect change markers or missing hu
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
How do I jump between diff hunks when comparing files with Vim's built-in diff mode?
When files are open in Vim's built-in diff mode — whether via vimdiff, :diffsplit, or :diffthis — the ]c and [c motions let you jump precisely between chang
category:
navigation
tags:
#navigation
#diff
#buffers-windows
#normal-mode
How do I selectively accept LOCAL or REMOTE changes in a three-way git merge using Vim?
When Vim is configured as a git mergetool, it opens a three-way split with the LOCAL (your branch), REMOTE (their branch), and MERGED (the output file) buffers.
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
#command-line
How do I get a more accurate diff that avoids matching unrelated lines?
:set diffopt+=algorithm:histogram
Switches Vim's diff algorithm from the default Myers algorithm to histogram, which produces more semantically meaningful diffs by avoiding false matches between
category:
config
tags:
#diff
#config
#buffers
#editing