I'm on Ubuntu 16.04 (x86_64) and vim 7.4. In my config file, I have:
set autochdir
And this was working for as long as I remember. Just after upgrading to Ubuntu 16.04, I see the following behavior (assume pwd
is /path
):
The following commands (
z
is a file):$ vim X/Y/z :e .
result in vim showing the contents of
/path
.The following commands:
$ vim X/Y/z :sp .
result in vim showing the contents of
/path/X/Y
.The following commands:
$ vim X/Y/z :sp . :q :e .
also result in vim showing the contents of
/path/X/Y
.
The expected behavior for me was for all three cases to open /path/X/Y
. But it seems like :sp
is changing the current directory, but :e
is not. Before my upgrade to Ubuntu 16.04, I am sure all three cases did the same thing (open /path/X/Y
).
Can anybody else reproduce this? Is this intended behavior and documented?
Additionally, if I do:
$ vim X/Y/z
:sp ./<TAB> --or--
:e ./<TAB> --or--
:w ./<TAB>
then vim iterates through the items in the X
directory, not X/Y
. Although if I do :sp ./X/w
where X
and w
were selected using <TAB>
(i.e. vim finds the items based on the current directory), the file is not actually opened (an empty new file is opened, as if the file doesn't exist). This suggests that autochdir
has worked where opening the file is concerned, but hasn't worked where listing directory items is concerned.