vimmouse

Vim mouse wheel vertical scrolling just one line


How do I need to adjust my vimrc to make vertical scrolling smoother? I want to achieve that one iteration of the mouse wheel just scrolls one instead of three lines.


Solution

  • The relevant information is at :help scroll-mouse-wheel:

    For the Win32 GUI the scroll action is hard coded.  It works just like
    dragging the scrollbar of the current window.  How many lines are scrolled
    depends on your mouse driver.  If the scroll action causes input focus
    problems, see intellimouse-wheel-problems.
    
    For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
    presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
    <ScrollWheelRight>.
    

    So, if you're on Windows, you can only influence this globally through your driver, whereas on X, you can do

    :map <ScrollWheelUp> <C-Y>
    

    etc.