Ⅰ. 插件描述
Make scrolling in Vim more pleasantⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'terryma/vim-smooth-scroll'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'terryma/vim-smooth-scroll'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'terryma/vim-smooth-scroll'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/terryma/vim-smooth-scroll
Ⅳ. 文档说明
# vim-smooth-scroll
About
[vim-smooth-scroll] makes scrolling in Vim nice and smooth. Find yourself completely lost every time you use Ctrl-f or Ctrl-b? You might want to give this plugin a try.
Installation
Install using [Pathogen], [Vundle], [Neobundle], or your favorite Vim package manager.
Quick Start
Map your favorite keys like below:
noremap <silent> <c-u> :call smooth_scroll#up(&scroll, 0, 2)<CR>
noremap <silent> <c-d> :call smooth_scroll#down(&scroll, 0, 2)<CR>
noremap <silent> <c-b> :call smooth_scroll#up(&scroll*2, 0, 4)<CR>
noremap <silent> <c-f> :call smooth_scroll#down(&scroll*2, 0, 4)<CR>Function
smooth_scroll#up and smooth_scroll#down both take the following 3 parameters. Customize it however you like
- __Distance__: This is the total number of lines you want to scroll
- _Duration__: This is how long you want each frame of the scrolling animation to last in __milliseconds__. Each frame will take _at least this amount of time. It could take more if Vim's scrolling itself is slow
- __Speed__: This is how many lines to scroll during each frame of the scrolling animation