Monday, February 21, 2011

How do I get the terminal within GVim to react to mouse scrolls?

I'm on a Hardy Heron Ubuntu build, BTW.

From stackoverflow
  • Hate to give this answer, because it isn't very helpful, but it works fine for me (scroll wheel in gvim on ubuntu hardy).

    But maybe I can suggest some things that help debug the issue:

    1. Confirm you are running "gvim" and trying to scroll the new window that comes up (i.e. you are not running vim in an xterm and trying to scroll that with the mouse)
    2. Confirm the scroll wheel works in other apps. Use "xev" to make sure the X server is seeing the scroll events if you're unsure.

    Hope that helps.

    : The scroll wheel works fine for the rest of the Gvim's modes. The only place where the problem appears is when the console's ":!" output exceeds the window size. (It works the way it's supposed to when I'm under gnome-terminal and xterm, though.)
  • Try:

    :set mouse=a

    ":help mouse" says

    Enable the use of the mouse.  Only works for certain terminals
    (xterm, MS-DOS, Win32 |win32-mouse|, qnx pterm, and Linux console
    with gpm).  For using the mouse in the GUI, see |gui-mouse|.
    The mouse can be enabled for different modes:
     n Normal mode
     v Visual mode
     i Insert mode
     c Command-line mode
     h all previous modes when editing a help file
     a all previous modes
     r for |hit-enter| and |more-prompt| prompt
     A auto-select in Visual mode
    Normally you would enable the mouse in all four modes with: >
     :set mouse=a
    When the mouse is not enabled, the GUI will still use the mouse for
    modeless selection.  This doesn't move the text cursor.
    

0 comments:

Post a Comment