On Sat, Feb 11, 2017 at 2:37 AM, Bram Moolenaar <[email protected]> wrote:

>
> Tim Chase wrote:
>
> > On 2017-02-09 16:06, Bram Moolenaar wrote:
> > > I don't think it can be done with one command.  Simplest seems to
> > > be to copy the text and then filter it.
> > >     (visually select the text)
> > >     YP
> > >     gv
> > >     :!filter-command
> > >
> > > Would not be a bad idea to have an Ex command for this.  Not sure
> > > what to call it, :feed perhaps?  :writeread ?
> >
> > With three input parameters (source range, destination location, and
> > command to execute), I'm unaware of anything that currently does
> > this.
>
> The :move and :copy command do have a range and a destination address.
> We should follow that syntax, and put a command at the end.
>
> > Fortunately, copying should also set the '[ and '] marks, so
> > something similar to the above would work even in builds without
> > visual mode:
> >
> >   :{range}t{destination}
> >   :'[,']!{filter-command}
> >
> > If it's limited to putting input at a given line, I'd want/expect the
> > full power of ex range/line specifiers, allowing for complex offsets
> > like
> >
> >   :{range}cmd?^TABLE OF CONTENTS$?+1 {filter-command}
> >
> > (such as :t and :m allow for targets)
> >
> > That said, it's not that hard to use the pair of commands above (or
> > map it or make a :command), so I don't see a great need for a new
> > built-in to do the same.
>
> Perhaps this will work:
>         :{range}copy {address} !cmd
>

Just wondering how this would work with :g, hope it wont be executing the
filter against each line, rather as a whole. It would be useful to have a
set of lines selected using :g applied against a filter. If the output of
the filtered command be captured to a register (or to a destination line,
like copy), that would be awesome. Maybe, :g, is not the right command to
use, but something like that would be useful, IMHO.

Regards,
-Arun

>
> It's like making a copy, but filtering the text.
>
> --
> Clothes make the man.  Naked people have little or no influence on society.
>                                -- Mark Twain (Samuel Clemens) (1835-1910)
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
>  \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org
> ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org
> ///
>
> --
> --
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to