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

50385Re: 2html.vim script question

Expand Messages
  • Charles H. Shooshan III
    May 21, 2004
    • 0 Attachment
      Thanks for getting back to me. Here's some more feedback:

      $ vim --version | less
      does confirm that I made changes to my /usr/bin/vim alias file to point
      to the new version.

      I did also previously install the gvim script and gvim without
      parameters does invoke the GUI.

      The problem seems to be that when gvim is called with parameters that
      must include double quotes ("), those double quotes are not properly
      passed to the command-line. I have tried escaping the double quotes
      with backslashes but that doesn't help.

      $ vim -g -c "runtime! syntax/2html.vim" -c "wq" -c "q" Hello.java
      works but invokes the non-GUI version since vim -g doesn't invoke the
      GUI on the Mac.

      The script (gvim) contains the following single command:
      /Applications/vim/Vim.app/Contents/MacOS/Vim -g $* &

      If I enter the following in the Terminal:
      $ gvim -g -c "runtime! syntax/2html.vim" -c "wq" -c "q" Hello.java

      the messages I get are as follows:
      "syntax/2html.vim" [New File]
      Error detected while processing command line:
      "syntax/2html.vim" E212: Can't open file for writing
      E173: 1 more file to edit

      and the buffers contain: 2html.vim and Hello.java

      Again, any attempt to trick the script into passing along the double
      quotes have failed (but my shell script skills are pretty weak).

      Building on the info you gave me, I now find that if I save a new
      script called, let's say, gvim2html, with this command:

      /Applications/vim/Vim.app/Contents/MacOS/Vim -g -c "runtime!
      syntax/2html.vim" \
      -c "wq" -c "q" $1 &

      and then enter in the Terminal:
      $ gvim2html Hello.java
      all works well and I get the html file with the GUI colors!

      So, I guess the question left is whether it is possible to write a gvim
      script that will take all the parameters that
      /Applications/vim/Vim.app/Contents/MacOS/Vim -g would otherwise take.

      Thanks for all your help,
    • Show all 6 messages in this topic