Re: Creating directories in Explore
- I wrote on 28 Dec 2004 18:58:04 -0800:
> Antun Karlovac wrote on 28 Dec 2004 17:22:45 -0800See also :help autochdir
>> I can create directories, but the pwd that Vim is in
>> doesn't follow the directory that I'm looking at after
>> typing :E. So if I run :!mkdir foo, foo will get created
>> in the working directory, rather than the one I'm looking
>> Since Explorer.vim is a plugin, is it possible to have it
>> update the pwd while browsing? Would that be the right
>> approach to get where I want, or is there a way of doing
>> this through my rc file?
> The potential replacement to Explorer, netrw.vim, does its
> work by changing the current directory to be the directory
> being explored -- and it has a hack patch-code to keep the
> directories unchanged "as default". I refer to the
> patch-code that preserves the directories a hack because the
> patch-code breaks the ":cd -" command.
> (As you might have inferred, I don't like the changing of
> the current directory to be the directory being displayed;
> and I don't like the breaking of the "cd -" command.)
> Anyway, I think there is an "rc way" (setting up an
> autocommand) to change the current directory to be the
> directory of the file in the current buffer -- but I think
> (not sure) there is some bug associated with this scheme and
- Antun Karlovac wrote:
> Hi George[...]
> Thanks. I know about the cmdline mode; I was hoping that Vim had its own
> command that was OS-independent:
> I'm a Cygwin user on Windows, so I'm not used to the md command.
> However, mkdir doesn't work in gvim in Windows for me. Is there a way I
> can make Vim know about the Cygwin mkdir command when in Explorer mode?
(Sorry if I'm duplicating a previous answer: slowly catching up on a
fortnight's worth of queued mail.)
mkdir does exist in Windows: in DOS (and thus in Windows) it is a
hardcoded alias for md. Thus you can use it but not with -p (AFAIK,
DOS/Windows md/mkdir has no command-line options; and if there were any,
they would be ushered in by a slash rather than a dash).
Other hardcoded aliases in the same family are rd/rmdir cd/chdir. Under
Dos/Windows, all these are internal shell commands (whereas under Unix
they are separate programs). Thus I venture to say that mkdir/rmdir (and
also cd, but Vim has an internal cd command) are (when used from Vim
without command-line options) fairly platform-independent.
(Since version 2, DOS has quite a lot of Unix-like features; but it's
more a parent language than a Unix dialect).