vim-nerdtree-syntax-highlight
vim-nerdtree-syntax-highlight copied to clipboard
Lag on some directories during navigation
there's a significant delay whenever i navigate my home directory inside nerdtree, i guess this is due to lots of folders on my directory?, its working fine on small number of directories though
I'm also encountered a lot of freezes with this plugin. Especially in large directories (like node_modules).
vim's syntax feature and regex engine known to be slow. This plugin creates bunch of syntax items and highlight them when one of them is found with regex. Since this vim's problem, sadly I don't think this issue can be solved without patching vim itself.
You can disable the cursorline completely, it makes vim try to update syntax items much less. That can reduce the lag.
augroup nerdtreedisablecursorline
autocmd!
autocmd FileType nerdtree setlocal nocursorline
augroup end
Any update on this?
Just put let NERDTreeHighlightCursorline = 0 in your .vimrc - as stated in the readme.md - which results in the same as kutsan's solution.
This should fix the lag, at least it did it for me.
try set lazyredraw
Sorry for the bump, but are we downvoting @Rundik because his solution didn't work, or because it was a bad compromise?
I was wondering what could be the problem and it might be that it's using an array for the allowed extensions. Because of this, for each file, it will have to do ~n/2 checks to see whether the extension is allowed or not. Instead, if it was in a dictionary like the colors that are associated with the filetypes, then that may significantly speed up the process.