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

56853passing local variable to shell howto

Expand Messages
  • Shaw Vrana
    Mar 1 1:53 PM
    • 0 Attachment
      Hi All,

      I'm trying to write a simple vim function that prompts me for a filename and
      then calls an external shell script with the entered filename, and then loads
      the file. Here's what I have so far.

      fun! GetFile()
      let myfilename = input("Filename? )
      !my_script myfilename
      e myfilename
      endfun

      This almost works, but it doesn't look like my_script is getting the value I
      entered for myfilename, though it is being assigned the value, and my_script
      is being called. I guess this is b/c I'm using the ! operator? How can I
      call my_script with the myfilename input?

      Any pointers or help pages greatly appreciated!

      Thanks,
      Shaw
    • Show all 3 messages in this topic