Hi

Steven Woody wrote:
> On Wed, Sep 23, 2009 at 2:47 PM, pansz <[email protected]
> <mailto:[email protected]>> wrote:
> 
> 
>     Steven Woody 写道:
>     > Hi,
>     > I am setting an external pathname to the path variable.  I found
>     when the
>     > pathname has no spaces, it works, but it doesn't work if it has
>     embedded
>     > spaces.  Enclosing it with "" also doesn't work.
>     >
>     > What's wrong with that?  Thanks.
>     >
>     does it work this way?
> 
>     set path=path\ name\ with\ space
> 
> 
> 
> Thanks for the hint. By the mean, the path variable is set successfully,
> I check this by run 'set path?'.  But 'gf' can not jump to my file.
>  It's strange.  Actually, my path now is 
>   path = .,Include,C:\Program Files\IAR Systems\Embedded Workbench
> 5.3\r32c\inc
> 'gf' can jumps files which are in './Include', but can not jump to files
> which are located in C:\Program Files\IAR Systems\Embedded Workbench
> 5.3\r32c\inc.  Do you have a clue?

have a look at

  :help 'path'

It says that spaces in a directory name must be preceded with an extra
backslash and escaped:

  :set path=.,Include,C:\Program\\\ Files\IAR\\\ Systems\Embedded\\\ 
Workbench\\\ 5.3\r32c\inc

> Another problem is, in my real life, I actually want the path to refer a
> environment variable, in this case, I can not insert '\ ' into it. How
> do you think it?

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

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