Vim includes a group of motions that move the cursor vertically relative to the screen:
Command | Action |
---|---|
H | cursor to line N from top of screen |
M | cursor to middle line of screen |
L | cursor to line N from bottom of screen |
Here is a brief demonstration of these commands and how they behave:
Initial Conditions
Siddhartha
by·Herman·Hesse
THE·SON·OF·THE·BRAHMAN
In·the·shade·of·the·house,·in·the·sunshine·of·the·riverbank·near·the
boats,·in·the·shade·of·the·Salwood·forest,·in·the·shade·of·the·fig
tree·is·where·Siddhartha·grew·up,·the·handsome·son·of·the·Brahman,·the
NORMAL
Top
1:1
Move the cursor to bottom of screen
L
Siddhartha
by·Herman·Hesse
THE·SON·OF·THE·BRAHMAN
In·the·shade·of·the·house,·in·the·sunshine·of·the·riverbank·near·the
boats,·in·the·shade·of·the·Salwood·forest,·in·the·shade·of·the·fig
tree·is·where·Siddhartha·grew·up,·the·handsome·son·of·the·Brahman,·the
NORMAL
90%
9:1
Move the cursor to middle of screen
M
Siddhartha
by·Herman·Hesse
THE·SON·OF·THE·BRAHMAN
In·the·shade·of·the·house,·in·the·sunshine·of·the·riverbank·near·the
boats,·in·the·shade·of·the·Salwood·forest,·in·the·shade·of·the·fig
tree·is·where·Siddhartha·grew·up,·the·handsome·son·of·the·Brahman,·the
NORMAL
50%
5:1
Move the cursor to top of screen
H
Siddhartha
by·Herman·Hesse
THE·SON·OF·THE·BRAHMAN
In·the·shade·of·the·house,·in·the·sunshine·of·the·riverbank·near·the
boats,·in·the·shade·of·the·Salwood·forest,·in·the·shade·of·the·fig
tree·is·where·Siddhartha·grew·up,·the·handsome·son·of·the·Brahman,·the
NORMAL
Top
1:1