Re: vi editor

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

 



On Wed, 2006-07-12 at 17:20 -0600, Phil Meyer wrote:
> > Or, if you would like the output of that command inserted into your text,
> > use
> >
> > :r !pwd
> >
> > or any other command.  Oddly, that space before the ! is important.
> >

> >   
> !! is the proper way, but you can specify the shell.
> 
> !!sh
> !!csh
> !!bash
> 
> etc.
> 
> For really geeky guys, write a line of perl script, then:
> !!perl
> 
> cool stuff.

!! is for a single line in the buffer.
You can also write the whole buffer to a pipe with:
:w !sh
or 
:w !perl
or to just test if your perl is valid before saving
:w !perl

And in this case the space before the ! really is needed. With the
:r, is wasn't.

And if you would like the output of the program to replace the
current contents of the edit buffer
1!G  <-go to top, filter, range through end
programname   <-program to act as filter - for example sort.
all the usual range selection methods would work if you don't want
to pass the whole buffer.

-- 
 Les Mikesell
  lesmikesell@xxxxxxxxx



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux