smoothPageScroll 0.20

smoothPageScroll is a Vim plugin that offers smooth page scroll.
smoothPageScroll is a Vim plugin that offers smooth page scroll.

Developer comments

I found scrolling the number of winheight() is not always correct, because the file could have wrapped lines. Let's say if your window height is 40, but you only see 35 actual lines because you have 5 wrapped lines. Then by scrolling the number of winheight(), 5 lines would be over-scrolled. This script won't skip the extra lines for having wrapped lines.

This script also emualtes one of VIM's normal < PageDown > or < PageUp > behaviors: which is to display first or last 2 lines from the previous screen after scrolling, unless it reaches first or last line, or the current window is showing 3 lines or less.

Requirements:

Vim

INSTALLATION:

Copy the script in your plugin directory.

USAGE:

1) call them directly

:call SmoothPageScrollDown() to scroll page down
:call SmoothPageScrollUp() to scroll page up

2) or remap < PageDown > and < PageUp >
map < PageDown > :call SmoothPageScrollDown() < CR >
map < PageUp > :call SmoothPageScrollUp() < CR >

Developer comments

Personally, I remapped and keys, since in non-insert mode is not that useful (just move the cursor one position right). And many programs such as web browsers or Adobe Reader use space key to scroll page.
map :call SmoothPageScrollDown()
map :call SmoothPageScrollUp()

But remapping < S-Space > may not work on certain console or platform. So you might have to find another candidate, such as < M-Space >, < C-Space > or something else.

If the scrolling speed is too fast, you can delay scrolling speed more by adding g:smooth_page_scroll_delay in your [._]vimrc. Following line will delay extra 5 milliseconds per each line.

let g:smooth_page_scroll_delay = 5

What's New in This Release:

added a function to delay scroll speed

last updated on:
May 16th, 2008, 9:03 GMT
price:
FREE!
developed by:
Hosup Chung
homepage:
www.vim.org
license type:
GPL (GNU General Public License) 
category:
ROOT \ Text Editing&Processing \ Others
smoothPageScroll
Download Button

In a hurry? Add it to your Download Basket!

user rating 17

3.2/5
 

0/5

Rate it!

Add your review!

SUBMIT