"Exploding" a paragraph into individual lines

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

"Exploding" a paragraph into individual lines

Chris Lott
I'd like to take a paragraph like the following:

This is a paragraph. Wow! What do I do now?

And break it into individual lines, ala:

This is a paragraph.
Wow!
What do I do now?

StackExchange revealed this regex that seems to work well matching the proper lines:
[.!?][])"']*\($\|[ ]\)

So I can do this:
:%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g

But obviously need something where XXX is!

c

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Tim Chase
On 2016-01-27 09:49, Chris Lott wrote:

> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching
> the proper lines: [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!

There are two possibilities:  capture the stuff you want to keep
with "\(...\)" and put it where the "XXX" is with "\1":

   :%s/\([.!?][])"']*\)\($\|[ ]\)/\1\r\r/g

or, simply start your replacement at that location using "\zs"

   :%s/[.!?][])"']*\zs\($\|[ ]\)/\r\r/g

You might also want to capture multiple spaces, changing it from

   \($\|[ ]\)

to

   \($\|[ ]\+\)

(the brackets around the single space are optional, but do help with
readability; I'd have just used

   \($\| \+\)

for one or more spaces)

-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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Nikolay Aleksandrovich Pavlov
In reply to this post by Chris Lott
2016-01-27 20:49 GMT+03:00 Chris Lott <[hidden email]>:

> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!

This should be `\1`, while part before `\(` should be surrounded by
`\(\)`. And already existing `\(` should be `\%(` because you do not
need capturing here. You can also put `\zs` before `\%(`, in this case
`XXX` should be nothing, `\(\)` is also not needed.

>
> c
>
> --
> --
> 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 [hidden email].
> 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Rik-20
In reply to this post by Chris Lott
On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:

> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c
Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.

Lott.

--
Rik

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Chris Collision
Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.

On Thu, Jan 28, 2016 at 7:40 PM, Rik <[hidden email]> wrote:
On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c

Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.

Lott.

--
Rik

--
--
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Rik-20
On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:

> Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>
>
> On Thu, Jan 28, 2016 at 7:40 PM, Rik <[hidden email]> wrote:
> On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>
> > I'd like to take a paragraph like the following:
>
> >
>
> > This is a paragraph. Wow! What do I do now?
>
> >
>
> > And break it into individual lines, ala:
>
> >
>
> > This is a paragraph.
>
> > Wow!
>
> > What do I do now?
>
> >
>
> > StackExchange revealed this regex that seems to work well matching the proper lines:
>
> > [.!?][])"']*\($\|[ ]\)
>
> >
>
> > So I can do this:
>
> > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> >
>
> > But obviously need something where XXX is!
>
> >
>
> > c
>
>
>
> Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>
>
>
> Lott.
>
>
>
> --
>
> Rik
>
>
>
>
>
> --
>
> --
>
> 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 [hidden email].
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
>
>
>
>
>
>
>
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907
1. Please do not top-post.

That would be parsed by the proposed regex as
  1.
  Please do not top-post.

Doomed to fail, Mr. Lott.

That would be parsed as:
  Doomed to fail, Mr.
  Lott.

Do you see any problem here?

--
rik

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Chris Collision


On Thu, Jan 28, 2016 at 8:04 PM, Rik <[hidden email]> wrote:
On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
> Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>
>
> On Thu, Jan 28, 2016 at 7:40 PM, Rik <[hidden email]> wrote:
> On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>
> > I'd like to take a paragraph like the following:
>
> >
>
> > This is a paragraph. Wow! What do I do now?
>
> >
>
> > And break it into individual lines, ala:
>
> >
>
> > This is a paragraph.
>
> > Wow!
>
> > What do I do now?
>
> >
>
> > StackExchange revealed this regex that seems to work well matching the proper lines:
>
> > [.!?][])"']*\($\|[ ]\)
>
> >
>
> > So I can do this:
>
> > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> >
>
> > But obviously need something where XXX is!
>
> >
>
> > c
>
>
>
> Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>
>
>
> Lott.
>
>
>
> --
>
> Rik
>
>
>
>
>
> --
>
> --
>
> 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 [hidden email].
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
>
>
>
>
>
>
>
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | <a href="tel:503.997.1907" value="+15039971907">503.997.1907

1. Please do not top-post.

That would be parsed by the proposed regex as
  1.
  Please do not top-post.

Doomed to fail, Mr. Lott.

That would be parsed as:
  Doomed to fail, Mr.
  Lott.

Do you see any problem here?

--
rik

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.


Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?


--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Salman Halim


