vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] deleting blank lines over a range


From: Wayne Cuddy
Subject: Re: [vile] deleting blank lines over a range
Date: Mon, 22 Sep 2014 19:26:29 -0400
User-agent: Mutt/1.4.2.3i

On Wed, May 11, 2011 at 04:58:18PM -0400, Thomas Dickey wrote:
> On Wed, 11 May 2011, address@hidden wrote:
> 
> >It would be preferable if force-blank-lines, or something like it, operated
> >over a range, motion command or region.
> 
> agreed (this doesn't seem hard...)

Did you ever have time to go back and revisit this? I had forgotten
about this thread but recently I've required this functionality again.

> 
> >Or a more general solution would be to allow the g or v command to operate
> >over a range: :<range>g/^$/d

This time I wasn't looking for empty lines to delete but lines that
match or contain a pattern so it wouldn't be simply /^$/.

The way I've been doing it currently it filtering a region through
'grep -v' to get the same result... unless there's a better 'vile' way
to do it.

> 
> yes... I don't recall it being discussed in a while - requires some
> extension to the way things are parsed.  I'll revisit that.
> 
> >
> >On Thu, Apr 28, 2011 at 04:37:14PM -0400, Thomas Dickey wrote:
> >>On Thu, 28 Apr 2011, Paul Fox wrote:
> >>
> >>>address@hidden wrote:
> >>>>I see that the v and g commands only operate over the entire file and I
> >>>can
> >>>>use deblank for individual lines but is there a way to delete empty
> >>>lines as
> >>>>specified via a range or the selection?
> >>>
> >>>i don't believe so.  i've wanted that a few times myself.  the closest
> >>>you can get is, do it once, then hold the '.' key down.  :-)
> >>>
> >>>that command came pretty much directly from uemacs, and has never
> >>>been converted or offered in an operator form.
> >>
> >>Offhand, I'm curious what a pure-vi syntax might be to delete blank lines
> >>in a range (since that would make a pattern prompt somewhere in the
> >>command).
> >>
> >>I see "forceblank" is what "deblank" used to be.
> >>
> >>--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]