Tim Pease
8/21/2006 3:22:00 PM
On 8/20/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> here i type
>
> :r !echo arg1 arg2
>
> which says
>
> read in the output of 'echo arg1 arg2'
>
> yielding
>
> arg1 arg2
>
> into my file. if you don't want output you can do things like
>
Okay, the solution I came up with is to build up the command inside
one of the paste registers (@) and then execute that register. Here
is a simple example that will move to the current working directory
and do a file listing.
function FuncGetls( )
let @g="!cd " . getcwd() . "; ls"
@g
endfunction
command Getls call FuncGetls( )
My full solution for doing the rsync is this ...
command -nargs=1 Put call <SID>Put("<args>")
function <SID>Put(puter)
let s:dir=escape(getcwd(), "\"") . "/"
let @r="!rsync -v -rulptzCF " . s:dir . " " . a:puter . ":" . s:dir
@r
endfunction
Now I can send all the files I've modified to another computer by
typing the following command ...
:Put panic
where panic is the name of the machine.
TwP