Loading ...
Sorry, an error occurred while loading the content.

11202Remote commands?

Expand Messages
  • Sean DeNigris
    Feb 6, 2010
      Is there an easy way to use mvim --remote... to execute commands in a
      running instance of MacVim?

      This is what I've figured out so far from experimenting/docs
      * I can use --remote-send to type in the command
      * I can call a function that executes commands

      What I want to do is call a ruby method.

      What I am doing now is to add a function to my .vimrc like:
      function DoCommand(cmd)
      exe a:cmd
      endfunction

      So the usage would be like:

      If I have a ruby method:
      def delete_line(num)
      cb = VIM::Buffer.current
      cb.delete(1)
      end

      I could call it from the command line with:
      mvim --remote-expr "DoCommand('ruby delete_line(1)')" --servername
      VIM

      This works, but I was wondering if there was a way to do it directly
      from the command line (in a running instance of MacVim).

      Thanks!

      Sean DeNigris

      --
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 4 messages in this topic