NERDTree gives the error "x files cannot be uploaded to nerdtree"

I have been using NERDTree and vim / gvim for Windows (currenlty on Windows 10) for a while when this error is mentioned in the header constantly appearing. Whenever I open a new instance of vim / gvim and open NERDTree, I get the error "3 files (s) cannot be uploaded to nerdtree". As a rule, when I open gvim, it by default changes the folder C: \ Users \ USERNAME, which made me believe that there is some file in this folder that causes the problem. The problem only occurs when NERDTree is first opened on a specific gvim / vim instance. The problem also occurs in other folders. When I open NERDTree for the first time in my directory "C: \" I get "2 files (s) cannot be uploaded to nerdtree".

This problem is quite annoying since in gvim it hangs for a few seconds. As a perfectionist, I would rather solve the problem.

Some previous troubleshooting methods:

Google search results are published on the release page on the gigub NERDTree page, where the user had a somewhat related problem. The last message on the page recommended opening vim with sudo, as the problem could be related to access permissions. I tried to open gvim as administrator and still get the same problems. It is noteworthy that when I open NERDTree, I see NTUSER.DAT files (including ntuser.dat.log, ntuser.ini) and the like. Therefore, I thought that the problem could be with these files, so I included them in the ignore variable in my vimrc, as shown below.

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

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

Any ideas on how I can identify problem files and solve this problem completely?

+5
source share
1 answer

For me, these 3 files on Windows were registry files with file permissions (Windows by default). Instead of messing with file permissions and seeing that the error only occurs when NERDTree starts up, I decided to just suppress the error message in vim at startup:

in vimrc:

autocmd VimEnter * silent NERDTree | wincmd p

"| wincm p '(without quotes) simply moves the cursor to an empty window and is not required if you do not want this behavior.

Now, when starting vim with NERDTree, a red error message no longer appears.

+3
source

Source: https://habr.com/ru/post/1236513/


All Articles