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.

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

EDIT: to clarify, I'm trying to hide these.

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

EDIT Once More: I can't answer my own question for another 7-ish hours because this a new account but I did find the answer and it was in fact let NERDTreeIgnore=[...]

Answer

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~.

share|improve this question
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 '13 at 19:51

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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?). –  dmckee Mar 25 '13 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). –  Goluptious Mar 25 '13 at 21:42
1  
I'll accept that answer for the awesome bit of info on Windows FS's. –  Goluptious Mar 25 '13 at 22:08

Your Answer

 
discard

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

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