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

Delete intervening wnitespace (and CR) between words

Expand Messages
  • Chris Lott
    Given this: Sheets Sheets of gold Is there an efficient way to delete the intervening white space and CRs between the Sheets to end up with Sheets Sheets of
    Message 1 of 4 , Feb 2 8:43 AM
    • 0 Attachment
      Given this:

      Sheets

      Sheets of gold

      Is there an efficient way to delete the intervening white space and
      CRs between the 'Sheets' to end up with

      Sheets Sheets of gold

      ?

      c
      --
      Chris Lott <chris@...>

      --
      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
    • Reid Thompson
      ... coping and pasting the above into my gvim... 3J works (three capital J) -- You received this message from the vim_use maillist. Do not top-post! Type
      Message 2 of 4 , Feb 2 8:49 AM
      • 0 Attachment
        On Thu, 2012-02-02 at 07:43 -0900, Chris Lott wrote:
        > Given this:
        >
        > Sheets
        >
        > Sheets of gold
        >
        > Is there an efficient way to delete the intervening white space and
        > CRs between the 'Sheets' to end up with
        >
        > Sheets Sheets of gold
        >
        > ?
        >
        > c
        > --
        > Chris Lott <chris@...>
        >

        coping and pasting the above into my gvim...

        3J
        works (three capital J)

        --
        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
      • Gary Johnson
        ... Select a range that includes those lines and use ... See ... Regards, Gary -- You received this message from the vim_use maillist. Do not top-post! Type
        Message 3 of 4 , Feb 2 9:09 AM
        • 0 Attachment
          On 2012-02-02, Chris Lott wrote:
          > Given this:
          >
          > Sheets
          >
          > Sheets of gold
          >
          > Is there an efficient way to delete the intervening white space and
          > CRs between the 'Sheets' to end up with
          >
          > Sheets Sheets of gold
          >
          > ?

          Select a range that includes those lines and use

          :s/\_s\+/ /g

          See

          :help /\_s

          Regards,
          Gary

          --
          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
        • Tim Chase
          ... If you mean newlines where you type white space , you can just highlight the text and type J to join them. If you want to normalize more than one
          Message 4 of 4 , Feb 2 9:10 AM
          • 0 Attachment
            > Sheets
            >
            > Sheets of gold
            >
            > Is there an efficient way to delete the intervening white space and
            > CRs between the 'Sheets' to end up with
            >
            > Sheets Sheets of gold

            If you mean "newlines" where you type "white space", you can just
            highlight the text and type "J" to join them. If you want to
            normalize more than one whitespace character to a single space,
            you can issue

            s/\_s\+/ /g

            over the desired range.

            -tim

            --
            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.