How do I enable synchronized scrolling in every open window?
Answer
:windo setlocal scrollbind
Explanation
When reviewing related files side by side, manually keeping splits aligned wastes attention. scrollbind solves this by coupling window scroll positions, and :windo lets you enable it everywhere in one shot. This is especially useful for code review, refactors, and comparing generated output against source templates.
How it works
:windoexecutes an Ex command in each open windowsetlocalapplies the option per-window instead of globallyscrollbindlinks vertical scrolling behavior among bound windows
After running this command, moving through one window scrolls the others proportionally. Because the setting is local, you can selectively disable it in a specific pane later without touching the rest.
Example
Suppose you have three splits open:
left: old implementation
mid: new implementation
right: test file
Run:
:windo setlocal scrollbind
Now use <C-d> or j/k in one window and the other bound windows track the movement, keeping related sections visually aligned.
Tips
- Pair with
:setlocal cursorbindwhen you want cursor rows to stay synchronized too - Disable in all windows with
:windo setlocal noscrollbind