executing VIM on a remote machine?

Discussion in 'Ruby' started by gianmh@gmail.com, Nov 1, 2007.

  1. Guest

    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?
    , Nov 1, 2007
    #1
    1. Advertising

  2. Guest

    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/.
    , Nov 1, 2007
    #2
    1. Advertising

  3. Guest

    On 01/11/2007, 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?

    ruby -e 'system "ssh user@machine vim remote_file"'
    SCNR
    , Nov 1, 2007
    #3
  4. Guest

    Pete Elmore wrote:
    > On 01/11/2007, 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?

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


    Does that edit the file?
    --
    Posted via http://www.ruby-forum.com/.
    , Nov 1, 2007
    #4
  5. Guest

    On 01/11/2007, 7stud -- <> wrote:
    > 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. :)
    , Nov 1, 2007
    #5
  6. Guest

    On 11/1/07, Pete Elmore <> wrote:
    > On 01/11/2007, 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?

    > 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
    , Nov 2, 2007
    #6
  7. Guest

    On 11/1/07, Pete Elmore <> wrote:
    > On 01/11/2007, 7stud -- <> wrote:
    > > 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. :)
    >
    >
    , Nov 2, 2007
    #7
  8. Guest

    On 11/1/07, Pete Elmore <> wrote:
    > On 01/11/2007, 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?

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


    also
    vim warns
    output not to a terminal
    input is not form a terminal
    , Nov 2, 2007
    #8
  9. Guest

    On Friday 02 November 2007, Gian Holland 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
    , Nov 2, 2007
    #9
  10. Guest

    On 01/11/2007, 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?
    >
    >


    you should look into 'sed' which is a command line editor and acts in
    many ways as vim does without being interactive.
    http://www.grymoire.com/Unix/Sed.html

    Paolo
    , Nov 2, 2007
    #10
  11. Guest

    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


    -------
    http://airbladesoftware.com
    , Nov 2, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tocer
    Replies:
    0
    Views:
    457
    tocer
    Aug 28, 2004
  2. Daniel Folkes

    New to Vim and Vim-Python

    Daniel Folkes, Oct 24, 2007, in forum: Python
    Replies:
    3
    Views:
    522
    projecktzero
    Oct 25, 2007
  3. Guoliang Cao

    vim 6.2 + vim-ruby don't work

    Guoliang Cao, Oct 16, 2003, in forum: Ruby
    Replies:
    1
    Views:
    136
    Brett H. Williams
    Oct 16, 2003
  4. Vincent Foley
    Replies:
    6
    Views:
    127
    Gavin Sinclair
    Apr 10, 2006
  5. lolveley
    Replies:
    3
    Views:
    190
Loading...

Share This Page