[Novalug] VI - rieties (was Re: vi question)

Jon LaBadie novalugml at jgcomp.com
Mon Apr 13 02:27:10 EDT 2009


On Mon, Apr 13, 2009 at 01:03:21AM -0400, Mackenzie Morgan wrote:
> On Monday 13 April 2009 12:38:50 am Jon LaBadie wrote:
> > On Mon, Apr 13, 2009 at 12:02:04AM -0400, Mackenzie Morgan wrote:
> > > On Sunday 12 April 2009 7:59:04 pm Jon LaBadie wrote:
> > > > On Sun, Apr 12, 2009 at 07:45:00PM -0400, Mackenzie Morgan wrote:
> > > > > 
> > > > > I know how to delete to the end of a sentence ("df.")
> > > > 
> > > > No, that delete upto, and including a period.  d) (right paren) deletes 
> to
> > > > the beginning of the next sentence.
> > > 
> > > How does it determine the end of a sentence, if not "location of the next 
> > > period"?
> > > 
> > 
> > Period is not the only character that ends sentences and periods
> > may appear in things like IP addresses that are not the ends of
> > sentences.
> 
> So "period followed by whitespace" then?
> 
Not quite, because it also recognizes sentence terminators at end of line
and sentence terminators followed by punctuation.

I believe, but am not certain, that the original Bill Joy/BSD version of vi
assumed "double space" after sentence terminator.  It appears the vim uses
either single or double space.  Although note that a join (J) of two lines
at a sentence break inserts two spaces.

>  I suppose it false-positives on  things like "Mr. "?

Yes, If the text was 'My name is Dr. J.', then d) would delete to the 
upto, and including the space in front of the 'J'.  But your df. would
only delete to the '.' of Dr.  Typing a period after the too short delete
would repeat them to the correct position.  Adding a count, either d2)
or d2f. would work also.  Except d2) would delete any white space after
'J.' including an EOL.

btw, as you already knew about the 'f' command in vi (few vi users do :( )
and just learned about the 't' command, you might as well learn about the
';' and ',' commands as well.  After a T/t/F/f, the target is remembered
and a ';' repeats the move in the same direction while ',' changes directions.

So much trivia :)
-- 
Jon H. LaBadie                  jon at jgcomp.com
 JG Computing
 12027 Creekbend Drive		(703) 787-0884
 Reston, VA  20194		(703) 787-0922 (fax)



More information about the Novalug mailing list