On Jan 28, 2016 11:56 PM, "Chris Collision" <[hidden email]> wrote:
>
>
>
> On Thu, Jan 28, 2016 at 8:04 PM, Rik <[hidden email]> wrote:
>>
>> On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
>> > Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>> >
>> >
>> > On Thu, Jan 28, 2016 at 7:40 PM, Rik <[hidden email]> wrote:
>> > On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>> >
>> > > I'd like to take a paragraph like the following:
>> >
>> > >
>> >
>> > > This is a paragraph. Wow! What do I do now?
>> >
>> > >
>> >
>> > > And break it into individual lines, ala:
>> >
>> > >
>> >
>> > > This is a paragraph.
>> >
>> > > Wow!
>> >
>> > > What do I do now?
>> >
>> > >
>> >
>> > > StackExchange revealed this regex that seems to work well matching the proper lines:
>> >
>> > > [.!?][])"']*\($\|[ ]\)
>> >
>> > >
>> >
>> > > So I can do this:
>> >
>> > > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>> >
>> > >
>> >
>> > > But obviously need something where XXX is!
>> >
>> > >
>> >
>> > > c
>> >
>> >
>> >
>> > Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>> >
>> >
>> >
>> > Lott.
>> >
>> >
>> >
>> > --
>> >
>> > Rik
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > --
>> >
>> > 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 [hidden email].
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > -Collision
>> > @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907
>>
>> 1. Please do not top-post.
>>
>> That would be parsed by the proposed regex as
>>   1.
>>   Please do not top-post.
>>
>> Doomed to fail, Mr. Lott.
>>
>> That would be parsed as:
>>   Doomed to fail, Mr.
>>   Lott.
>>
>> Do you see any problem here?
>>
>> --
>> rik
>>
>> --
>> --
>> 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 [hidden email].
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?
>
>
>
> --
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

The convention of two spaces after sentences isn't something you can hold most people to these days. It might be easier to just rejoin lines that end in common abbreviations such as Mr., Dr., etc.

Of course, the case of the "etc." is more interesting because it could be the end of a sentence or it may not. Typically, if it's not the end of a sentence, it's followed by a comma. And, if it is the end of a sentence, it is followed by whitespace and a capital letter.

You may also have to contend with Ave., Blvd., St. (Saint or Street). I think it will require more logic than is afforded by a single substitute operation, as suggested before.

Suddenly, the two-space option looks pretty good. :)

Salman

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
BPJ
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

BPJ


fredag 29 januari 2016 skrev Salman Halim <[hidden email]>:


On Jan 28, 2016 11:56 PM, "Chris Collision" <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;cfcollision@gmail.com&#39;);" target="_blank">cfcollision@...> wrote:
>
>
>
> On Thu, Jan 28, 2016 at 8:04 PM, Rik <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;amphiboly@gmail.com&#39;);" target="_blank">amphiboly@...> wrote:
>>
>> On Thursday, January 28, 2016 at 10:56:59 PM UTC-5, Chris Collision wrote:
>> > Well-formatted text isn't the same thing as natural language; I do not think this is doomed to fail.  Is there a way to use paragraph / sentence motions to do this "exploding"?  I have played around for a few minutes but have not had much luck.  Perhaps an expert can take this farther.
>> >
>> >
>> > On Thu, Jan 28, 2016 at 7:40 PM, Rik <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;amph...@gmail.com&#39;);" target="_blank">amph...@...> wrote:
>> > On Wednesday, January 27, 2016 at 12:49:39 PM UTC-5, Chris Lott wrote:
>> >
>> > > I'd like to take a paragraph like the following:
>> >
>> > >
>> >
>> > > This is a paragraph. Wow! What do I do now?
>> >
>> > >
>> >
>> > > And break it into individual lines, ala:
>> >
>> > >
>> >
>> > > This is a paragraph.
>> >
>> > > Wow!
>> >
>> > > What do I do now?
>> >
>> > >
>> >
>> > > StackExchange revealed this regex that seems to work well matching the proper lines:
>> >
>> > > [.!?][])"']*\($\|[ ]\)
>> >
>> > >
>> >
>> > > So I can do this:
>> >
>> > > :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>> >
>> > >
>> >
>> > > But obviously need something where XXX is!
>> >
>> > >
>> >
>> > > c
>> >
>> >
>> >
>> > Regex cannot handle the complexity of natural language, and thus you are doomed to fail, Mr.
>> >
>> >
>> >
>> > Lott.
>> >
>> >
>> >
>> > --
>> >
>> > Rik
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> > --
>> >
>> > 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 <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;vim_use%2Bu...@googlegroups.com&#39;);" target="_blank">vim_use+u...@....
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> >
>> >
>> >
>> > --
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > -Collision
>> > @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907
>>
>> 1. Please do not top-post.
>>
>> That would be parsed by the proposed regex as
>>   1.
>>   Please do not top-post.
>>
>> Doomed to fail, Mr. Lott.
>>
>> That would be parsed as:
>>   Doomed to fail, Mr.
>>   Lott.
>>
>> Do you see any problem here?
>>
>> --
>> rik
>>
>> --
>> --
>> 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 <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;vim_use%2Bunsubscribe@googlegroups.com&#39;);" target="_blank">vim_use+unsubscribe@....
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> Please forgive me for top-posting: I forgot that gmail does that by default.  Won't happen again.  Would this incredibly difficult counterexample of yours be solved by the venerable convention of using two spaces after sentence-ending punctuation?
>
>
>
> --
> -Collision
> @cfcollision | http://idontevenownatelevision.com/ | http://tinyletter.com/collision | 503.997.1907

