I use a ~/bin/gvim script to turn graphical Vim into a single instance
program using the --remote-tab-silent command line option. This works
great except that I have set the 'autochdir' option in my ~/.vimrc and
have come to rely on it but it doesn't work with --remote-tab-silent.
The problem is that :drop doesn't seem to honor the 'autochdir' option
because when I use my ~/bin/gvim script to edit a file in an existing
Vim instance I find that :pwd prints the working directory from before
:drop was executed. I always forget about this and consequently execute
shell commands using :! in the wrong working directory...)
Is :drop supposed to ignore the 'autochdir' option or should it be
fixed? I tested with the latest Vim 7.3 and the command line gvim -u
NONE -U NONE --noplugin -N --cmd 'set acd'.
- Peter Odding
> This has bothered me for quite some time on Windows XP, it's also in
> Vim 7.2 and probably in Vim 7.1 as well. I never bothered tracking
> down the steps to reproduce because it seemed to me that it was
> intermittent when I loaded files. Is it readily reproduceable
> using :drop? I use a variety of commands to load files.
Thanks for confirming the problem. When I use gvim --remote-tab-silent
(which triggers :tab drop in the existing Vim instance) Vim always ends
up in the wrong working directory for me, even when Vim was started with
the command line gvim -u NONE -U NONE --noplugin -N --cmd 'set acd'. So
yes, I can consistently reproduce this.
> I'd certainly like to see it fixed if it is not intentional for some
> reason.
>
> The workaround I found is to switch windows, tabs, or buffers, and
> come back to it, and 'acd' takes effect.
Executing :set acd or :edit again also works.
- Peter Odding