Executing VIM on a remote machine?

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

Gian Holland wrote:

Is is possible with ruby to execute vim on a remote machine to edit a
file?
can some one point me in the right direction?

Why would you use vim instead of editing the file directly, e.g.

File.foreach("data.txt") do |line|
  #do something to line
end

···

--
Posted via http://www.ruby-forum.com/\.

ruby -e 'system "ssh user@machine vim remote_file"'
SCNR

···

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

you should look into 'sed' which is a command line editor and acts in
many ways as vim does without being interactive.

Paolo

···

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

Hi,

···

On 1 Nov 2007, at 20:54, Gian Holland wrote:

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

I'm not sure I understand your goal, but if you wish to use vim to edit a remote file vim does this out of the box:

http://www.vim.org/tips/tip.php?tip_id=337

Forgive me if I have misunderstood your question.

Regards,
Andy Stewart

-------

Pete Elmore wrote:

···

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:

Is is possible with ruby to execute vim on a remote machine to edit a file?
can some one point me in the right direction?

ruby -e 'system "ssh user@machine vim remote_file"'
SCNR

Does that edit the file?
--
Posted via http://www.ruby-forum.com/\.

That worked but now I am getting strange characters when i use the
back key and hit esc to go into command mode

···

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> Is is possible with ruby to execute vim on a remote machine to edit a file?
> can some one point me in the right direction?
ruby -e 'system "ssh user@machine vim remote_file"'
SCNR

also
vim warns
output not to a terminal
input is not form a terminal

···

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:

On 01/11/2007, Gian Holland <gianmh@gmail.com> wrote:
> Is is possible with ruby to execute vim on a remote machine to edit a file?
> can some one point me in the right direction?
ruby -e 'system "ssh user@machine vim remote_file"'
SCNR

Well, it does start up vim on the remote file, so, provided you change
it and then hit :wq, it'll edit it. :slight_smile:

···

On 01/11/2007, 7stud -- <bbxx789_05ss@yahoo.com> wrote:

Pete Elmore wrote:
> ruby -e 'system "ssh user@machine vim remote_file"'
> SCNR

Does that edit the file?

You need to use the -t option of ssh to get a pseudo terminal.

Sylvain

···

On Friday 02 November 2007, Gian Holland wrote:

ruby -e 'system "ssh user@machine vim remote_file"'

> Pete Elmore wrote:
> > ruby -e 'system "ssh user@machine vim remote_file"'
> > SCNR
>
> Does that edit the file?
Well, it does start up vim on the remote file, so, provided you change
it and then hit :wq, it'll edit it. :slight_smile:

···

On 11/1/07, Pete Elmore <1337p337@gmail.com> wrote:

On 01/11/2007, 7stud -- <bbxx789_05ss@yahoo.com> wrote: