2

This is in gVim on Windows.

NERDTree is registering ../ and ./ links in every directory. By the -> I thought perhaps they were shortcuts/symlinks that got added to all my directories, however in the Windows file explorer I see nothing to point to that case. I could hit Shift+i to hide them, but I like to be able to see dot files.

I also recently installed mysysgit, which install adds a some Unix tools to the path. I've always done this on Windows systems without adverse effects, but I wasn't using gVim & NERDTree before. Perhaps in adding the Unix tools it did something funny to allow cd ../ and such in the Windows prompts? On my Debian system NERDTree doesn't do this.

I'm rather new to Vim and NERDTree and don't I usually work in Windows, so I'm all sorts of lost.

Screenshot -> Screenshot

To clarify, I'm trying to hide these.

I tried fiddling with let NERDTreeIgnore=[...] to no avail.

1
  • 1
    ./ is the current directory. ../ is the previous one. These have always worked in windows (though it would usually be .\ and ..). Not sure why NERDTree would be showing them, but they're nothing new at the OS level.
    – Herms
    Mar 25, 2013 at 19:51

2 Answers 2

1

The following does what I was hoping for let NERDTreeIgnore=['\.\.$', '\.$', '\~$']

Note: the '\~$' is a seperate regex to ignore the 'tilda-d' backup files generated by Vim, e.g. somefile.text~.

This answer copied from Goluptious's answer that was incorrectly written in the question.

5

Windows's file systems (FAT, FAT32, NTFS) all have directory entries . and .. in each directory, which correspond to the current and the parent directory, respectively.

From the Microsoft EFI FAT32 File System Specification:

When a directory is created, [...] [i]f the directory is not the root directory, you need to create two special entries in the first two 32-byte directory entries of the directory (the first two 32 byte entries in the data region of the cluster you just allocated).

The first directory entry has DIR_Name set to:
“.          ”

The second has DIR_Name set to:
“..         ”

These are called the dot and dotdot entries. The DIR_FileSize field on both entries is set to 0, and all of the date and time fields in both of these entries are set to the same values as they were in the directory entry for the directory that you just created. You now set DIR_FstClusLO and DIR_FstClusHI for the dot entry (the first entry) to the same values you put in those fields for the directories directory entry (the cluster number of the cluster that contains the dot and dotdot entries).

Finally, you set DIR_FstClusLO and DIR_FstClusHI for the dotdot entry (the second entry) to the first cluster number of the directory in which you just created the directory (value is 0 if this directory is the root directory even for FAT32 volumes).

Here is the summary for the dot and dotdot entries:

  • The dot entry is a directory that points to itself.
  • The dotdot entry points to the starting cluster of the parent of this directory (which is 0 if this directories parent is the root directory).

In fact, these directory entries are present in each directory. They are implied, so there might not be much value in showing them in NERDTree, but that's just a design choice.

4
  • A feature taken intact from earlier file systems and on display in unix. Not sure if it originated with unix or comes from even earlier in the history of computing (multics, maybe?). Mar 25, 2013 at 21:05
  • While this is quite interesting, what I really want to do is hide only these entries and not miscellaneous dot files. I haven't seen these entries when using NERDTree in a Linux environment (I know they're there, but they're hidden), can't imagine why it would actually be a design choice (nor one aimed at specifically at gVim/Windows for that matter). Mar 25, 2013 at 21:42
  • 1
    I'll accept that answer for the awesome bit of info on Windows FS's. Mar 25, 2013 at 22:08
  • Interestingly (for implementers), while FAT32 has concrete "." and ".." entries, exFAT explicitly does not: "The file names '.' and '..' have the special meaning of 'this directory' and 'containing directory', respectively. Implementations shall not record either of these reserved file names in the FileName field." docs.microsoft.com/en-us/windows/win32/fileio/… Nov 24, 2020 at 20:33

You must log in to answer this question.

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