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 H. 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

On 01/11/2007, Gian H. [email protected] 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

Pete E. wrote:

On 01/11/2007, Gian H. [email protected] 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?

On 11/1/07, Pete E. [email protected] wrote:

On 01/11/2007, 7stud – [email protected] wrote:

Pete E. 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 E. [email protected] wrote:

On 01/11/2007, Gian H. [email protected] 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

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 E. [email protected] wrote:

On 01/11/2007, Gian H. [email protected] 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 Friday 02 November 2007, Gian H. wrote:

ruby -e ‘system “ssh user@machine vim remote_file”’

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

Sylvain

On 01/11/2007, Gian H. [email protected] 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

Hi,

On 1 Nov 2007, at 20:54, Gian H. 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 S.