The convention of two spaces after sentences isn't something you can hold most people to these days. It might be easier to just rejoin lines that end in common abbreviations such as Mr., Dr., etc.

Of course, the case of the "etc." is more interesting because it could be the end of a sentence or it may not. Typically, if it's not the end of a sentence, it's followed by a comma. And, if it is the end of a sentence, it is followed by whitespace and a capital letter.

You may also have to contend with Ave., Blvd., St. (Saint or Street). I think it will require more logic than is afforded by a single substitute operation, as suggested before.

Suddenly, the two-space option looks pretty good. :)


Most of those abbreviations begin with a capital letter and are only <= 4 letters long. While a sentence certainly may end in something like "Bob." that may be an acceptable overkill. Then you need to look out for "e.g.", "i.e.", "viz." and a few more which I can't remember off the top of my head. That should be possible with lookbehind, something like (untested since I'm AFC)

s#\v%(%(%(\u\l{1,3}|i\.e|e\.g|viz)\.?)@<![.?!]\)?)@<=#\r\r#g

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Tim Chase
In reply to this post by Salman Halim
On 2016-01-29 00:03, Salman Halim wrote:
> Suddenly, the two-space option looks pretty good. :)

This is my main reason for sticking to the old-school
two-spaces-after-a-sentence since Vim knows how to work with
sentences distinct from abbreviations.

   :help cpo-j
   :h 'joinspaces'

Since all the prose I write ends up being processed (usually raw HTML
processed by a browser that formats inter-sentence spacing however it
sees fit; though any TeX, Markdown, or DocBook would do likewise), it
allows me to work predictably with sentences in Vim while getting
"proper" output from whatever is viewing the results.

-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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Tim Chase
In reply to this post by Rik-20
On 2016-01-28 20:04, Rik wrote:
> 1. Please do not top-post.

Also, trim out the extra rubbish and only keep the stuff you're
responding to.  When you (Rik) replied, you included 96 lines of
quotation, of which less than a dozen could be considered valuable
context.  Especially when you're quoting things that come from Google
Groups which likes to bloat out quoting with empty quote-junk.

-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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
BPJ
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

BPJ


fredag 29 januari 2016 skrev Tim Chase <[hidden email]>:
On 2016-01-28 20:04, Rik wrote:
> 1. Please do not top-post.

Also, trim out the extra rubbish and only keep the stuff you're
responding to.  When you (Rik) replied, you included 96 lines of
quotation, of which less than a dozen could be considered valuable
context.  Especially when you're quoting things that come from Google
Groups which likes to bloat out quoting with empty quote-junk.

I'm as guilty of doing that. I was going to  defend myself by saying that it is difficult for me to select-and-cut extensively in the gmail app for iphone because I am literally lame, but I could have refrained from replying until I could do so on my desktop, where I edit mail in gvim.

/bpj

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Rick Dooling-2
In reply to this post by Chris Lott
On Wednesday, January 27, 2016 at 11:49:39 AM UTC-6, Chris Lott wrote:

> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c
You might find the following collection of filters useful. Written in Ruby.

https://github.com/olivertaylor/text-utilities

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Exploding" a paragraph into individual lines

Chris Collision

On Tue, Feb 2, 2016 at 5:39 AM, Rick Dooling <[hidden email]> wrote:
On Wednesday, January 27, 2016 at 11:49:39 AM UTC-6, Chris Lott wrote:
> I'd like to take a paragraph like the following:
>
> This is a paragraph. Wow! What do I do now?
>
> And break it into individual lines, ala:
>
> This is a paragraph.
> Wow!
> What do I do now?
>
> StackExchange revealed this regex that seems to work well matching the proper lines:
> [.!?][])"']*\($\|[ ]\)
>
> So I can do this:
> :%s/[.!?][])"']*\($\|[ ]\)/XXX\r\r/g
>
> But obviously need something where XXX is!
>
> c

You might find the following collection of filters useful. Written in Ruby.

https://github.com/olivertaylor/text-utilities




This plugin does something similar to OP's request (toggling between sentences and bullet lists), and may be a good starting point.  Basically, it "explodes" a text list into a bulleted list with line breaks.

There's an introduction here:

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.