It can often be useful to scroll the window without moving the cursor, for example when it helps to see the surrounding text. Vim provides a group of commands to do this for you:
Command | Action |
---|---|
zt | redraw, cursor line at top of window |
zz | redraw, cursor line at center of window |
zb | redraw, cursor line at bottom of window |
Initial Conditions
he·would·join·the·glorious,·then·Govinda·wanted·to·follow·him·as·his
friend,·his·companion,·his·servant,·his·spear-carrier,·his·shadow.
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
NORMAL
91%
48:1
Scroll the cursor to the bottom of the screen
zb
decent,·stupid·sheep·in·the·herd·of·the·many.·No,·and·he,·Govinda,·as
well·did·not·want·to·become·one·of·those,·not·one·of·those·tens·of
thousands·of·Brahmans.·He·wanted·to·follow·Siddhartha,·the·beloved,·the
splendid.·And·in·days·to·come,·when·Siddhartha·would·become·a·god,·when
he·would·join·the·glorious,·then·Govinda·wanted·to·follow·him·as·his
friend,·his·companion,·his·servant,·his·spear-carrier,·his·shadow.
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
NORMAL
98%
48:1
Scroll the cursor to the middle of the screen
zz
he·would·join·the·glorious,·then·Govinda·wanted·to·follow·him·as·his
friend,·his·companion,·his·servant,·his·spear-carrier,·his·shadow.
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
NORMAL
91%
48:1
Scroll the cursor to the top of the screen
zt
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
limbs·daily·in·the·bath·of·repentance,·sacrificing·in·the·dim·shade·of
the·mango·forest,·his·gestures·of·perfect·decency,·everyone's·love·and
joy,·he·still·lacked·all·joy·in·his·heart.·Dreams·and·restless·thoughts
came·into·his·mind,·flowing·from·the·water·of·the·river,·sparkling·from
NORMAL
84%
48:1
While the preceding commands allow the cursor to quickly be re-positioned in the screen, the following commands scroll the screen one line at a time, providing fine-tuned control over the content that is displayed around the cursor:
Command | Action |
---|---|
C-Y | Move screen up one line |
C-E | Move screen down one line |
Here is a quick demo:
Initial Conditions
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
limbs·daily·in·the·bath·of·repentance,·sacrificing·in·the·dim·shade·of
the·mango·forest,·his·gestures·of·perfect·decency,·everyone's·love·and
joy,·he·still·lacked·all·joy·in·his·heart.·Dreams·and·restless·thoughts
came·into·his·mind,·flowing·from·the·water·of·the·river,·sparkling·from
NORMAL
84%
48:1
Scroll the cursor one line down
<C-y>
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
limbs·daily·in·the·bath·of·repentance,·sacrificing·in·the·dim·shade·of
the·mango·forest,·his·gestures·of·perfect·decency,·everyone's·love·and
joy,·he·still·lacked·all·joy·in·his·heart.·Dreams·and·restless·thoughts
NORMAL
86%
48:1
Scroll the cursor one line down (again)
<C-y>
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
limbs·daily·in·the·bath·of·repentance,·sacrificing·in·the·dim·shade·of
the·mango·forest,·his·gestures·of·perfect·decency,·everyone's·love·and
NORMAL
87%
48:1
Scroll the cursor one line down (again)
<C-y>
friend,·his·companion,·his·servant,·his·spear-carrier,·his·shadow.
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
limbs·daily·in·the·bath·of·repentance,·sacrificing·in·the·dim·shade·of
NORMAL
89%
48:1
Scroll the cursor one line down (again)
<C-y>
he·would·join·the·glorious,·then·Govinda·wanted·to·follow·him·as·his
friend,·his·companion,·his·servant,·his·spear-carrier,·his·shadow.
Siddhartha·was·thus·loved·by·everyone.·He·was·a·source·of·joy·for
everybody,·he·was·a·delight·for·them·all.
But·he,·Siddhartha,·was·not·a·source·of·joy·for·himself,·he·found·no
delight·in·himself.·Walking·the·rosy·paths·of·the·fig·tree·garden,
sitting·in·the·bluish·shade·of·the·grove·of·contemplation,·washing·his
NORMAL
91%
48:1