Skip to content

Fix for MacVim Syntax Error; Throws “Only one file name allowed”

2011 February 25
by James Kyle

I keep a lot of my user installed applications in /Applications/User Utilities. Keeps some modicum of organization and reduces a bit of clutter in my /Applications directory. After moving MacVim to this directory, I began getting several errors when opening files. They were all of the same type.

E172: Only one file name allowed
With occurrances on several lines in the runtime/syntax/vim.vim file. Opening the file, I found syntax like the following
exe "syn include @vimPerlScript ".s:perlpath
You may notice the perpath variable is where the problem lies. the space gives the appearance of two arguments instead of a single path. We can prevent this by using fnameescape

For me, these errors occurred on lines 585, 607, and 628.

  • Line 585
    exe "syn include @vimPerlScript ".s:perlpath
    becomes
    exe "syn include @vimPerlScript ".s:fnameescape(perlpath)
  • Line 607
    exe "syn include @vimRubyScript ".s:rubypath
    becomes
    exe "syn include @vimRubyScript ".s:fnameescape(rubypath)
  • Line 628
    exe "syn include @vimPythonScript ".s:pythonpath
    becomes
    exe "syn include @vimPythonScript ".s:fnameescape(pythonpath)

All done.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS