Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

chdir(../..)
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

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

chdir(../../tmp)
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
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.