What is the best way to do smooth scrolling in Vim?

后端 未结 10 1622
醉梦人生
醉梦人生 2021-01-30 03:01

The main scrolling commands in Vim are:

  1. Ctrl-B and Ctrl-F, as well as PageUp and PageDown scrol
10条回答
  •  孤街浪徒
    2021-01-30 03:23

    This isn't exactly smooth scrolling, but it's how I handle not losing context when jumping pages.

    set so=7

    '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.

提交回复
热议问题