Настройте смещение прокрутки с помощью следующей опции.
:set scrolloff=NUMBER
Где NUMBER
- количество строк вокруг курсора.
Выдержка из встроенной справочной системы Vim:
'scrolloff' 'so' number (default 0)
global
{not in Vi}
Minimal number of screen lines to keep above and below the cursor.
This will make some context visible around where you are working. If
you set it to a very large value (999) the cursor line will always be
in the middle of the window (except at the start or end of the file or
when long lines wrap).
For scrolling horizontally see 'sidescrolloff'.
NOTE: This option is set to 0 when 'compatible' is set.