When using netrw with the tree style listing (netrw_liststyle = 3), if I expand a directory, open a file in that directory, then try to open a file above that directory, it creates a new empty file in the lower directory with the same name.

For example, I have the following directory structure:

├── baz.txt
└── foo
    ├── bar
    │   └── bar.txt
    └── foo.txt

I open the bar directory, then bar.txt. Then I attempt to open baz.txt and instead of opening the file, vim creates an empty file /foo/bar/baz.txt.

Is there any way for netrw to know the full paths of the files listed, or does it simply run :edit on the file name without the full path?

Edit: I'm using vim 8.0.427 and netrw v156.

  • 1
    Cannot reproduce on gVim 8.0.69 and netrw v162g. Can you update with version information and also try the most recent netrw build?
    – Tumbler41
    Commented Apr 14, 2017 at 14:29
  • how can I check what version of netrw I have?
    – jsl
    Commented Apr 14, 2017 at 17:45
  • :echo g:loaded_netrw Should get you the version number.
    – Tumbler41
    Commented Apr 14, 2017 at 18:08

1 Answer 1


I was able to fix this issue by using :Lexplore to open the netrw listing and removing the setting netrw_browse_split = 4 from my .vimrc.

  • 1
    Glad you were able to get a workaround. However, with netrw_browse_split = 4 I was able to reproduce the issue. It looks like it might be a bug. I'll mess around with it a bit and might look into submitting a patch to Dr. Chip if it turns out that is the case.
    – Tumbler41
    Commented Apr 14, 2017 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.