Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/scroll.txt`
0ae0bfe4d514cb16257905391560aadba0de43acf7accb880000000100000edf
 hitting the end of the file there
			may be a difference).  When the cursor is on the first
			line of the buffer nothing happens and a beep is
			produced.  See also 'startofline' option.

<S-Up>		or					*<S-Up>* *<kPageUp>*
<PageUp>	or					*<PageUp>* *CTRL-B*
<S-->		or				*<S-Minus>* *SHIFT-MINUS*
CTRL-B			Scroll window [count] pages Backwards (upwards) in the
			buffer.  See also 'startofline' option.
			When there is only one window the 'window' option
			might be used.

							*z^*
z^			Without [count]: Redraw with the line just above the
			window at the bottom of the window.  Put the cursor in
			that line, at the first non-blank in the line.
			With [count]: First scroll the text to put the [count]
			line at the bottom of the window, then redraw with the
			line which is now at the top of the window at the
			bottom of the window.  Put the cursor in that line, at
			the first non-blank in the line.

==============================================================================
3. Scrolling relative to cursor				*scroll-cursor*

The following commands reposition the edit window (the part of the buffer that
you see) while keeping the cursor on the same line.  Note that the 'scrolloff'
option may cause context lines to show above and below the cursor.

							*z<CR>*
z<CR>			Redraw, line [count] at top of window (default
			cursor line).  Put cursor at first non-blank in the
			line.

							*zt*
zt			Like "z<CR>", but leave the cursor in the same
			column.

							*zN<CR>*
z{height}<CR>		Redraw, make window {height} lines tall.  This is
			useful to make the number of lines small when screen
			updating is very slow.  Cannot make the height more
			than the physical screen height.

							*z.*
z.			Redraw, line [count] at center of window (default
			cursor line).  Put cursor at first non-blank in the
			line.

							*zz*
zz			Like "z.", but leave the cursor in the same column.
			Careful: If caps-lock is on, this command becomes
			"ZZ": write buffer and exit!

							*z-*
z-			Redraw, line [count] at bottom of window (default
			cursor line).  Put cursor at first non-blank in the
			line.

							*zb*
zb			Like "z-", but leave the cursor in the same column.

==============================================================================
4. Scrolling horizontally				*scroll-horizontal*

For the following four commands the cursor follows the screen.  If the
character that the cursor is on is moved off the screen, the cursor is moved
to the closest character that is on the screen.  The value of 'sidescroll' is
not used.

z<Right>    or						*zl* *z<Right>*
zl			Move the view on the text [count] characters to the
			right, thus scroll the text [count] characters to the
			left.  This only works when 'wrap' is off.

z<Left>      or						*zh* *z<Left>*
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.

Title: Vim: Scrolling Relative to Cursor and Horizontally
Summary
This section of the Vim reference manual details commands for scrolling relative to the cursor (z<CR>, zt, z{height}<CR>, z., zz, z-, zb) and horizontally (zl, zh, zL, zH, zs, ze). The commands for scrolling relative to the cursor reposition the edit window while keeping the cursor on the same line, while horizontal scrolling commands move the view on the text left or right.