Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/scroll.txt`
32bd0dbb867402447e532aa1cad5e4c2f3305059144729300000000100000963

zh			Move the view on the text [count] characters to the
			left, thus scroll the text [count] characters to the
			right.  This only works when 'wrap' is off.

							*zL*
zL			Move the view on the text half a screenwidth to the
			right, thus scroll the text half a screenwidth to the
			left.  This only works when 'wrap' is off.

							*zH*
zH			Move the view on the text half a screenwidth to the
			left, thus scroll the text half a screenwidth to the
			right.  This only works when 'wrap' is off.

For the following two commands the cursor is not moved in the text, only the
text scrolls on the screen.

							*zs*
zs			Scroll the text horizontally to position the cursor
			at the start (left side) of the screen.  This only
			works when 'wrap' is off.

							*ze*
ze			Scroll the text horizontally to position the cursor
			at the end (right side) of the screen.  This only
			works when 'wrap' is off.

==============================================================================
5. Scrolling synchronously				*scroll-binding*

Occasionally, it is desirable to bind two or more windows together such that
when one window is scrolled, the other windows are also scrolled.  In Vim,
windows can be given this behavior by setting the (window-specific)
'scrollbind' option.  When a window that has 'scrollbind' set is scrolled, all
other 'scrollbind' windows are scrolled the same amount, if possible.  The
behavior of 'scrollbind' can be modified by the 'scrollopt' option.

When using the scrollbars or the mouse wheel, the binding only happens when
scrolling the window with focus (where the cursor is).  You can use this to
avoid scroll-binding for a moment without resetting options.

When a window also has the 'diff' option set, the scroll-binding uses the
differences between the two buffers to synchronize the position precisely.
Otherwise the following method is used.

							*scrollbind-relative*
Each 'scrollbind' window keeps track of its "relative offset", which can be
thought of as the difference between the current window's vertical scroll
position and the other window's vertical scroll position.  When one of the
'scrollbind' windows is asked to vertically scroll past the beginning or end
limit of its text, the window no longer scrolls, but remembers how far past
the limit it wishes to be.  The window keeps this information so that it can
maintain the same relative

Title: Vim: Horizontal Scrolling and Synchronous Scrolling (Scroll Binding)
Summary
This section describes the horizontal scrolling commands `zh`, `zL`, `zH`, `zs`, and `ze` in Vim, which move the view of the text horizontally. It also explains the concept of scroll binding, where multiple windows scroll together when one is scrolled, achieved by setting the 'scrollbind' option. The 'scrollopt' option modifies the behavior of scroll binding, and the feature is enhanced when the 'diff' option is also set.