Vim Recall繁體中文

Sync scroll binding

:syncbind

Example

Normal 0 / 2

Sync scroll binding.

Windows

left.txt Active
scrollbind on; topline=1
right.txt
scrollbind on; topline=3
Before & after

Before

Windows

left.txt Active
scrollbind on; topline=1
right.txt
scrollbind on; topline=3

After

Windows

left.txt Active
scrollbind on; topline=1
right.txt
scrollbind on; topline=1

Subject: :syncbind. Documentation-backed illustration; assumes two sufficiently tall scroll-bound buffers, scrollopt includes vertical binding and current left window at topline 1; not replay-verified. Synchronizes the relative offsets of scroll-bound windows. With the current left view at its top, the right view is brought to its top too; both buffers are unchanged.

Sample buffer
one
two
three
four
Cursor on line 1, column 1
Details & Vim help

Sync scroll binding. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :sync[bind] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.