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

Call a vim function from the command line

Expand Messages
  • Samuel Wright
    Hi All, Is it possible to invoke a function in vim automatically? I d like to process a text file automatically. I *could* write an onload for the specific
    Message 1 of 2 , Dec 1, 2006
    • 0 Attachment
      Hi All,

      Is it possible to invoke a function in vim automatically?
      I'd like to process a text file automatically. I *could* write an
      onload for the specific file that calls a functions, saves and exists,
      but it does not strike me as very elegant.

      Is there anything like

      vim -auto -text_file -function

      That I can use for this?

      Sam
    • Thomas
      ... Something like: vim -c call function() -c qa! text_file or so?
      Message 2 of 2 , Dec 1, 2006
      • 0 Attachment
        > Is it possible to invoke a function in vim automatically?
        > I'd like to process a text file automatically. I *could* write an
        > onload for the specific file that calls a functions, saves and exists,
        > but it does not strike me as very elegant.
        >
        > Is there anything like
        >
        > vim -auto -text_file -function


        :h starting.txt

        Something like:
        vim -c "call function()" -c qa! text_file

        or so?
      Your message has been successfully submitted and would be delivered to recipients shortly.