-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lag on GVim #6
Comments
The newest fix should make it faster. Let me know if it worked |
Nice. It worked 👍 |
After the last update there is some delay, so I'm reopening the same issue. |
The approach I took to solve this problem is sort of a hack, and will always result in some lag. I don't feel it so much in my setup here, but nerdtree does scroll a little bit faster when I disable the plugin. I found neovim to be faster than vim in general, you should take a look at it. If you are using windows you can try the new bash on windows 10. Also neovim has an experimental mode for windows using qt instead of a terminal, if you are on windows and can't get the new bash. Another thing you can do is to disable part of the plugin. For example, if you only want to use highlight based on file extensions, you can use these commands: let g:NERDTreeDisableExactMatchHighlight = 1
let g:NERDTreeDisablePatternMatchHighlight = 1 I will try to find ways to minimize lag in the future, but for now I have no idea how to do so. I have tried many kinds of regular expressions and the ones that I ended up using look to be the fastest. |
How did you know that I'm using Windows? 😄 Actually I have no choice but use Windows 😨 I use Vim on Windows, Linux and OS X. 😄 I trying to migrate to Neovim (with Nyavim) but there is so many stuff to do (my vimrc have 6k lines for example). I did use the config but still lags. For now I will disable the plugin on Windows. Thanks. I will close the issue 👍 |
I pushed an update that limits the amount of extensions processed and significantly improves performance. To use it, add this line: let g:NERDTreeLimitedSyntax = 1 " limit syntax for the most popular extensions Take a look at some of your projects and see if there are some extensions you would like to be highlighted. I added the most common ones by default, but I want a feedback on my definition of "most common", to find out if there are some other stuff that people are using and I didn't add. Some will be too specific and you can still add them with this on your .vimrc: let g:NERDTreeSyntaxEnabledExtensions = ['pl', 'sql', 'hs'] " enables syntax for.pl, .sql and .hs files |
I did create a custom list for each current project. At the time I'm using these extensions: let g:NERDTreeExtensionHighlightColor = {}
let g:NERDTreeExtensionHighlightColor['bat' ] = 'ff8b52'
let g:NERDTreeExtensionHighlightColor['class' ] = '80cbc4'
let g:NERDTreeExtensionHighlightColor['conf' ] = '8cffba'
let g:NERDTreeExtensionHighlightColor['css' ] = 'ffcde6'
let g:NERDTreeExtensionHighlightColor['deb' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['odt' ] = '7FFF00'
let g:NERDTreeExtensionHighlightColor['doc' ] = '7FFF00'
let g:NERDTreeExtensionHighlightColor['docx' ] = '7FFF00'
let g:NERDTreeExtensionHighlightColor['dtd' ] = 'ff2c4b'
let g:NERDTreeExtensionHighlightColor['ear' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['fxml' ] = 'ff2c4b'
let g:NERDTreeExtensionHighlightColor['frxml' ] = 'ff2c4b'
let g:NERDTreeExtensionHighlightColor['gif' ] = 'F5C06F'
let g:NERDTreeExtensionHighlightColor['gradle' ] = '00c489'
let g:NERDTreeExtensionHighlightColor['groovy' ] = '4298b8'
let g:NERDTreeExtensionHighlightColor['gz' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['html' ] = '85FF66'
let g:NERDTreeExtensionHighlightColor['iml' ] = 'AD8FCC'
let g:NERDTreeExtensionHighlightColor['jar' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['java' ] = '80cbc4'
let g:NERDTreeExtensionHighlightColor['jnlp' ] = 'ad8fcc'
let g:NERDTreeExtensionHighlightColor['jpeg' ] = 'F5C06F'
let g:NERDTreeExtensionHighlightColor['jpg' ] = 'F5C06F'
let g:NERDTreeExtensionHighlightColor['js' ] = 'ffa500'
let g:NERDTreeExtensionHighlightColor['lock' ] = 'FFFF00'
let g:NERDTreeExtensionHighlightColor['markdown' ] = 'B973FF'
let g:NERDTreeExtensionHighlightColor['md' ] = 'B973FF'
let g:NERDTreeExtensionHighlightColor['mkd' ] = 'B973FF'
let g:NERDTreeExtensionHighlightColor['php' ] = 'ff00ff'
let g:NERDTreeExtensionHighlightColor['png' ] = 'F5C06F'
let g:NERDTreeExtensionHighlightColor['properties' ] = '8cffba'
let g:NERDTreeExtensionHighlightColor['py' ] = '70d080'
let g:NERDTreeExtensionHighlightColor['rar' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['rpm' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['rs' ] = 'FF7033'
let g:NERDTreeExtensionHighlightColor['rst' ] = 'B973FF'
let g:NERDTreeExtensionHighlightColor['sql' ] = '66A3FF'
let g:NERDTreeExtensionHighlightColor['tags' ] = 'ff6070'
let g:NERDTreeExtensionHighlightColor['ttf' ] = 'd0eeff'
let g:NERDTreeExtensionHighlightColor['txt' ] = 'ffffff'
let g:NERDTreeExtensionHighlightColor['vim' ] = 'afd700'
let g:NERDTreeExtensionHighlightColor['war' ] = 'FFB340'
let g:NERDTreeExtensionHighlightColor['xml' ] = 'ff2c4b'
let g:NERDTreeExtensionHighlightColor['xls' ] = 'ffff7d'
let g:NERDTreeExtensionHighlightColor['xlsx' ] = 'ffff7d'
let g:NERDTreeExtensionHighlightColor['xsd' ] = 'ff2c4b'
let g:NERDTreeExtensionHighlightColor['yaml' ] = 'c8c8c8'
let g:NERDTreeExtensionHighlightColor['yml' ] = 'c8c8c8'
let g:NERDTreeExtensionHighlightColor['zip' ] = 'FFB340' I only still didn't figure out how to configure for |
I see, thanks for the list. Did you notice any performance improvement with the options I mentioned? |
@tiagofumo No. Same behavior as before. |
Hi, I have some suggestions on performance improvement. First, because an icon is a stable and unique unicode character, we can change Second, if a user does not turns on full name highligh, we can skip matching Third, we can group all icons with same color into one Wish this is helpful. |
@HerringtonDarkholme Sounds good. I will try to check those in the future. You can make a pull request if you want. |
@HerringtonDarkholme I had to revert the pull request because the keyword match doesn't allow two different colors for the same icon. For example, if you look at the screenshot on the README you can see that html icon is orange while the erb icon is red, even thought they have the same unicode value. |
Well, if you insist on correctness I'm afraid there is no easy way to optimization. |
Yes, it is really slow on my Windows 10 ubuntu bash shell wsltty terminal.
|
@whitecolor Sorry, I don't have a Windows 10 ubuntu bash shell to test that right now. Will try to take a look in the future. Thank you. |
@whitecolor try to disable all default extensions, exact match, and pattern match highlights and see if the lag disappears. If it does (it should) add your most used extensions using the let g:NERDTreeSyntaxDisableDefaultExtensions = 1
let g:NERDTreeDisableExactMatchHighlight = 1
let g:NERDTreeDisablePatternMatchHighlight = 1
let g:NERDTreeSyntaxEnabledExtensions = ['c', 'h', 'c++', 'php', 'rb', 'js', 'css'] " example Try adding just a few and see if the lag is bearable. |
@tiagofumo thank you for your work on this, awesome. My setup is tmux + neovim on alacritty. Screenshot here. I was experiencing the scroll lag, but totally gone with the above settings. |
@asilvadesigns can you make gist with your nvim/init.vim? |
@asilvadesigns thanks) |
Just wanted to share this related find: I was experiencing lots of lag with this plugin turned on, to the point that I almost abandoned it, even after trying the above. Then I removed Added this to
|
Oh, Interesting. Thanks for the info, I will add this to the README. |
I bisected vim versions until isolating the one which make it so slow. It appears to be 8.0.1275, very slow for me while 8.0.1274 was ok. The commit is really small: vim/vim@c9e9c71 |
Commits between Aug 19, 2016 and Aug 22, 2016 makes Vim lag.
Using:
GVim 7.4.2216
Windows 10
Configs:
The text was updated successfully, but these errors were encountered: