Using netrw in Vim, I navigate to a Python script I want to edit (file.py), but most of the time it is listed as "file.py/" with a slash, indicating it is a directory. This is impossible to open. If I navigate out of the folder and come back, some times it is listed correctly as "file.py" and I can open it.

I have disabled my _vimrc settings related to netrw, and the problem still persists. I'm using Windows 8.

Any ideas?


1 Answer 1


I suspect that your file has an unwanted attribute set that causes vim's isdirectory() function to flag it as a directory (for example, it may have the FILE_ATTRIBUTE_DIRECTORY attribute set). See if http://www.wikihow.com/Change-File-Properties will help you in fixing your file's attributes.

You may also find :help netrw-gf helpful.

  • I've tried typing 'gd' like the help doc suggests, but it didn't force netrw to treat it as a file. Maybe there is a typo in :help netrw-gf... f for file, d for directory. I'll try that when I get back to my work computer.
    – rsoren
    Commented Dec 24, 2014 at 1:54
  • Did you check on your file's attribute? And, to force treatment as a file, use gf, not gd.
    – user21497
    Commented Dec 25, 2014 at 3:26
  • I haven't been able to replicate the problem since returning from holiday break, but I can use 'gf' to open a file. It's odd that :help netrw-gf from within Vim gives the correct command for forcing treatment as a file, but this site contains a typo. The only attribute is 'A' for archive; Vim may be having problems with the fact that it's a "Canopy Document" even though the file suffix is .py
    – rsoren
    Commented Dec 29, 2014 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .