Thursday, December 15, 2011

Re: Using Quotes in VimScript for maps

On Dec 15, 12:32 am, Christian Brabandt <cbli...@256bit.org> wrote:
> Hi td!
>
> On Mi, 14 Dez 2011, td wrote:
>
> > Thanks for the response.
>
> > The script works under Win7(64-bit, VIM 32-bit), but fails on WinXP(32-
> > bit) when I have spaces in the file name.
>
> So you need to escape the file name, e.g.
> exe ":!python" fnameescape(expand(@%))
>
> (or whatever your command was)
>

It needs to be shellescape() rather than fnameescape(). fnameescape()
is for Vim commands accepting a file name.

Note that if you're on Windows (as you have said), and if 'shellslash'
is set, shellescape() does stupid things. Be sure to set noshellslash
(temporarily, if need be) prior to using shellescape() on Windows.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: