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

How do I yank a whole line, minus the carriage return?

Expand Messages
  • JP Lew
    Hi: in order to yank a line, I know I can go `yy`. The problem is, this copies the carriage return at the end. What I do instead is position the cursor on the
    Message 1 of 4 , Apr 4, 2014
      Hi:

      in order to yank a line, I know I can go `yy`. The problem is, this copies the carriage return at the end. What I do instead is position the cursor on the first character of the line, then go `v$hy` to select everything except the last character from the right.

      Is there a better way to do this? Thanks.

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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Nikolay Pavlov
      ... copies the carriage return at the end. What I do instead is position the cursor on the first character of the line, then go `v$hy` to select everything
      Message 2 of 4 , Apr 4, 2014


        On Apr 4, 2014 8:32 PM, "JP Lew" <jplew108@...> wrote:
        >
        > Hi:
        >
        > in order to yank a line, I know I can go `yy`. The problem is, this copies the carriage return at the end. What I do instead is position the cursor on the first character of the line, then go `v$hy` to select everything except the last character from the right.
        >
        > Is there a better way to do this? Thanks.

        0y$
        >
        > --
        > --
        > 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
        >
        > ---
        > You received this message because you are subscribed to the Google Groups "vim_use" group.
        > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        > For more options, visit https://groups.google.com/d/optout.

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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • JP Lew
        great, that s what I was looking for. Funny how in visual mode, $ includes the carriage return, but in normal mode it doesn t. ... -- -- You received this
        Message 3 of 4 , Apr 4, 2014
          great, that's what I was looking for.
          Funny how in visual mode, $ includes the carriage return, but in normal mode it doesn't.


          On Fri, Apr 4, 2014 at 10:07 PM, Nikolay Pavlov <zyx.vim@...> wrote:


          On Apr 4, 2014 8:32 PM, "JP Lew" <jplew108@...> wrote:
          >
          > Hi:
          >
          > in order to yank a line, I know I can go `yy`. The problem is, this copies the carriage return at the end. What I do instead is position the cursor on the first character of the line, then go `v$hy` to select everything except the last character from the right.
          >
          > Is there a better way to do this? Thanks.

          0y$


          >
          > --
          > --
          > 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
          >
          > ---
          > You received this message because you are subscribed to the Google Groups "vim_use" group.
          > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          > For more options, visit https://groups.google.com/d/optout.

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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.

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

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Adam
          You might find this plugin useful: http://www.vim.org/scripts/script.php?script_id=3355 ~Adam~ ... -- -- You received this message from the vim_use maillist.
          Message 4 of 4 , Apr 4, 2014
            You might find this plugin useful: http://www.vim.org/scripts/script.php?script_id=3355

            ~Adam~


            On Fri, Apr 4, 2014 at 11:51 AM, JP Lew <jplew108@...> wrote:
            great, that's what I was looking for.
            Funny how in visual mode, $ includes the carriage return, but in normal mode it doesn't.


            On Fri, Apr 4, 2014 at 10:07 PM, Nikolay Pavlov <zyx.vim@...> wrote:


            On Apr 4, 2014 8:32 PM, "JP Lew" <jplew108@...> wrote:
            >
            > Hi:
            >
            > in order to yank a line, I know I can go `yy`. The problem is, this copies the carriage return at the end. What I do instead is position the cursor on the first character of the line, then go `v$hy` to select everything except the last character from the right.
            >
            > Is there a better way to do this? Thanks.

            0y$


            >
            > --
            > --
            > 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
            >
            > ---
            > You received this message because you are subscribed to the Google Groups "vim_use" group.
            > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            > For more options, visit https://groups.google.com/d/optout.

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

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.

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

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.

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

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          Your message has been successfully submitted and would be delivered to recipients shortly.