Quantcast

Backslash spaces in windows'path

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Backslash spaces in windows'path

epanda
Hi,


I would like to avoid to backslash all spaces when I have to use
windows path.

eg : DirDiff c:\user\Documents\ and\ settings

Can I avoid to put backslahes ?
Thank you

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

Andy Wokula
Am 08.03.2010 19:50, schrieb epanda:
I would like to avoid to backslash all spaces when I have to use
> windows path.
>
> eg : DirDiff c:\user\Documents\ and\ settings
>
> Can I avoid to put backslahes ?

What's the notation you would like to use instead?

--
Andy

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

epanda


On 8 mar, 19:55, Andy Wokula <[hidden email]> wrote:

> Am 08.03.2010 19:50, schrieb epanda:
> I would like to avoid to backslash all spaces when I have to use
>
> > windows path.
>
> > eg : DirDiff c:\user\Documents\ and\ settings
>
> > Can I avoid to put backslahes ?
>
> What's the notation you would like to use instead?
>
> --
> Andy

c:\user\Documents and settings or  c:/user/Documents and settings

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

Andy Wokula
Am 08.03.2010 20:22, schrieb epanda:

>
>
> On 8 mar, 19:55, Andy Wokula<[hidden email]>  wrote:
>> Am 08.03.2010 19:50, schrieb epanda:
>> I would like to avoid to backslash all spaces when I have to use
>>
>>> windows path.
>>
>>> eg : DirDiff c:\user\Documents\ and\ settings
>>
>>> Can I avoid to put backslahes ?
>>
>> What's the notation you would like to use instead?
>
> c:\user\Documents and settings or  c:/user/Documents and settings

The :edit command, for example, doesn't require a backslash before a
space.

but :DirDiff (the one I know from the plugin), on the other hand, does,
because it requires at least two arguments which are separated by
spaces.  I don't need to type the backslashes, because the <Tab> key
inserts them for me:
     :DirDiff c:\user\Doc<Tab>
->
     :DirDiff c:\user\Documents\ and\ settings
(or similar).

So, actually, where is the problem?

--
Andy

http://vim.sf.net/scripts/script.php?script_id=102

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

epanda
Problem is windows. :)

When I want to do a readfile I have to name paths like that :

c:\\my\ path\ with\ spaces\\mySubPath

And it makes me doing double of writing work.

It is a little annoying.
:)

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

Christian Brabandt
Hi epanda!

On Mo, 08 Mär 2010, epanda wrote:

> When I want to do a readfile I have to name paths like that :
>
> c:\\my\ path\ with\ spaces\\mySubPath
>
> And it makes me doing double of writing work.
>
> It is a little annoying.

I don't see your problem. I can do:
:let a=readfile('C:\Program Files\vim\vimfiles\plugin\DirDiff.vim')

(Unfortunately, readfile does not complete file names, so I neede to
paste it. But it works, while using " does not work:
:let a=readfile('C:\Program Files\vim\vimfiles\plugin\DirDiff.vim')
returns: E484 Can't open file…

So try to use single apostrophes.

Maybe setting shellslash could also work for you (see :h 'ssl')


Mit freundlichen Grüßen
Christian
--
Jeder Mensch gilt in dieser Welt nur so viel, als wozu er sich selbst
macht.
                -- Adolph von Knigge (Über den Umgang mit Menschen)

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

epanda
ok I will use it.
Thank you christian

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Backslash spaces in windows'path

Tony Mechelynck
In reply to this post by epanda
On 08/03/10 19:50, epanda wrote:

> Hi,
>
>
> I would like to avoid to backslash all spaces when I have to use
> windows path.
>
> eg : DirDiff c:\user\Documents\ and\ settings
>
> Can I avoid to put backslahes ?
> Thank you
>

Even if Bill Gates & Co. document them badly (maybe they want to
"deprecate" them?), on FAT systems 8.3 "Dos-like" paths are still
usable... and useful:

        :DirDiff C:/user/DOCUME~1

or for

        C:\My Long Path With Spaces\My Subpath\My File With Spaces.txt

you can use something like

        C:/MYLONG~1/MYSUBP~1/MYFILE~1.TXT

See ":help filename-modifiers" and in particular the :8 modifier. (The
~1 ~2 etc. ending is assigned for unicity, so if there are siblings
whose first six 8.3-compatible characters are identical it could be
other than ~1)


Best regards,
Tony.
--
DEAD PERSON:  I'm getting better!
CUSTOMER:     No, you're not -- you'll be stone dead in a moment.
MORTICIAN:    Oh, I can't take him like that -- it's against regulations.
                                   The Quest for the Holy Grail (Monty
Python)

--
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
Loading...