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

Re: Delete whitout altering clipboard

Expand Messages
  • Marian Csontos
    Hi, _dd _ is blackhole register -- Marian On Thu, 30 Jun 2005 11:46:46 +0200, Fabien Meghazi ... -- Mgr. Marián Csontos programátor POS
    Message 1 of 7 , Jun 30, 2005
    • 0 Attachment
      Hi,

      "_dd

      _ is blackhole register

      -- Marian

      On Thu, 30 Jun 2005 11:46:46 +0200, Fabien Meghazi <amigrave@...>
      wrote:

      > Hi all,
      >
      > How can I delete a line or a bunch of selected line without loosing
      > the yanked text in the clipboard ?
      >



      --
      Mgr. Marián Csontos
      programátor POS
      AXA, a.s.
      Radničné námestie 4
      821 05 Bratislava
      tel. +421 2 4829 4218
      mailto:csontos@...
      www.axa.sk



      ________ Information from NOD32 ________
      This message was checked by NOD32 Antivirus System for Linux Mail Server.
      http://www.nod32.com
    • Wind
      Hello Fabien, Thursday, June 30, 2005, 12:46:46 PM, you wrote: FM Hi all, FM How can I delete a line or a bunch of selected line without loosing FM the
      Message 2 of 7 , Jun 30, 2005
      • 0 Attachment
        Hello Fabien,

        Thursday, June 30, 2005, 12:46:46 PM, you wrote:

        FM> Hi all,

        FM> How can I delete a line or a bunch of selected line without loosing
        FM> the yanked text in the clipboard ?
        Use black hole rgister:
        "_d

        see
        :h registers



        --
        Best regards,
        Wind mailto:sonic_wind@...
      • Cory T. Echols
        ... I assume you mean the unnamed register (:he quote_quote). This is where all yanks and deletes go by default. Nothing gets put in the system clipboard
        Message 3 of 7 , Jun 30, 2005
        • 0 Attachment
          On 06/30, Fabien Meghazi wrote:
          > How can I delete a line or a bunch of selected line without loosing
          > the yanked text in the clipboard ?

          I assume you mean the unnamed register (:he quote_quote). This is where
          all yanks and deletes go by default. Nothing gets put in the system
          clipboard unless you specifically send it there by using the * register
          in your command. (at least in my configuration.)

          If you prefix the actual delete command with the blackhole register
          (using a command like "_d), the current unnamed register contents won't be
          disturbed. (see :help quote_).

          Alternately, the numbered registers hold the 10 most recently yanked or
          deleted things. This means if you yank something new, what was
          previously in the unnamed register should now be in register 1.
          Register 0 seems to be a synonym for the unnamed register. The one
          caveat is that the numbered registers don't store some "small" yanks or
          deletes. (see :help quote_number).

          As another alternative, you could install David Fishburn's YankRing
          plugin, which automatically gives you a history of all your yanks and
          deletes, and provides commands for manipulating that history which are
          more convenient that mucking around with numbered registers. (I have it
          installed, but don't use it heavily.) Its url is

          http://vim.sourceforge.net/scripts/script.php?script_id=1234

          --
          Cory T. Echols
        • A. J. Mechelynck
          ... In W32: Don t use the menus; hit the Del key. Any visual or selected highlighted text will be deleted into the default register (or any register you
          Message 4 of 7 , Jun 30, 2005
          • 0 Attachment
            Fabien Meghazi wrote:
            > Hi all,
            >
            > How can I delete a line or a bunch of selected line without loosing
            > the yanked text in the clipboard ?
            >

            In W32: Don't use the menus; hit the Del key. Any "visual" or "selected"
            highlighted text will be deleted into the default register "" (or any
            register you specify, so don't specify "* or "+ if you want to leave the
            clipboard untouched).


            In Unix: In addition to the above, you should also use

            :set clipboard=

            This will avoid clobbering the clipboard unless you explicitly ask for
            it (which you can always do, either by using Edit -> Cut or by prefixing
            your delete/yank command with "* or "+ which, in X11 systems, are not
            synonymous but since I'm on W32 I don't know the fine points of the
            difference).


            See
            :help 'clipboard'
            :help quotestar
            :help quoteplus



            Best regards,
            Tony.
          • Fabien Meghazi
            ... Thanks all, this is exactly what I was searching for. I googled before asking and saw the _ register mentionned but I didn t knew that we had to put a
            Message 5 of 7 , Jun 30, 2005
            • 0 Attachment
              > "_d

              Thanks all, this is exactly what I was searching for.
              I googled before asking and saw the _ register mentionned but I didn't
              knew that we had to put a quote before
            • A. J. Mechelynck
              ... - To use a register in a Normal-mode command (such as y d p etc.) put a quote before it: +3yy yanks 3 lines starting at the current line, to the system
              Message 6 of 7 , Jun 30, 2005
              • 0 Attachment
                Fabien Meghazi wrote:
                >>"_d
                >
                >
                > Thanks all, this is exactly what I was searching for.
                > I googled before asking and saw the _ register mentionned but I didn't
                > knew that we had to put a quote before
                >
                >
                >
                >

                - To use a register in a Normal-mode command (such as y d p etc.) put a
                quote before it: "+3yy yanks 3 lines starting at the current line, to
                the system clipboard.

                - To use a register as a variable (e.g., in an expression) put an
                at-sign before it; here is an example that can be used in a Vim script:

                if @+ == ""
                echo "The system clipboard is empty"
                else
                echo 'The system clipboard contains "'
                \ . @+ . '"'
                endif

                - Some Ex-commands, for instance ":put", can also accept a register
                (with no " or @) as an argument:

                g/\<clip$/put +

                adds the contents of the clipboard after every line ending in the word
                "clip".

                See ":help registers" for details.


                Best regards,
                Tony.
              Your message has been successfully submitted and would be delivered to recipients shortly.