NERDTree gives error "x file(s) could not be loaded into the nerdtree"
Asked Answered
W

1

6

I have been using NERDTree and vim/gvim on Windows (currenlty on Windows 10) for a while with this error mentioned in the title continually popping up. Whenever I open a new instance of vim/gvim and open up NERDTree I get the error "3 file(s) could not be loaded into the nerdtree". Generally, when I open gvim it defaults to my C:\Users\USERNAME folder which has led me to believe that there is some file in that folder that is causing the problem. The issue only occurs when NERDTree is opened for the first time in the particular instance of gvim/vim. The issue also occurs in other folders. When opening NERDTree for the first time in my "C:\" directory I get "2 file(s) could not be loaded into the nerdtree" as well.

This issue is quite annoying as in gvim it hangs for a few seconds. As a perfectionist, I would prefer to solve the problem.

Some previous troubleshooting:

A google search results in an issue post on the NERDTree github page where the user had a somewhat related issue. The last post on the page recommended opening vim with sudo, as the issue may be due to ownership permissions. I have tried opening gvim as administrator and still get the same problems. Notably, when opening NERDTree I see the NTUSER.DAT files (including ntuser.dat.log, ntuser.ini) and similar. So I thought the problem could be with these files, so I have included them in the ignore variable in my vimrc as shown below

let NERDTreeIgnore = ['\~$','\.pyc$','\*NTUSER*','\*ntuser*','\NTUSER.DAT','\ntuser.ini']

This had worked well in hiding the files in my NERDTree window but I still get the error message.

Any ideas on how I might identify the problem files and solve this issue completely?

Wiley answered 21/11, 2015 at 20:37 Comment(7)
I think that NERDTree can have problems with escaping <, > or |. Does any of your file names contain such character?Nuts
Interesting. None of the files in that directory have those characters. After seeing you comment, I tried looking for odd characters. I have a couple of dot files in C:\Users\USERNAME folder. I also have the godmode folder, a few files with -, _, and '. I tried renaming/deleting those folders/files but with no luck.Wiley
I am sorry, then, I do not know. The issue tracker could be probably also a good place to ask. Good luck!Nuts
Okay I'll try the issue tracker. I appreciate your help, thanks.Wiley
Did you have any luck with this @sticke4? I'm having the same issue with ntuser files. I added them to NERDTreeIgnore but still get the error, like you.Easeful
No unfortunately I was not able to resolve the issue. I ended up not having time to post the problem to the issue tracker.Wiley
On Mac , maybe a problem whit your permissions support.apple.com/en-us/HT203538Klimt
T
5

For me these 3 files on Windows were registry files with file permissions (default Windows). Instead of messing with file permissions and seeing the error only happens on NERDTree's startup I decided to just suppress the error message in vim on startup:

in vimrc:

autocmd VimEnter * silent NERDTree | wincmd p

The '| wincm p' (without quotes) just moves the cursor over to the blank window and isn't needed if you don't want that behavior.

Now, no more red error message when starting vim with NERDTree.

Tonsorial answered 13/9, 2016 at 17:46 Comment(1)
I have the same issue on Windows, but I auto refresh NerdTree so that it it loads any newly added files, but then I get this error each load.Thibaud

© 2022 - 2024 — McMap. All rights reserved.