Hi,

Steven Woody wrote:
> 
> On Wed, Sep 23, 2009 at 5:58 PM, Jürgen Krämer <jottka...@googlemail.com
> <mailto:jottka...@googlemail.com>> wrote:
> 
>> :let &path = &path . substitute($VARIABLE, ' ', '\\\ ', 'g')

note that I probably forgot a ',' between &path and substitute and that
there is one unnecessesary backslash, so this should really be

  :let &path = &path . ',' . substitute($VARIABLE, ' ', '\\ ', 'g')

> This works!! Thanks.  But I've not quite understand :
> 1. why use let instead of 'set'? what's the difference?

Because the spaces in $VARIABLE need to be escaped. This is not
automatically done with

  set path+=$VARIABLE

If you append the directory directly you have to write

  set path+=C:\Directory\\\ with\\\ spaces\sub\\\ directory

because for compatibility reasons in the path option an unescaped space
is treated like a comma.

> 2. what means '\\\ '?

Except for the unnecessary backslash this means to replace every space
with a backslash and a space. The double backslash seems to be needed
even in single quotes.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to