On Wed, Jul 22, 2009 at 5:44 PM, Tony Mechelynck wrote:
>
> On 22/07/09 10:53, Roald wrote:
>>
>> Thanks for the replies, but that was not exactly what I meant. The
>> example was just an example. Another example would be:
>> vim | mail -s “subject” [email protected]
>> I'm more interested in the general case. Piping is something very
>> common in unix, and I wondered if vim supported it fully.
>>
>> Kind regards, Roald
>
> AFAIK, Vim can read its input editfile on stdin (if called with a single
> dash at the end of the command-line) but it won't write its output
> editfile to stdout. To feed Vim's output to a program which wants it on
> stdin, write it to some filename (e.g. using ":saveas") and feed it to
> the next program by means of input redirection:
>
> vim
> ...
> :saveas ~/foobar.txt
> :qa
> someprogram < ~/foobar.txt
Or using, eg
:w !someprogram
to run someprogram with the current buffer as its stdin started from
inside vim, so that when someprogram exits you'll be back in vim.
But, I definitely agree with others in this thread - trying to use vim
as a filter (like sed) is much more difficult than one might think;
you're almost certainly better off just using temp files.
~Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---