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

Re: softening the last

Expand Messages
  • Gavin Sinclair
    ... From: Hiroshi Iwatani To: vim-dev-ML Sent: Saturday, May 04, 2002 8:02 PM Subject: softening the last
    Message 1 of 6 , May 4 3:51 AM
    • 0 Attachment
      ----- Original Message -----
      From: "Hiroshi Iwatani" <HGA03630@...>
      To: "vim-dev-ML" <vim-dev@...>
      Sent: Saturday, May 04, 2002 8:02 PM
      Subject: softening the last <EOL>


      > Issue 1: How could we delete the last eol char or chars from
      > a document?

      Maybe by Hex editing? I can't think of any other way. It's almost part of
      the contract of creating text documents that they will end in a newline.
      (For good reason, too, they tend to be processed a line at a time.)

      > Issue 2: When the cursor is at the head of the last line of
      > a document, how could we directly go to the top of
      > the next new line, i.e. to the next input position
      > in my intention? The 'j' and 'gj' have no effect.

      There is no next new line until you create one. So 'o' is the command to
      use.

      > I have read many parts of the Vim documentation including
      > the 'virtualedit' section but I can't find helpful info.

      Neither issue is a matter of "virtual editing".

      --Gavin
    • Hiroshi Iwatani
      In the old days we had many text editor implementations on which we could end the document without the last n . Even when it is a useless and purely
      Message 2 of 6 , May 5 3:04 AM
      • 0 Attachment
        In the old days we had many text editor implementations
        on which we could end the document without the last '\n'.
        Even when it is a useless and purely theoretical issue,
        I feel the eol char shoud be treated as just another
        char. It should not have a hard-coded privilege.

        The 'o' command only reproduces a new last eol invoking
        the recursion of the issue.

        Gavin Sinclair wrote:
        > ----- Original Message -----
        > From: "Hiroshi Iwatani" <HGA03630@...>
        > To: "vim-dev-ML" <vim-dev@...>
        > Sent: Saturday, May 04, 2002 8:02 PM
        > Subject: softening the last <EOL>
        >
        >
        >>Issue 1: How could we delete the last eol char or chars from
        >> a document?
        >>
        >
        > Maybe by Hex editing? I can't think of any other way. It's almost part of
        > the contract of creating text documents that they will end in a newline.
        > (For good reason, too, they tend to be processed a line at a time.)
        >
        >
        >>Issue 2: When the cursor is at the head of the last line of
        >> a document, how could we directly go to the top of
        >> the next new line, i.e. to the next input position
        >> in my intention? The 'j' and 'gj' have no effect.
        >>
        >
        > There is no next new line until you create one. So 'o' is the command to
        > use.
        >
        >
        >>I have read many parts of the Vim documentation including
        >>the 'virtualedit' section but I can't find helpful info.
        >>
        >
        > Neither issue is a matter of "virtual editing".
        >
        > --Gavin
        >
        >
        >
      • Gavin Sinclair
        ... From: Hiroshi Iwatani ... Editors don t share your concern for useless theoretical issues! ... Your question didn t mention
        Message 3 of 6 , May 6 8:13 AM
        • 0 Attachment
          ----- Original Message -----
          From: "Hiroshi Iwatani" <HGA03630@...>


          > In the old days we had many text editor implementations
          > on which we could end the document without the last '\n'.
          > Even when it is a useless and purely theoretical issue,
          > I feel the eol char shoud be treated as just another
          > char. It should not have a hard-coded privilege.

          Editors don't share your concern for useless theoretical issues!

          > The 'o' command only reproduces a new last eol invoking
          > the recursion of the issue.

          Your question didn't mention anything about not reproducing a new last EOL;
          it only asked to put the cursor at the beginning of the next line.

          Cheers,
          Gavin
        • Charles E. Campbell
          From: Hiroshi Iwatani ... Try ... which will edit your file in binary mode and won t require an end-of-line character at the
          Message 4 of 6 , May 6 8:54 AM
          • 0 Attachment
            From: "Hiroshi Iwatani" <HGA03630@...>
            > In the old days we had many text editor implementations
            > on which we could end the document without the last '\n'.
            ---------------------------------------------------------------------

            Try

            :set binary
            :set noeol

            which will edit your file in binary mode and won't require
            an end-of-line character at the end-of-file. No idea why
            you don't like end-of-lines, but vim can handle it.

            Regards,
            Charles Campbell

            --
            Charles E Campbell, Jr, PhD _ __ __
            Goddard Space Flight Center / /_/\_\_/ /
            cec@... /_/ \/_//_/
            PGP public key: http://www.erols.com/astronaut/pgp.html
          • Hiroshi Iwatani
            ... Seems they do not bring the intended effect. ... In a large, complicated and illmanaged :) publishing project, it is sometimes a little bit more convenient
            Message 5 of 6 , May 6 7:33 PM
            • 0 Attachment
              Charles E. Campbell wrote:
              > From: "Hiroshi Iwatani" <HGA03630@...>
              >
              >>In the old days we had many text editor implementations
              >>on which we could end the document without the last '\n'.
              >>
              > ---------------------------------------------------------------------
              >
              > Try
              >
              > :set binary
              > :set noeol
              Seems they do not bring the intended effect.

              > which will edit your file in binary mode and won't require
              > an end-of-line character at the end-of-file. No idea why
              > you don't like end-of-lines, but vim can handle it.
              In a large, complicated and illmanaged :)
              publishing project, it is sometimes a little
              bit more convenient if each file does not
              end with an eol, specifically, e.g., in a
              semi-automatic concatenation process. However,
              those real-world needs should be minor issues.
              Real issue is the orthogonality of the Vim
              operation system in which, I feel, simple
              editing operations could/should be applied
              indiscriminately to any of the chars in
              a document. Still a minor issue though.

              regards,
              Hiroshi Iwatani






              >
              > Regards,
              > Charles Campbell
              >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.