Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add vim-nerdfont, vim-glyph-palette, and vim-nerdtree-syntax-highlight compatibility #82

Merged
merged 6 commits into from
Apr 8, 2025

Conversation

mmrwoods
Copy link
Collaborator

@mmrwoods mmrwoods commented Mar 31, 2025

This adds a new compat script loaded on VimEnter where compatibilities with other plugins can be defined, moves the existing vim-devicons compatibility code to that compat script, and adds similar code for vim-nerdfont, vim-glyph-palette, and vim-nerdtree-syntax-highlight.

vim-devicons remains the first priority for the devicons glyph function, vim-glyph-palette and vim-nerdtree-syntax-highlight will only be used automatically if the user has not already set g:fuzzyy_devicons_color_func. For an existing user of nerdtree, vim-nerdtree-syntax-highlight, and fuzzyy, they will now magically get the same colors in Fuzzyy as in NERDTree (for all devicons known to Fuzzyy)

before
Screenshot 2025-04-04 at 08 50 04

after (with vim-nerdtree-syntax-highlight)
Screenshot 2025-04-04 at 08 50 47

after (with vim-glyph-palette)
Screenshot 2025-04-04 at 08 51 26

after (with vim-nerdfont, and without vim-devivons)
Screenshot 2025-04-04 at 08 55 00

@mmrwoods mmrwoods requested a review from Donaldttt March 31, 2025 07:51
@mmrwoods mmrwoods force-pushed the compat_hacks branch 2 times, most recently from 62ac3fb to 30df6f4 Compare March 31, 2025 09:18
mmrwoods added 6 commits April 2, 2025 15:59
Automatically use colors from vim-nerdtree-syntax-highlight if installed

See https://github.com/tiagofumo/vim-nerdtree-syntax-highlight

This adds a compatibility script triggered via VimEnter autocmd, which
updates the devicons color table before highlight groups are created.

To allow the color table to be modified before the highlight groups are
created it has been moved from the devicons script to the colors script.
Automatically use glyph-palette for devicon colors if installed

See https://github.com/lambdalisue/vim-glyph-palette
Automatically use vim-nerdfont to obtain devicon glyphs if installed

See https://github.com/lambdalisue/vim-nerdfont
Keep all plugin compatibility code in one place, easier to understand
@mmrwoods
Copy link
Collaborator Author

mmrwoods commented Apr 4, 2025

@Donaldttt I'm reluctant to merge this without a review, if you could have a glance when you get some time that would be great, thanks :-)

It seems sensible to me, obviously, I've tested it pretty extensively, including Vim 9.0 ;-), and it's based on the compatibility scripts known to work for vim-friendly and auto-pairs.

@mmrwoods
Copy link
Collaborator Author

mmrwoods commented Apr 8, 2025

@Donaldttt I'm going to go ahead and merge this as I have some other changes dependent on it and I don't think there is anything contentious here. Suggested changes/improvements can be made later.

@mmrwoods mmrwoods merged commit cf26b25 into main Apr 8, 2025
@Donaldttt
Copy link
Owner

Sorry about this late reply. I didn't test it. But I read the code and use it brieftly and I think It's really nice. This feature makes the style consistent for many users.

@mmrwoods
Copy link
Collaborator Author

mmrwoods commented Apr 9, 2025

Thanks, glad you like it :-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants