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

后端 未结 10 1596
醉梦人生
醉梦人生 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:32

    A Recent Plugin

    I have posted something similar here, but basically there is a great plugin that we can use now for scrolling, called terryma/vim-smooth-scroll. It provides a very nice and smooth scrolling.


    The install is quite easy:

    1 I use Vundle so I simply appended this in .vimrc.bundles :

    Bundle terryma/vim-smooth-scroll
    

    In the latest version of Vundle available today, 29th April of 2016, you can put this in your .vimrc:

    Plugin 'terryma/vim-smooth-scroll'
    

    2 As stated in the doc, you can set up 3 arguments: distance, duration and speed.

    I am using this in my .vimrc file:

    noremap   :call smooth_scroll#up(&scroll*2, 10, 4)
    noremap   :call smooth_scroll#down(&scroll*2, 10, 4)
    

提交回复
热议问题