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

Copy wxhen deleting text

Expand Messages
  • Raphael Jolivet
    Hi, I am a big fan of VIM, I use it all the time. There is just one thing that I found anoying : Vim copy text in the clipboard whenever I dlete something.
    Message 1 of 7 , Aug 2, 2009
      Hi,

      I am a big fan of VIM, I use it all the time.
      There is just one thing that I found anoying :
      Vim copy text in the clipboard whenever I dlete something.

      This is anoying when you have copied some text and wwant to paste it
      at several places, while delteing other text : You clipboard get
      spammed with the content of what you delete !

      Do you know if it is possible to disable this behavior ?

      TH

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Raúl Núñez de Arenas Coronado
      Saluton Raphael :) ... IMHO, you shouldn t disable this behaviour, you should learn to use it in your favor. Whenever you delete text, it is put by default in
      Message 2 of 7 , Aug 2, 2009
        Saluton Raphael :)

        Raphael Jolivet <r...@...> dixit:
        > This is anoying when you have copied some text and wwant to paste it
        > at several places, while delteing other text : You clipboard get
        > spammed with the content of what you delete !
        >
        > Do you know if it is possible to disable this behavior ?

        IMHO, you shouldn't disable this behaviour, you should learn to use it
        in your favor.

        Whenever you delete text, it is put by default in the unnamed register
        and the numbered registers. There is no such thing as an unique
        clipboard in Vim, you have registers (":help registers"). If you want to
        copy some text and be able to paste it later while deleting some lines
        in between, doesn't just yank it to the unnamed register and the
        numbered registers (using "yy" for example), but yank it to some
        register you can use afterwards. Use the named registers.

        For example, if you want to save a line of text to paste it later, use
        "ayy to put that line in the "a" register. You have to type the double
        quote, letter "a", letter "y" and letter "y". After that you can delete
        lines ("dd" command) and they will be put into the unnamed and numbered
        registers, not clobbering your "clipboard" (which is the "a" register
        now). To paste the lines you saved to your "clipboard", use the "ap
        command, that is, double quote, letter "a", letter "p".

        See the help for registers to understand how this works and you will
        discover that you no longer want to disable this feature, but to use to
        your gain ;)

        --
        Raúl "DervishD" Núñez de Arenas Coronado
        Linux Registered User 88736 | http://www.dervishd.net
        It's my PC and I'll cry if I want to... RAmen!

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • bill lam
        ... you can use 0P or 0p to paste from the real yanked text but not the deleted text. It is quite inconvenient to type. One shift key and one off home
        Message 3 of 7 , Aug 2, 2009
          On Sun, 02 Aug 2009, Raphael Jolivet wrote:
          > This is anoying when you have copied some text and wwant to paste it
          > at several places, while delteing other text : You clipboard get
          > spammed with the content of what you delete !

          you can use "0P or "0p to paste from the real yanked text but not the
          deleted text. It is quite inconvenient to type. One shift key and one
          off home position key in addition to p/P. So I use the following
          mapping for paste from yank.

          nmap <F8> "0P
          nmap <C-F8> "0p

          ymmv

          --
          regards,
          ====================================================
          GPG key 1024D/4434BAB3 2008-08-24
          gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • David Fishburn
          ... For other conveniences as well you may be interested in my plugin: YankRing.vim : Maintains a history of previous yanks and deletes
          Message 4 of 7 , Aug 2, 2009
            > I am a big fan of VIM, I use it all the time.
            > There is just one thing that I found anoying :
            > Vim copy text in the clipboard whenever I delete something.
            >
            > This is annoying when you have copied some text and want to paste it
            > at several places, while deleting other text : You clipboard get
            > spammed with the content of what you delete !

            For other conveniences as well you may be interested in my plugin:

            YankRing.vim : Maintains a history of previous yanks and deletes
            http://www.vim.org/scripts/script.php?script_id=1234

            HTH,
            Dave

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Tony Mechelynck
            ... Personally I use ... YMMV. Best regards, Tony. -- Cinemuck, n.: The combination of popcorn, soda, and melted chocolate which covers the floors of movie
            Message 5 of 7 , Aug 14, 2009
              On 02/08/09 16:01, Raphael Jolivet wrote:
              >
              > Hi,
              >
              > I am a big fan of VIM, I use it all the time.
              > There is just one thing that I found anoying :
              > Vim copy text in the clipboard whenever I dlete something.
              >
              > This is anoying when you have copied some text and wwant to paste it
              > at several places, while delteing other text : You clipboard get
              > spammed with the content of what you delete !
              >
              > Do you know if it is possible to disable this behavior ?
              >
              > TH

              Sure, see:
              :help 'clipboard'
              :help 'guioptions'

              Personally I use
              :set cb=html,exclude=cons\\\|linux go=gimrLTtc
              YMMV.

              Best regards,
              Tony.
              --
              Cinemuck, n.:
              The combination of popcorn, soda, and melted chocolate which
              covers the floors of movie theaters.
              -- Rich Hall, "Sniglets"

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • KKde
              ... In help clipboard , I see the html name isnot under recognized names for this option. Can you please explain what your setting does?? Sharat
              Message 6 of 7 , Aug 14, 2009
                >
                > Personally I use
                >         :set cb=html,exclude=cons\\\|linux go=gimrLTtc
                > YMMV.
                >

                In help 'clipboard' , I see the html name isnot under recognized names
                for this option. Can you please explain what your setting does??

                Sharat

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Tony Mechelynck
                ... This setting answers the OP s question mostly by what it does _not_ include (_not_ unnamed and _not_ autoselect). Please go back and read :help
                Message 7 of 7 , Aug 15, 2009
                  On 15/08/09 08:45, KKde wrote:
                  >
                  >
                  >>
                  >> Personally I use
                  >> :set cb=html,exclude=cons\\\|linux go=gimrLTtc
                  >> YMMV.
                  >>
                  >
                  > In help 'clipboard' , I see the html name isnot under recognized names
                  > for this option. Can you please explain what your setting does??
                  >
                  > Sharat

                  This setting answers the OP's question mostly by what it does _not_
                  include (_not_ unnamed and _not_ autoselect). Please go back and read
                  ":help 'clipboard'".


                  Regards,
                  Tony.
                  --
                  Cinemuck, n.:
                  The combination of popcorn, soda, and melted chocolate which
                  covers the floors of movie theaters.
                  -- Rich Hall, "Sniglets"

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                Your message has been successfully submitted and would be delivered to recipients shortly.