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

Re: Migrating text from vim to wysiwyg editor

Expand Messages
  • Gary Johnson
    ... For my weekly status report, which I compose during the week using Vim before sending it to my boss using Outlook, I ... then highlight the lines of the
    Message 1 of 21 , Feb 1, 2013
    • 0 Attachment
      On 2013-02-01, Tim Johnson wrote:
      > Hi Team :
      >
      > I've started using drupal. I've been writing articles using vim.
      > Sometimes they get printed directly from vim, sometimes I copy them
      > into OpenOffice and print them off.
      >
      > Then, I publish them to the web using drupal and a wysiwyg editor.
      >
      > I'm really very new to using wysiwyg editors (as in drupal). I'm
      > sure that pasting text from vim is going to insert hard breaks that
      > might result in hard-to-read formatting in different devices.
      >
      > I would welcome some tips on how to make this transition. I think
      > that a script of some kind that would join all lines into one for a
      > paragraph, then copy the line to the clipboard would do the trick.
      > Because I believe that the wysiwyg editor would then take care of
      > the appropriate wrapping.
      >
      > Before I procede - any comments?

      For my weekly status report, which I compose during the week using
      Vim before sending it to my boss using Outlook, I

      :set tw=9999

      then highlight the lines of the report using V. Then

      gqgvY

      to reformat all the paragraphs as long lines and yank them to the
      clipboard, move the mouse to the Outlook message and

      Ctrl-V

      My ~/_vimrc includes

      set clipboard^=unnamed

      so that I don't have to specify the clipboard explicitly.

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

      ---
      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/groups/opt_out.
    • vim@...
      ... You could do something like ... (assuming you have at least one blank line at the end of the file; otherwise, you d have to manually join the last line to
      Message 2 of 21 , Feb 1, 2013
      • 0 Attachment
        On Fri, 1 Feb 2013 20:09:16 -0700, Chris Schneider wrote:
        > vipJ will join a single paragraph's lines.
        >
        > I'm not good enough with fancier :g/ commands to join each paragraph
        > individually.

        You could do something like

        :g/^\</'{+,'}-j

        (assuming you have at least one blank line at the end of the file;
        otherwise, you'd have to manually join the last line to the last
        paragraph). Alternatively, you could do

        :v/^\s*$/norm vipJ

        which would have a similar behavior.

        -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

        ---
        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/groups/opt_out.
      • Tim Johnson
        ... ... Great tips and comments. Thanks to all! -- Tim tim at tee jay forty nine dot com or akwebsoft dot com http://www.akwebsoft.com -- -- You received
        Message 3 of 21 , Feb 1, 2013
        • 0 Attachment
          * Tim Johnson <tim@...> [130201 17:58]:
          > Hi Team :
          >
          > I've started using drupal. I've been writing articles using vim.
          > Sometimes they get printed directly from vim, sometimes I copy them
          > into OpenOffice and print them off.
          <...>
          > Before I procede - any comments?
          Great tips and comments. Thanks to all!
          --
          Tim
          tim at tee jay forty nine dot com or akwebsoft dot com
          http://www.akwebsoft.com

          --
          --
          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/groups/opt_out.
        • Chris Schneider
          Tim - can you describe what to search help on for that trick? Second time I ve seen it today, with the :g/pattern/range -dash- command. But I couldn t
          Message 4 of 21 , Feb 1, 2013
          • 0 Attachment
            Tim - can you describe what to search help on for that trick? Second time I've seen it today, with the :g/pattern/range -dash- command.  But I couldn't actually get it working for the earlier example.




            On Fri, Feb 1, 2013 at 8:46 PM, <vim@...> wrote:
            On Fri, 1 Feb 2013 20:09:16 -0700, Chris Schneider wrote:
            > vipJ will join a single paragraph's lines.
            >
            > I'm not good enough with fancier :g/ commands to join each paragraph
            > individually.

            You could do something like

              :g/^\</'{+,'}-j

            (assuming you have at least one blank line at the end of the file;
            otherwise, you'd have to manually join the last line to the last
            paragraph).  Alternatively, you could do

              :v/^\s*$/norm vipJ

            which would have a similar behavior.

            -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
             
            ---
            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/groups/opt_out.
             
             
          • vim@...
            ... Think of it as ... where {ex command} can include a range relative to the line the match was found on. So you can do things like find every line ...
            Message 5 of 21 , Feb 1, 2013
            • 0 Attachment
              On Fri, 1 Feb 2013 20:55:09 -0700, Chris Schneider wrote:
              > Tim - can you describe what to search help on for that trick?
              > Second time I've seen it today, with the :g/pattern/range -dash-
              > command.

              Think of it as

              :{range}g/{pattern}/{ex command}

              where "{ex command}" can include a range relative to the line the
              match was found on. So you can do things like find every line
              containing "foo" and indent the line above through the line below:

              :g/foo/-,+>

              That could also be written more explicitly as

              :g/foo/-1,+1>

              or make it less annoying (since ">" reports every set of lines it
              shifts) with

              :g/foo/sil! -,+>

              Here my Ex command is ">" (shift a range right by one 'shiftwidth').

              My relative range is "-,+" (more explicitly "-1,+1", but since it
              defaults to 1 if you don't specify, I often don't). By using the
              comma, it moves the start of the range back one line, but then
              adjusts the end of the range forward one line *from the line that
              matched*. If instead I'd used "-;+", it would have been back one
              line, and then forward one line relative to that. Things get really
              crazy when you start to stack movements such as

              :g/foo/?bar?+2;/baz/-1d

              which searches for lines matching "foo". On each matching line, it
              then searches backwards for "bar", then moves forward two lines to
              start the range. Then, from that point (rather than the initial
              "foo"-matching line, as it would if I'd used a comma instead of a
              semicolon), it searches forward until it finds "baz" and then backs
              up the end of the range by one line. With that range in hand, it
              then deletes the range in question (":help :d"). You can read a
              brief description of the range specifiers at

              :help :range

              It's this sort of crazy power that makes it hard for me to use any
              other editor for any length of time. "What do you mean that your
              editor doesn't have an easy way to perform substitutions on the
              five lines following the first instance of 'foo' after instances
              of 'bar'?! Vim does…" :)

              -tim

              :help :range
              :help :g
              :help ex-cmd-index












              --
              --
              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/groups/opt_out.
            • Eric Weir
              ... I routinely yank from vim and paste in other editors without difficulty. I m not certain this is the reason, and I didn t come up with this on my own. I
              Message 6 of 21 , Feb 2, 2013
              • 0 Attachment
                On Feb 1, 2013, at 9:55 PM, Tim Johnson wrote:

                > I've started using drupal. I've been writing articles using vim.
                > Sometimes they get printed directly from vim, sometimes I copy them
                > into OpenOffice and print them off.
                >
                > Then, I publish them to the web using drupal and a wysiwyg editor.
                >
                > I'm really very new to using wysiwyg editors (as in drupal). I'm
                > sure that pasting text from vim is going to insert hard breaks that
                > might result in hard-to-read formatting in different devices.

                I routinely yank from vim and paste in other editors without difficulty. I'm not certain this is the reason, and I didn't come up with this on my own. I asked a similar question here and it was given to me. Anyway, my .vimrc has this:

                "-----------------------------------------------wrap to screen w/o linebreak
                set linebreak

                ------------------------------------------------------------------------------------------
                Eric Weir
                Decatur, GA USA
                eeweir@...

                "Imagining the other is a powerful antidote to fanaticism and hatred."

                - Amos Oz

                --
                --
                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/groups/opt_out.
              • Michael Henry
                ... I was interested to see the use of visual-mode Y above. In the Vim help (and in brief empirical testing), I don t see any difference between lowercase
                Message 7 of 21 , Feb 2, 2013
                • 0 Attachment
                  On 02/01/2013 10:42 PM, Gary Johnson wrote:
                  > then highlight the lines of the report using V. Then
                  >
                  > gqgvY
                  >
                  > to reformat all the paragraphs as long lines and yank them to the
                  > clipboard[...]

                  I was interested to see the use of visual-mode "Y" above. In
                  the Vim help (and in brief empirical testing), I don't see any
                  difference between lowercase "y" and uppercase "Y" in visual
                  mode. I'm just curious why you've chosen to use the uppercase
                  alternative, since lowercase "y" is easier to type.

                  Michael Henry

                  --
                  --
                  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/groups/opt_out.
                • ping
                  ... so along with a reverse operator we can have sth like these? //join each parag into a line noremap ,q :g/^ //split(format) them back into
                  Message 8 of 21 , Feb 2, 2013
                  • 0 Attachment
                    On 2/1/2013 10:55 PM, Chris Schneider wrote:
                    > You could do something like
                    >
                    > :g/^\</'{+,'}-j
                    >
                    > (assuming you have at least one blank line at the end of the file;
                    > otherwise, you'd have to manually join the last line to the last
                    > paragraph). Alternatively, you could do
                    >
                    > :v/^\s*$/norm vipJ
                    >
                    > which would have a similar behavior.
                    so along with a "reverse" operator we can have sth like these?
                    //join each parag into a line
                    noremap ,q :g/^\</'{+,'}-j<cr>

                    //split(format) them back into paragraphs
                    noremap ,Q :g/^\S/normal gqqo<esc>

                    I think the good thing is that they can be used under vsiual mode, which
                    gives a control of the text range that these operators can be applied on...

                    --
                    --
                    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/groups/opt_out.
                  • jcordes
                    ... Tim, Thanks very much for posting this. Your explanation (in a later post) makes a lot of sense, but for some reason I keep coming up with an invalid
                    Message 9 of 21 , Feb 2, 2013
                    • 0 Attachment
                      On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                      > You could do something like
                      > :g/^\</'{+,'}-j
                      >
                      > (assuming you have at least one blank line at the end of the file;
                      > otherwise, you'd have to manually join the last line to the last
                      > paragraph).

                      Tim,

                      Thanks very much for posting this. Your explanation (in a later post) makes a lot of sense, but for some reason I keep coming up with an 'invalid range' error when I use
                      :g/^\</'{+,'}-j
                      This is in a short text file with some blank (empty) lines between paragraphs, on linux; line endings are just LF.

                      VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 24 2012 23:53:05)
                      Huge version without GUI.

                      Can you suggest anything I might be doing wrong?

                      Thanks,
                      John

                      --
                      --
                      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/groups/opt_out.
                    • Gary Johnson
                      ... I wanted the yank to be done line-wise and it was easier for me to type Y than to investigate whether y would work as well. Regards, Gary -- -- You
                      Message 10 of 21 , Feb 2, 2013
                      • 0 Attachment
                        On 2013-02-02, Michael Henry wrote:
                        > On 02/01/2013 10:42 PM, Gary Johnson wrote:
                        > > then highlight the lines of the report using V. Then
                        > >
                        > > gqgvY
                        > >
                        > > to reformat all the paragraphs as long lines and yank them to the
                        > > clipboard[...]
                        >
                        > I was interested to see the use of visual-mode "Y" above. In
                        > the Vim help (and in brief empirical testing), I don't see any
                        > difference between lowercase "y" and uppercase "Y" in visual
                        > mode. I'm just curious why you've chosen to use the uppercase
                        > alternative, since lowercase "y" is easier to type.

                        I wanted the yank to be done line-wise and it was easier for me to
                        type Y than to investigate whether y would work as well.

                        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

                        ---
                        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/groups/opt_out.
                      • Christian Brabandt
                        Hi jcordes! ... Are you possibly missing a trailing empty line? Mit freundlichen Grüßen Christian -- Man begeht entweder Fehler des Stolzes oder des
                        Message 11 of 21 , Feb 2, 2013
                        • 0 Attachment
                          Hi jcordes!

                          On Sa, 02 Feb 2013, jcordes wrote:

                          > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                          > > You could do something like
                          > > :g/^\</'{+,'}-j
                          > >
                          > > (assuming you have at least one blank line at the end of the file;
                          > > otherwise, you'd have to manually join the last line to the last
                          > > paragraph).
                          >
                          > Tim,
                          >
                          > Thanks very much for posting this. Your explanation (in a later post) makes a lot of sense, but for some reason I keep coming up with an 'invalid range' error when I use
                          > :g/^\</'{+,'}-j
                          > This is in a short text file with some blank (empty) lines between paragraphs, on linux; line endings are just LF.
                          >
                          > VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 24 2012 23:53:05)
                          > Huge version without GUI.
                          >
                          > Can you suggest anything I might be doing wrong?

                          Are you possibly missing a trailing empty line?

                          Mit freundlichen Grüßen
                          Christian
                          --
                          Man begeht entweder Fehler des Stolzes oder des Kriechens, wenn man
                          nicht die Anerkennung des eignen Werts voraussetzt.
                          -- Jean Paul (eig. Johann Paul Friedrich Richter)

                          --
                          --
                          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/groups/opt_out.
                        • vim@...
                          ... Sorry if it was just a tad prolix. :-) ... The only way I was able to trigger this was if either: 1) your relative-range happens to be swapped (such that
                          Message 12 of 21 , Feb 2, 2013
                          • 0 Attachment
                            On Sat, 2 Feb 2013 10:27:27 -0800 (PST), jcordes wrote:
                            > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                            > > You could do something like
                            > > :g/^\</'{+,'}-j
                            >
                            > Thanks very much for posting this. Your explanation (in a later
                            > post) makes a lot of sense,

                            Sorry if it was just a tad prolix. :-)

                            > but for some reason I keep coming up
                            > with an 'invalid range' error when I use :g/^\</'{+,'}-j


                            The only way I was able to trigger this was if either:

                            1) your relative-range happens to be swapped (such that the 2nd line
                            comes before the first line), or

                            2) if your file only has one line in it.

                            I might be able to better determine what's going on if you can
                            produce a sample file against which I could test.

                            -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

                            ---
                            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/groups/opt_out.
                          • jcordes
                            ... Tim, and Christian: I have reduced the file to something very short - however, at some point the error changed to E147: Cannot do :global recursive. Here
                            Message 13 of 21 , Feb 2, 2013
                            • 0 Attachment
                              On Saturday, 2 February 2013 14:40:47 UTC-4, Tim Chase wrote:
                              > On Sat, 2 Feb 2013 10:27:27 -0800 (PST), jcordes wrote:
                              >
                              > > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                              >
                              > > > You could do something like
                              >
                              > > > :g/^\</'{+,'}-j
                              >
                              > >
                              >
                              > > Thanks very much for posting this. Your explanation (in a later
                              >
                              > > post) makes a lot of sense,
                              >
                              > > but for some reason I keep coming up
                              > > with an 'invalid range' error when I use :g/^\</'{+,'}-j
                              >
                              > The only way I was able to trigger this was if either:
                              >
                              > 1) your relative-range happens to be swapped (such that the 2nd line
                              > comes before the first line), or
                              >
                              > 2) if your file only has one line in it.
                              >
                              > I might be able to better determine what's going on if you can
                              > produce a sample file against which I could test.

                              Tim, and Christian:

                              I have reduced the file to something very short - however, at some point the error changed to E147: Cannot do :global recursive. Here is the short version:

                              ###########
                              2010.09.06

                              Enter more city directory data - I already have quite a lot for my family in
                              spreadsheets.

                              ###########

                              There are 5 lines, the last one being empty. Lines 3 and 4 are each terminated by a LF.

                              I'm not sure if I may be misunderstanding the original proposal, to do
                              :g/^\</'{+,'}-j

                              Was it intended that the entire file should be visually selected first? I hadn't thought so.

                              Thanks for your assistance,
                              John

                              --
                              --
                              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/groups/opt_out.
                            • jcordes
                              ... Sorry for the repost - I just realized I should have attached the test file. Have done so in this message. John -- -- You received this message from the
                              Message 14 of 21 , Feb 2, 2013
                              • 0 Attachment
                                On Saturday, 2 February 2013 16:09:17 UTC-4, jcordes wrote:
                                > On Saturday, 2 February 2013 14:40:47 UTC-4, Tim Chase wrote:
                                > > On Sat, 2 Feb 2013 10:27:27 -0800 (PST), jcordes wrote:
                                > >
                                > > > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                                > >
                                > > > > You could do something like
                                > >
                                > > > > :g/^\</'{+,'}-j
                                > >
                                > > >
                                > >
                                > > > Thanks very much for posting this. Your explanation (in a later
                                > >
                                > > > post) makes a lot of sense,
                                > >
                                > > > but for some reason I keep coming up
                                > > > with an 'invalid range' error when I use :g/^\</'{+,'}-j
                                > >
                                > > The only way I was able to trigger this was if either:
                                > >
                                > > 1) your relative-range happens to be swapped (such that the 2nd line
                                > > comes before the first line), or
                                > >
                                > > 2) if your file only has one line in it.
                                > >
                                > > I might be able to better determine what's going on if you can
                                > > produce a sample file against which I could test.
                                >
                                > Tim, and Christian:
                                >
                                > I have reduced the file to something very short - however, at some point the error changed to E147: Cannot do :global recursive. Here is the short version:
                                >
                                > ###########
                                > 2010.09.06
                                >
                                > Enter more city directory data - I already have quite a lot for my family in
                                > spreadsheets.
                                >
                                > ###########
                                >
                                > There are 5 lines, the last one being empty. Lines 3 and 4 are each terminated by a LF.
                                >
                                > I'm not sure if I may be misunderstanding the original proposal, to do
                                > :g/^\</'{+,'}-j
                                >
                                > Was it intended that the entire file should be visually selected first? I hadn't thought so.
                                >
                                > Thanks for your assistance,
                                > John

                                Sorry for the repost - I just realized I should have attached the test file. Have done so in this message.
                                John

                                --
                                --
                                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/groups/opt_out.
                              • Christian Brabandt
                                Hi jcordes! ... I think, this happens, because there is no empty first line in your file. Simply add an empty first line in front of everything and I believe
                                Message 15 of 21 , Feb 2, 2013
                                • 0 Attachment
                                  Hi jcordes!

                                  On Sa, 02 Feb 2013, jcordes wrote:

                                  > On Saturday, 2 February 2013 16:09:17 UTC-4, jcordes wrote:
                                  > > On Saturday, 2 February 2013 14:40:47 UTC-4, Tim Chase wrote:
                                  > > > On Sat, 2 Feb 2013 10:27:27 -0800 (PST), jcordes wrote:
                                  > > >
                                  > > > > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                                  > > >
                                  > > > > > You could do something like
                                  > > >
                                  > > > > > :g/^\</'{+,'}-j
                                  > > >
                                  > > > >
                                  > > >
                                  > > > > Thanks very much for posting this. Your explanation (in a later
                                  > > >
                                  > > > > post) makes a lot of sense,
                                  > > >
                                  > > > > but for some reason I keep coming up
                                  > > > > with an 'invalid range' error when I use :g/^\</'{+,'}-j
                                  > > >
                                  > > > The only way I was able to trigger this was if either:
                                  > > >
                                  > > > 1) your relative-range happens to be swapped (such that the 2nd line
                                  > > > comes before the first line), or
                                  > > >
                                  > > > 2) if your file only has one line in it.
                                  > > >
                                  > > > I might be able to better determine what's going on if you can
                                  > > > produce a sample file against which I could test.
                                  > >
                                  > > Tim, and Christian:
                                  > >
                                  > > I have reduced the file to something very short - however, at some point the error changed to E147: Cannot do :global recursive. Here is the short version:
                                  > >
                                  > > ###########
                                  > > 2010.09.06
                                  > >
                                  > > Enter more city directory data - I already have quite a lot for my family in
                                  > > spreadsheets.
                                  > >
                                  > > ###########
                                  > >
                                  > > There are 5 lines, the last one being empty. Lines 3 and 4 are each terminated by a LF.
                                  > >
                                  > > I'm not sure if I may be misunderstanding the original proposal, to do
                                  > > :g/^\</'{+,'}-j
                                  > >
                                  > > Was it intended that the entire file should be visually selected first? I hadn't thought so.
                                  > >
                                  > > Thanks for your assistance,
                                  > > John
                                  >
                                  > Sorry for the repost - I just realized I should have attached the test file. Have done so in this message.
                                  > John
                                  >

                                  > 2010.09.06
                                  >
                                  > Enter more city directory data - I already have quite a lot for my family in
                                  > spreadsheets.
                                  >

                                  I think, this happens, because there is no empty first line in your
                                  file. Simply add an empty first line in front of everything and I
                                  believe the :g command works.


                                  regards,
                                  Christian
                                  --
                                  Sprich leise und höflich, aber trage stets einen dicken Knüppel bei
                                  dir.
                                  -- Theodor Roosevelt

                                  --
                                  --
                                  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/groups/opt_out.
                                • Michael Henry
                                  ... Thanks! For some reason, I couldn t see any difference in the help text between y and Y , and the empirical testing happened to work because the
                                  Message 16 of 21 , Feb 2, 2013
                                  • 0 Attachment
                                    On 02/02/2013 01:31 PM, Gary Johnson wrote:
                                    > On 2013-02-02, Michael Henry wrote:
                                    >> I was interested to see the use of visual-mode "Y" above. In
                                    >> the Vim help (and in brief empirical testing), I don't see any
                                    >> difference between lowercase "y" and uppercase "Y" in visual
                                    >> mode.
                                    >
                                    > I wanted the yank to be done line-wise and it was easier for me to
                                    > type Y than to investigate whether y would work as well.

                                    Thanks! For some reason, I couldn't see any difference in the
                                    help text between "y" and "Y", and the empirical testing
                                    happened to work because the original visual selection was done
                                    using "V". You've helped me learn something new today :-)

                                    Michael Henry

                                    --
                                    --
                                    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/groups/opt_out.
                                  • jcordes
                                    ... Hi Christian, I tried inserting an empty line at the top of the file, but am still experiencing the E147: Cannot do :global recursive If I keep the empty
                                    Message 17 of 21 , Feb 2, 2013
                                    • 0 Attachment
                                      On Saturday, 2 February 2013 17:29:45 UTC-4, Christian Brabandt wrote:
                                      > Hi jcordes!
                                      >
                                      >
                                      >
                                      > On Sa, 02 Feb 2013, jcordes wrote:
                                      >
                                      >
                                      >
                                      > > On Saturday, 2 February 2013 16:09:17 UTC-4, jcordes wrote:
                                      >
                                      > > > On Saturday, 2 February 2013 14:40:47 UTC-4, Tim Chase wrote:
                                      >
                                      > > > > On Sat, 2 Feb 2013 10:27:27 -0800 (PST), jcordes wrote:
                                      >
                                      > > > >
                                      >
                                      > > > > > On Friday, 1 February 2013 23:46:03 UTC-4, Tim Chase wrote:
                                      >
                                      > > > >
                                      >
                                      > > > > > > You could do something like
                                      >
                                      > > > >
                                      >
                                      > > > > > > :g/^\</'{+,'}-j
                                      >
                                      > > > >
                                      >
                                      > > > > >
                                      >
                                      > > > >
                                      >
                                      > > > > > Thanks very much for posting this. Your explanation (in a later
                                      >
                                      > > > >
                                      >
                                      > > > > > post) makes a lot of sense,
                                      >
                                      > > > >
                                      >
                                      > > > > > but for some reason I keep coming up
                                      >
                                      > > > > > with an 'invalid range' error when I use :g/^\</'{+,'}-j
                                      >
                                      > > > >
                                      >
                                      > > > > The only way I was able to trigger this was if either:
                                      >
                                      > > > >
                                      >
                                      > > > > 1) your relative-range happens to be swapped (such that the 2nd line
                                      >
                                      > > > > comes before the first line), or
                                      >
                                      > > > >
                                      >
                                      > > > > 2) if your file only has one line in it.
                                      >
                                      > > > >
                                      >
                                      > > > > I might be able to better determine what's going on if you can
                                      >
                                      > > > > produce a sample file against which I could test.
                                      >
                                      > > >
                                      >
                                      > > > Tim, and Christian:
                                      >
                                      > > >
                                      >
                                      > > > I have reduced the file to something very short - however, at some point the error changed to E147: Cannot do :global recursive. Here is the short version:
                                      >
                                      > > >
                                      >
                                      > > > ###########
                                      >
                                      > > > 2010.09.06
                                      >
                                      > > >
                                      >
                                      > > > Enter more city directory data - I already have quite a lot for my family in
                                      >
                                      > > > spreadsheets.
                                      >
                                      > > >
                                      >
                                      > > > ###########
                                      >
                                      > > >
                                      >
                                      > > > There are 5 lines, the last one being empty. Lines 3 and 4 are each terminated by a LF.
                                      >
                                      > > >
                                      >
                                      > > > I'm not sure if I may be misunderstanding the original proposal, to do
                                      >
                                      > > > :g/^\</'{+,'}-j
                                      >
                                      > > >
                                      >
                                      > > > Was it intended that the entire file should be visually selected first? I hadn't thought so.
                                      >
                                      > > >
                                      >
                                      > > > Thanks for your assistance,
                                      >
                                      > > > John
                                      >
                                      > >
                                      >
                                      > > Sorry for the repost - I just realized I should have attached the test file. Have done so in this message.
                                      >
                                      > > John
                                      >
                                      > >
                                      >
                                      >
                                      >
                                      > > 2010.09.06
                                      >
                                      > >
                                      >
                                      > > Enter more city directory data - I already have quite a lot for my family in
                                      >
                                      > > spreadsheets.
                                      >
                                      > >
                                      >
                                      >
                                      >
                                      > I think, this happens, because there is no empty first line in your
                                      >
                                      > file. Simply add an empty first line in front of everything and I
                                      >
                                      > believe the :g command works.
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > regards,
                                      >
                                      > Christian

                                      Hi Christian,

                                      I tried inserting an empty line at the top of the file, but am still experiencing the E147: Cannot do :global recursive

                                      If I keep the empty top line and visually select the entire file, then the command works as expected. This also works for the original file I was working with. So in summary, inserting an empty line at the top *and* visually selecting the entire file enables the command to work.
                                      Perhaps I misunderstood the original message and it was intended to select the whole file first.

                                      Thanks,
                                      John Cordes


                                      --
                                      --
                                      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/groups/opt_out.
                                    • vim@...
                                      ... It looks like it s the first line causing trouble. So I d expand my caveat to have a blank line at both the top and bottom of the file . I think it
                                      Message 18 of 21 , Feb 2, 2013
                                      • 0 Attachment
                                        > I have reduced the file to something very short - however, at some
                                        > point the error changed to E147: Cannot do :global recursive. Here
                                        > is the short version:
                                        >
                                        > ###########
                                        > 2010.09.06
                                        >
                                        > Enter more city directory data - I already have quite a lot for my
                                        > family in spreadsheets.
                                        >
                                        > ###########

                                        It looks like it's the first line causing trouble. So I'd expand my
                                        caveat to "have a blank line at both the top and bottom of the
                                        file". I think it stems from the '{ mark being the first line rather
                                        than the zero'th line, so when you add one to it, it points to line
                                        #2, coming *after* the '}-minus-one line (the top solitary line of
                                        text)

                                        Usually the E147 about ":global recursive" gets triggered when you
                                        try something like

                                        :g/pattern1/.;+5g/pattern2/d

                                        where you try to do a ":g" as the Ex command issued by an outer :g
                                        command. I couldn't find the help-target on that one off the top of
                                        my head (the help for E147 doesn't give anything on how to remedy
                                        that error).

                                        -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

                                        ---
                                        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/groups/opt_out.
                                      • jcordes
                                        ... Thank you Tim. John -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For
                                        Message 19 of 21 , Feb 4, 2013
                                        • 0 Attachment
                                          On Saturday, 2 February 2013 19:55:58 UTC-4, Tim Chase wrote:

                                          > > ###########
                                          >
                                          > > 2010.09.06
                                          >
                                          > >
                                          >
                                          > > Enter more city directory data - I already have quite a lot for my
                                          >
                                          > > family in spreadsheets.
                                          >
                                          > >
                                          >
                                          > > ###########
                                          >
                                          >
                                          >
                                          > It looks like it's the first line causing trouble. So I'd expand my
                                          >
                                          > caveat to "have a blank line at both the top and bottom of the
                                          >
                                          > file". I think it stems from the '{ mark being the first line rather
                                          >
                                          > than the zero'th line, so when you add one to it, it points to line
                                          >
                                          > #2, coming *after* the '}-minus-one line (the top solitary line of
                                          >
                                          > text)
                                          >
                                          >
                                          >
                                          > Usually the E147 about ":global recursive" gets triggered when you
                                          >
                                          > try something like
                                          >
                                          >
                                          >
                                          > :g/pattern1/.;+5g/pattern2/d
                                          >
                                          >
                                          >
                                          > where you try to do a ":g" as the Ex command issued by an outer :g
                                          >
                                          > command. I couldn't find the help-target on that one off the top of
                                          >
                                          > my head (the help for E147 doesn't give anything on how to remedy
                                          >
                                          > that error).
                                          >
                                          >
                                          >
                                          > -tim

                                          Thank you Tim.

                                          John

                                          --
                                          --
                                          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/groups/opt_out.
                                        Your message has been successfully submitted and would be delivered to recipients shortly.