Re: Use vim as filter?
- -----BEGIN PGP SIGNED MESSAGE-----
On Monday, 1. April 2002 21:12, Benji Fisher wrote:
> Can vim be used as a filter, like sed? For example,
> % ls | vim - --other-options
> I think the - option makes vim read a buffer from stdin, but how do we get
> it to write to stdout? I especially want this to work on Windows, where
> sed may not be available.
> Background: If I run :make then the compiler output is saved to an
> error file. AFAIK, I do not have a chance to clean up that error file,
> except by adding a filter to 'makeprg'. If I am running vim on Windows, I
> would like to use vim itself as the filter program.
> I might also want to do the same for 'equalprg'.
> --Benji Fisher
I think you should think over what you want to do. Since the 70's when the
first vi came out for some UNIX Computer it was thought as a "VISUAL" editor.
That's where the name comes from. Now you want to make it invisible again.
First, if you like System V,X/Open or Posix, all our nice UNIX standards, you
should try to install a cygwin or something similar for your Windows. Then
you can work with most of the well known commands like ed/sed ...
Most solutions you can find with other concepts might be much more flexible
and useful. But if you don't use a "|vim -" to read from stdin you should
also be able to call vim commands through stdin:
# This example only works for unix of course.
cat cmd-script| vim bla bla &> /dev/null
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----