Loading ...
Sorry, an error occurred while loading the content.
 

Mouse handling in urxvt

Expand Messages
  • Johannes Deutsch
    Hi all, i want to have mouse support for vim if it runs in urxvt v9.15. To achieve this i downloaded the latest version of vim which includes the latest
    Message 1 of 5 , Nov 20, 2012
      Hi all,

      i want to have mouse support for vim if it runs in urxvt v9.15.

      To achieve this i downloaded the latest version of vim which includes
      the latest patches along with mouse support for urxvt and compiled
      it. After that

      vim --version | grep urxvt

      yields

      +mouse_urxvt +mouse_xterm +multi_byte +multi_lang -mzscheme
      +netbeans_intg

      So i tested the mouse in vim (and set ttym=urxvt, mousemodel=extend
      and mouse=a inside vim) and observed strange actions in response of
      mouse events compared with ':h mouse-overview'. For instance :

      insert mode: single left click => cursor moves to position of the
      mouse pointer
      single right click => leave insert mode

      normal mode: single left click => make nothing
      single right click => make nothing

      visual mode: single left click => leave visual mode
      single right click => leave visual mode

      Does anybody observe similar mouse behavior for vim in conjunction with
      urxvt or even has a solution to this problem?

      With best regards and thanks for your time

      Johannes

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • John Little
      ... Just installed urxvt 9.15 from some Ubuntu repository, and my vim --version | grep urxvt says +mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm
      Message 2 of 5 , Nov 20, 2012
        On Wednesday, November 21, 2012 1:59:57 AM UTC+13, Johannes Deutsch wrote:
        > Hi all,
        >
        > i want to have mouse support for vim if it runs in urxvt v9.15.
        >
        > To achieve this i downloaded the latest version of vim which includes
        > the latest patches along with mouse support for urxvt and compiled
        > it. After that
        >
        > vim --version | grep urxvt
        >
        > yields
        >
        > +mouse_urxvt +mouse_xterm +multi_byte +multi_lang -mzscheme
        > +netbeans_intg

        Just installed urxvt 9.15 from some Ubuntu repository, and my
        vim --version | grep urxvt

        says

        +mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte +multi_lang

        (Hmm, what options did you use compiling vim? Did you get a "Huge version with GTK2-GNOME GUI" as shown by :ver in vim?)

        > So i tested the mouse in vim (and set ttym=urxvt, mousemodel=extend
        > and mouse=a inside vim) and observed strange actions in response of
        > mouse events compared with ':h mouse-overview'. For instance :
        >
        > insert mode: single left click => cursor moves to position of the
        > mouse pointer
        > single right click => leave insert mode:

        Running

        vim -u NONE -N -c 'set ttym=urxvt mousemodel=extend mouse=a'

        I got single right click -> start visual mode from vim's cursor to point of click, in both normal and insert modes, and in visual mode the selection changes. I imagine this is what you want.

        Regards, John

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Johannes Deutsch
        On Tue, 20 Nov 2012 21:22:10 -0800 (PST) ... Hi John, thanks a lot for your reply and the time you ve invested. After i invoked vim -u NONE -N -c set
        Message 3 of 5 , Nov 22, 2012
          On Tue, 20 Nov 2012 21:22:10 -0800 (PST)
          John Little <John.B.Little@...> wrote:

          > On Wednesday, November 21, 2012 1:59:57 AM UTC+13, Johannes Deutsch
          > wrote:
          > > Hi all,
          > >
          > > i want to have mouse support for vim if it runs in urxvt v9.15.
          > >
          > > To achieve this i downloaded the latest version of vim which
          > > includes the latest patches along with mouse support for urxvt and
          > > compiled it. After that
          > >
          > > vim --version | grep urxvt
          > >
          > > yields
          > >
          > > +mouse_urxvt +mouse_xterm +multi_byte +multi_lang -mzscheme
          > > +netbeans_intg
          >
          > Just installed urxvt 9.15 from some Ubuntu repository, and my
          > vim --version | grep urxvt
          >
          > says
          >
          > +mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte
          > +multi_lang
          >
          > (Hmm, what options did you use compiling vim? Did you get a "Huge
          > version with GTK2-GNOME GUI" as shown by :ver in vim?)
          >
          > > So i tested the mouse in vim (and set ttym=urxvt, mousemodel=extend
          > > and mouse=a inside vim) and observed strange actions in response of
          > > mouse events compared with ':h mouse-overview'. For instance :
          > >
          > > insert mode: single left click => cursor moves to position of the
          > > mouse pointer
          > > single right click => leave insert mode:
          >
          > Running
          >
          > vim -u NONE -N -c 'set ttym=urxvt mousemodel=extend mouse=a'
          >
          > I got single right click -> start visual mode from vim's cursor to
          > point of click, in both normal and insert modes, and in visual mode
          > the selection changes. I imagine this is what you want.
          >
          > Regards, John
          >

          Hi John,

          thanks a lot for your reply and the time you've invested.

          After i invoked

          vim -u NONE -N -c 'set ttym=urxvt mousemodel=extend mouse=a'

          vim's response to mouse events were just like expected. After this
          surprise i tried to narrow down the error with

          vim --noplugin -c 'set ttym=urxvt mousemodel=extend mouse=a'

          Started vim with this setting the mouse behavior is broken again.

          So it seems for me that there is a setting in one of these filenames
          returned by ':scriptnames':

          1: ~/.vimrc
          2: /usr/local/share/vim/vim73/filetype.vim
          3: /usr/local/share/vim/vim73/ftplugin.vim
          4: /usr/local/share/vim/vim73/syntax/syntax.vim
          5: /usr/local/share/vim/vim73/syntax/synload.vim
          6: /usr/local/share/vim/vim73/syntax/syncolor.vim
          7: ~/.vim/autoload/pathogen.vim
          8: /usr/local/share/vim/vim73/ftoff.vim
          9: ~/.vim/bundle/UltiSnips-2.2/ftdetect/UltiSnips.vim
          10: ~/.vim/bundle/UltiSnips-2.2/ftdetect/snippets.vim
          11: /usr/local/share/vim/vim73/ftplugin/man.vim
          12: /usr/local/share/vim/vim73/syntax/nosyntax.vim
          13: ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim

          which breaks the correct behavior of the mouse.

          Unfortunately i don't know how to debug the startup of vim and which
          setting could interfere with the mouse settings.

          Maybe someone has an idea!?

          Thanks for your time and with best regards

          Johannes

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • John Little
          ... My first suspect would be your .vimrc. A way to debug it is to add the line finish at the beginning, restart vim. If the problem s gone, move it to the
          Message 4 of 5 , Nov 22, 2012
            On Friday, November 23, 2012 6:22:32 AM UTC+13, Johannes Deutsch wrote:
            >So it seems for me that there is a setting in one of these filenames
            >returned by ':scriptnames':
            > 1: ~/.vimrc
            > ...
            > Unfortunately i don't know how to debug the startup of vim and which
            > setting could interfere with the mouse settings.

            My first suspect would be your .vimrc. A way to debug it is to add the line

            finish

            at the beginning, restart vim. If the problem's gone, move it to the middle, restart, and binary chop till you find the culprit.

            Regards, John

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Johannes Deutsch
            On Thu, 22 Nov 2012 16:20:21 -0800 (PST) ... Thank you for the tip! In the meanwhile i found the malefactor. The following mapping in my .vimrc broke the urxvt
            Message 5 of 5 , Nov 23, 2012
              On Thu, 22 Nov 2012 16:20:21 -0800 (PST)
              John Little <John.B.Little@...> wrote:

              > On Friday, November 23, 2012 6:22:32 AM UTC+13, Johannes Deutsch
              > wrote:
              > >So it seems for me that there is a setting in one of these filenames
              > >returned by ':scriptnames':
              > > 1: ~/.vimrc
              > > ...
              > > Unfortunately i don't know how to debug the startup of vim and which
              > > setting could interfere with the mouse settings.
              >
              > My first suspect would be your .vimrc. A way to debug it is to add
              > the line
              >
              > finish
              >
              > at the beginning, restart vim. If the problem's gone, move it to the
              > middle, restart, and binary chop till you find the culprit.
              >

              Thank you for the tip!

              In the meanwhile i found the malefactor. The following mapping in
              my .vimrc broke the urxvt mouse support:

              noremap <ESC> <C-\><C-N>

              Probably it interferes the interpretation of escape sequences send by
              mouse events.

              I replaced it with

              autocmd CmdwinEnter * noremap <buffer> <C-c> <C-\><C-N>

              and everything works as expected again. Although i think a mapping of
              <ESC> to <C-\><C-N> is convenient it seems that i have to do it without
              it.

              best regards and thanks for your time

              Johannes


              > Regards, John
              >


              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.