Error in function query_path when opening ruby file #143

robi-wan opened this Issue Mar 19, 2013 · 1 comment


None yet

3 participants


I am running vim 7.3.829 on Windows 7 64bit.

When opening a ruby file an error is displayed in vim:


The important message says:

"'" kann syntaktisch an dieser Stelle nicht verarbeitet werden

which means

"'" can not be processed at this point syntactically


:echo system("ruby -e 'print $:.join(%q{,})'")

as mentionend in #77 gets the same error:

"'" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
E484: Can't open file C:\Users\ntrs\AppData\Local\Temp\VIoFFA8.tmp

Reading this reminded me that

parentheses ( ) are special characters that must be preceded by the escape character (^) or quotation marks when you pass them as arguments.

When I change the command to

:echo system("ruby -e 'print $:.join^(%q{,}^)'")

(note that I escaped the parentheses ( ) with ^ ) it displays the expected result.

In vim-fugitive happens something similar:

Another way of getting this command execute on windows is switching the single and double quotation marks:

:echo system('ruby -e "print $:.join(%q{,})"')

Note that the single quotation marks are at the outside and the double quotation marks are at the inner side of the command.

My shellxquote variable defaults to (.

Or get rid of the parentheses around the join arguments:

:echo system("ruby -e 'print $:.join %q{,}'")

This also works.

@tpope tpope added a commit that closed this issue Mar 19, 2013
@tpope tpope Fix Windows shell escaping issue
Closes #143.
@tpope tpope closed this in 3ead93f Mar 19, 2013
tpope commented Mar 19, 2013

Great analysis. I've dropped the parentheses. I've battled with Windows escaping enough that I'd rather sidestep it entirely whenever possible.

@airblade airblade referenced this issue in airblade/vim-gitgutter Mar 19, 2013

Kind of "freeze" on Windows 7 #44

@dkearns dkearns added the ftplugin label Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment