80893Re: Problems with netrw directory listing
- Jun 3, 2007On 2007-06-03, Seth Mason <seth@...> wrote:
> Hi --I see the problem. I believe it is a bug in autoload/netrw.vim (at
> I'm running version 7.1 under cygwin on a windows xp machine.
> I'm trying to cd to the current directory with the directory browser
> (via the 'c' key) but I get the error message:
> E172: Only one file name allowed: cd /cygdrive/c/Documents and
> It seems like the spaces in the directory name is causing problems.
> If I open a file in the directory and then use ':cd %:h' everything
> works fine so it seems like the problem is not with vim(?).
> Any help or direction to go from here would be greatly appreciated.
line 1593 in version 109) in the definition of the c command:
nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
Any spaces in b:netrw_curdir are not escaped and the directory name
is not in quotes, so the cd command sees any spaces as separators.
I don't know at the moment what the right solution is. The
following workaround seems to fix this particular problem, but it
may introduce other problems especially when running vim in a pure
Unix or pure Windows environment.
nnoremap <buffer> <silent> c :exe "cd "'"'.b:netrw_curdir.'"'<cr>
Dr. Chip probably has some preferred solution for this sort of
Gary Johnson | Agilent Technologies
garyjohn@... | Mobile Broadband Division
| Spokane, Washington, USA
- << Previous post in topic Next post in topic >>