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

clear a register

Expand Messages
  • Bee
    This global command searches for beep anywhere in a line of a file and copies it to register a. The use of uppercase A appends it to register a rather than
    Message 1 of 2 , Jan 28, 2009
    • 0 Attachment
      This global command searches for "beep" anywhere in a line of a file
      and copies it to register a.

      The use of uppercase "A" appends it to register a rather than
      overwriting.

      :g/.*beep.*/normal "Ayy

      This works fine unless there is already something in register a.

      Is there a simple way to clear a register before issuing this global
      command?

      --
      Bill Muench
      Santa Cruz, California


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • John Beckett
      ... We have a tip that mentions a method: http://vim.wikia.com/wiki/Power_of_g 0 ay0:g/ /y A ... John
      Message 2 of 2 , Jan 28, 2009
      • 0 Attachment
        Bee wrote:
        > :g/.*beep.*/normal "Ayy
        >
        > This works fine unless there is already something in register a.
        >
        > Is there a simple way to clear a register before issuing this
        > global command?

        We have a tip that mentions a method:
        http://vim.wikia.com/wiki/Power_of_g

        0"ay0:g/<pattern>/y A

        The simple-to-remember method to clear register a is:

        :let @a=''

        John


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