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

Re: pastetoggle

Expand Messages
  • Gerald Lai
    ... [snip] ... Harry, I seem to have the same problem as you, and I think I managed to track it down to the mouse setting. Apparently, middleclick pasting
    Message 1 of 25 , Dec 2, 2005
    • 0 Attachment
      On Thu, 1 Dec 2005, Harry Putnam wrote:

      > Chris Allen <c.d.allen@...> writes:
      >
      >> On 01/12/05, Harry Putnam <reader@...> wrote:
      >>> You are speaking of gvim here right? But I don't normally use gvim.
      >>> I prefer plain vim from too much work in console mode.
      [snip]
      > Here no pasting occurs. Only a screen flash like a visual bell type
      > flash.
      >
      > The help manual says C-R C-O * <ENTER> is supposed to be the same as
      > pasting with middlemouse, but here that is not the case. It pastes
      > nothing for me, whereas middle mouse pastes the clipboard text but has
      > the stepping problem.

      Harry,

      I seem to have the same problem as you, and I think I managed to track it down
      to the 'mouse' setting. Apparently, middleclick pasting does not work if
      'mouse=a'. Doing ':set mouse=' will make middleclick pasting work again, but
      we'll lose many mouse funtionalities in console Vim.

      The mapping Chip Campbell provided

      noremap <MiddleMouse> ...<MiddleMouse>...

      will only work if 'mouse' either has the 'a' or 'n' setting. It's a chicken and
      egg problem with the keymap because in order to get middleclick pasting to
      work, we have to get rid of 'a' by ':set mouse-=a', but after getting rid of a,
      we can't do a <MiddleClick> in the keymap.

      The best way I found to balance functionalities is to do the following:

      if has("gui_running")
      set mouse=ra
      else
      set mouse=rn
      nnoremap <MiddleMouse> a<MiddleMouse>
      endif

      This way, whenever a middleclick paste is issued in normal mode, it switches to
      insert mode to do the paste (which would work because it is an 'n' setting).
      While in insert mode, mouse functionality is limited, but that's the sacrifice
      we make. Note that appending "<Esc>" to the end of the nnoremap will kill the
      keymap for some reason.

      Hope this helps.

      -Gerald
    • Yegappan Lakshmanan
      Hi, ... If you are using a Vim compiled with support for accessing the xterm clipboard and support for handling mouse, and you have set the mouse option to
      Message 2 of 25 , Dec 2, 2005
      • 0 Attachment
        Hi,

        On 12/1/05, Harry Putnam <reader@...> wrote:
        > Chris Allen <c.d.allen@...> writes:
        >
        > > Yegappan was quite right, above, you *can* also paste using the X11
        > > clip board and keys. I believe that requires you to have +X built
        > > into your console (yes, console) Vim, as well. See :help
        > > xterm-clipboard for more information. I had forgotten about that
        > > since it is yet another shiny feature which my system does not support
        >
        > I'm not seeing either of above here. I've never had a setup where the
        > modeline could be manipulated with mouse when running plain vim in an
        > xterm. But I have, in the past been able to paste with middle mouse
        > from xterm output to a vim instance running in another xterm without
        > any special stuff such as has been described here.
        >
        > Yegappan s suggestion does not paste at all here. That is, if I have
        > an instance of vim running in an xterm and in input mode. Now
        > highlight text in a different xterm with left mouse.
        >

        If you are using a Vim compiled with support for accessing the
        xterm clipboard and support for handling mouse, and you have
        set the 'mouse' option to let Vim handle the mouse events,
        then you can use either the middle mouse button or the
        CTRL-R CTRL-O * command to paste the contents of the clipboard
        literally (without any indentation).

        If you don't have a Vim compiled with the xterm clipboard support
        or you haven't set the 'mouse' option, then you cannot paste
        the clipboard contents using the CTRL-R CTRL-O * command or
        the middle mouse button. In this case, the mouse will be handled
        by xterm itself.

        When you click the middle mouse button, xterm will send the
        contents of the clipboard to Vim, as though the user typed it from
        the keyboard. In this case, if you have 'autoindent' option set, you
        will get stair-case effect. You need to set the 'paste' option to paste
        the text without any indentation.

        - Yegappan
      • Harry Putnam
        ... I have the vim cvs sources. The ./configure program doesn t now anything about an -xterm_clipboard option. Nor does Makefile. How does one compile with
        Message 3 of 25 , Dec 2, 2005
        • 0 Attachment
          Yegappan Lakshmanan <yegappanl@...> writes:

          >> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
          >> +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype
          >> -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
          >>
          >
          > You are using a Vim compiled without the support for accessing
          > the xterm clipboard (-xterm_clipboard). In this version, you cannot
          > use the above described command to paste the clipboard
          > contents.

          I have the vim cvs sources. The ./configure program doesn't now
          anything about an -xterm_clipboard option. Nor does Makefile.

          How does one compile with that option. What does the command line
          look like?
        • Yegappan Lakshmanan
          Hi, ... VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19) Compiled by root@reader Huge version without GUI. Features included (+) or not (-):
          Message 4 of 25 , Dec 2, 2005
          • 0 Attachment
            Hi,

            On 12/2/05, Harry Putnam <reader@...> wrote:
            > Yegappan Lakshmanan <yegappanl@...> writes:
            >
            > >> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
            > >> +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype
            > >> -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
            > >>
            > >
            > > You are using a Vim compiled without the support for accessing
            > > the xterm clipboard (-xterm_clipboard). In this version, you cannot
            > > use the above described command to paste the clipboard
            > > contents.
            >
            > I have the vim cvs sources. The ./configure program doesn't now
            > anything about an -xterm_clipboard option. Nor does Makefile.
            >
            > How does one compile with that option. What does the command line
            > look like?
            >

            From the version output in one of your earlier e-mails:

            --------------------------------------
            VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
            Compiled by root@reader
            Huge version without GUI. Features included (+) or not (-):
            -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
            --------------------------------------

            You need to compile Vim with the GUI support to get the xterm_clipboard
            feature.

            - Yegappan
          • A. J. Mechelynck
            ... To begin with, try and see if you can enable X11 support in console Vim. I think it might be a configure argument something like --with-x11=yes but I m no
            Message 5 of 25 , Dec 2, 2005
            • 0 Attachment
              Harry Putnam wrote:
              > Yegappan Lakshmanan <yegappanl@...> writes:
              >
              >>> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
              >>> +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype
              >>> -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
              >>>
              >> You are using a Vim compiled without the support for accessing
              >> the xterm clipboard (-xterm_clipboard). In this version, you cannot
              >> use the above described command to paste the clipboard
              >> contents.
              >
              > I have the vim cvs sources. The ./configure program doesn't now
              > anything about an -xterm_clipboard option. Nor does Makefile.
              >
              > How does one compile with that option. What does the command line
              > look like?
              >
              >
              >
              >

              To begin with, try and see if you can enable X11 support in console Vim.
              I think it might be a configure argument something like --with-x11=yes
              but I'm no specialist on configuring Vim on Unix-like systems -- you
              might want to check it, or to get a second opinion.

              Best regards,
              Tony.
            • A. J. Mechelynck
              ... Not necessarily. Strange as it may seem to you Yegappan, it is possible to make an X11-aware console Vim, and such a build can usually access the X11
              Message 6 of 25 , Dec 2, 2005
              • 0 Attachment
                Yegappan Lakshmanan wrote:
                > Hi,
                >
                > On 12/2/05, Harry Putnam <reader@...> wrote:
                >> Yegappan Lakshmanan <yegappanl@...> writes:
                >>
                >>>> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
                >>>> +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype
                >>>> -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
                >>>>
                >>> You are using a Vim compiled without the support for accessing
                >>> the xterm clipboard (-xterm_clipboard). In this version, you cannot
                >>> use the above described command to paste the clipboard
                >>> contents.
                >> I have the vim cvs sources. The ./configure program doesn't now
                >> anything about an -xterm_clipboard option. Nor does Makefile.
                >>
                >> How does one compile with that option. What does the command line
                >> look like?
                >>
                >
                >>From the version output in one of your earlier e-mails:
                >
                > --------------------------------------
                > VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
                > Compiled by root@reader
                > Huge version without GUI. Features included (+) or not (-):
                > -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
                > --------------------------------------
                >
                > You need to compile Vim with the GUI support to get the xterm_clipboard
                > feature.
                >
                > - Yegappan
                >
                >
                >

                Not necessarily. Strange as it may seem to you Yegappan, it is possible
                to make an X11-aware "console" Vim, and such a build can usually access
                the X11 clipboard even if it still displays its output in an xterm.

                Best regards,
                Tony.
              • Yegappan Lakshmanan
                Hi, ... Yes. When I configure and build Vim with the following commands: $ ./configure --with-features=huge --disable-gui $ make The resulting Vim binary has
                Message 7 of 25 , Dec 2, 2005
                • 0 Attachment
                  Hi,

                  On 12/2/05, A. J. Mechelynck <antoine.mechelynck@...> wrote:
                  > >>
                  > >>>> VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
                  > >>>> +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype
                  > >>>> -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
                  > >>>>
                  > >>> You are using a Vim compiled without the support for accessing
                  > >>> the xterm clipboard (-xterm_clipboard). In this version, you cannot
                  > >>> use the above described command to paste the clipboard
                  > >>> contents.
                  > >> I have the vim cvs sources. The ./configure program doesn't now
                  > >> anything about an -xterm_clipboard option. Nor does Makefile.
                  > >>
                  > >> How does one compile with that option. What does the command line
                  > >> look like?
                  > >>
                  > >
                  > >>From the version output in one of your earlier e-mails:
                  > >
                  > > --------------------------------------
                  > > VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Nov 25 2005 17:02:19)
                  > > Compiled by root@reader
                  > > Huge version without GUI. Features included (+) or not (-):
                  > > -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
                  > > --------------------------------------
                  > >
                  > > You need to compile Vim with the GUI support to get the xterm_clipboard
                  > > feature.
                  > >
                  >
                  > Not necessarily. Strange as it may seem to you Yegappan, it is possible
                  > to make an X11-aware "console" Vim, and such a build can usually access
                  > the X11 clipboard even if it still displays its output in an xterm.
                  >

                  Yes. When I configure and build Vim with the following commands:

                  $ ./configure --with-features=huge --disable-gui
                  $ make

                  The resulting Vim binary has the xterm_clipboard support enabled and
                  accessing the X11 primary selection-buffer through the "*" register from
                  Vim works correctly.

                  - Yegappan
                • Charles E. Campbell, Jr.
                  ... Based on the configure help: configure --help : I believe you need to configure with --with-x (not that I ve tried this myself, I just usually build it
                  Message 8 of 25 , Dec 2, 2005
                  • 0 Attachment
                    A. J. Mechelynck wrote:

                    >To begin with, try and see if you can enable X11 support in console Vim.
                    >I think it might be a configure argument something like --with-x11=yes
                    >but I'm no specialist on configuring Vim on Unix-like systems -- you
                    >might want to check it, or to get a second opinion.
                    >
                    >
                    Based on the configure help: configure --help :
                    I believe you need to configure with

                    --with-x

                    (not that I've tried this myself, I just usually build it with huge)

                    Regards,
                    Chip Campbell
                  Your message has been successfully submitted and would be delivered to recipients shortly.