Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running vim 7.3 on CentOS 5. Cannot open directories from command line, except ".", so this does not work (vim opens, but just shows a blank buffer):

$ /usr/bin/vim /tmp

But this works fine, giving the NetRW display of the directory, from which I can choose files, etc.

$ cd /tmp
$ /usr/bin/vim .

This also works fine

$ cd $HOME
$ /usr/bin/vim ../../tmp

Inreasing verbosity does not help much:

$  /usr/bin/vim -V99absolute.log /tmp
$ head -n3 absolute.log

fchdir() to previous dir
$  /usr/bin/vim -V99relative.log ../../tmp
$ head -n3 relative.log

fchdir() to previous dir

And subsequent differences between the 2 logs seem to be related to that initial different chdir() call.

Editting files works fine, both absolutely and relatively, but logging them verbosely gives more weight to the theory that the initial chdir() call is the problem, because it now contains a directory in both cases:

$ vim -V99abso-fred.log /tmp/fred.log
$ vim -V99rela-fred.log ../../tmp/fred.log
$ head -n3 abso-fred.log

fchdir() to previous dir
$ head -n3 rela-fred.log

fchdir() to previous dir

Any suggestions as to how to track down the difference in that initial chdir() call? Where's it coming from? How to ask vim to show files it is sourcing as well as commands?

share|improve this question
Have you tried upgrading to the latest development version of the netrw plugin? Also, you should direct issues with the plugin to the author. – Ingo Karkat Sep 10 '13 at 12:14
@IngoKarkat - Upgrading to the latest version of netrw makes no difference. Why do you think the issue is with that plugin? The log files start diverging at line 2, whereas the netrw scripts are not brought in by vim till line 300+. So I doubt it could be responsible – jalanb Sep 10 '13 at 13:59
I suggest temporarily reducing your .vimrc to a bare minimum and moving all other plugins aside to see if it still happens. – Heptite Sep 13 '13 at 5:24

You must log in to answer this question.

Browse other questions tagged .