sponsor Vim development Vim logo Vim Book Ad

ez_scroll : Scroll a window using right click+drag

 script karma  Rating 28/13, Downloaded by 620  Comments, bugs, improvements  Vim wiki

created by
20iiid
 
script type
utility
 
description
Sometimes I prefer to use the mouse to scroll a file.  Like if I'm just reading a file and not editing it then my hands aren't going to be perched on the keyboard and so looking down to find the right keys to control the scrolling is going to be distressful.  Or if I'm looking at a different window or if I've just focused the window with the file in it and my hand is already on the mouse.  But scroll-bars --- with their variable sized beveled areas ---  are precision controls that require quite a lot of attention and sobriety to operate.  And if I'm less than a few pages from where I want to scroll to (like, maybe I'm reading the whole file line-by-line) and if the file is really large (like, maybe it's a book) then scroll-bars are just plain silly: You're looking at maybe a couple millimeters of beveled area that you've got to click on and then drag another couple millimeters.  Another medium that often has large files that one reads line-by-line is the pdf.  The designers of pdf reading software have noticed the scroll-bar issue and they've come up with what I think is a nice interface: You can right-click anywhere on the window with the `hand' cursor and just paw your way through the pages.  It's even enabled by default; so sure are they that this is what you're going to want to use to scroll around.  Another common way to scroll by less than a few lines with the mouse is the scroll-wheel interface.  That's already there in vim if you have `:set mouse=a' (and this is on in gvim by default).  But I really detest it.  It engenders a really awkward finger movement that I reserve for one activity only and it's not scrolling.  And I don't think that finger movement's good for your hand anyway and so it shouldn't be used outside of bed.  So after all of this, why not have the right-click and drag functionality in vim?  Right drag isn't used for anything else anyways.
 
install details
Either copy everything to your `.vimrc' or add `:source /path/to/ez_scroll.vim' to your `.vimrc'.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ez_scroll.vim 1.1 2010-07-05 7.2 20iiid Initial upload
ip used for rating: 3.12.161.77

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github