lambdalisue / vim-fern-renderer-nerdfont

🌿 fern.vim plugin which add file type icon through nerdfont.vim
MIT License
79 stars 12 forks source link

Support for nvim-web-devicons #7

Closed Shatur closed 4 years ago

Shatur commented 4 years ago

Hi! There is another interesting project - nvim-web-devicons. Because of lua, it may be preferable to neovim users over nerdfont.vim. To avoid creating something like fern-renderer-devicons.nvim with almost the same code it may be better to integrate it here. What do you think?

lambdalisue commented 4 years ago

No. I think creating a particular plugin like fern-renderer-nvim-web-devicons.nvim or whatever is the best idea because

  1. Code for supporting "nvim-web-devicons" is non required complexity for users who want a renderer of "nerdfont.vim"
  2. Code for supporting "nerdfont.vim" is non required complexity for users who want a renderer of "nvim-web-devicons"

I'm sure that nobody wants bugs especially caused by non required complexity.

Shatur commented 4 years ago

Okay, thanks, will try to create a separate plugin.

lambdalisue commented 4 years ago

Thanks for understanding. Please add the plugin to https://github.com/lambdalisue/fern.vim/wiki/Plugins once you've succeeded :+1:

Shatur commented 3 years ago

Should I replace only this block and just copy all other code from this repo?

lambdalisue commented 3 years ago

Maybe. I've no idea the API of nvim-web-devicons though.

Shatur commented 3 years ago

The API is similar to nerdfont: just a function to find icon. If I understand correctly, then only the above block is responsible for finding the icon. So, I will have a lot of duplicated code from this repo :(

lambdalisue commented 3 years ago

If I understand correctly, then only the above block is responsible for finding the icon.

Right.

So, I will have a lot of duplicated code from this repo :(

I think that's ideal while this and what you are going to make are completely different plugins 👍

Shatur commented 3 years ago

I think that's ideal while this and what you are going to make are completely different plugins

But they will differ by only a few lines of code. I would suggest making one generic renderer for icons since all third party plugins for icons have almost the same API. It wouldn't add any performance overhead, but it would keep things like that in one place (I don't have to keep track of changes in this repository and merge all the improvements).

But I will okay if you disagree and create a separate plugin as we discussed before :)

lambdalisue commented 3 years ago

since all third party plugins for icons have almost the same API

In my opinion, it's noted with "for now". I think all third-party plugins are not intrinsically equivalent thus APIs or usage may be different in the future. Then, I need to add extra glue code (extra complexity) which is not required if the plugin just has a single code for a single purpose.

I'm sorry for the inconvenience. But at least for now, I think we should make distinct plugins for distinct integrations while there are only three of them.

Shatur commented 3 years ago

In my opinion, it's noted with "for now". I think all third-party plugins are not intrinsically equivalent thus APIs or usage may be different in the future.

I can't even imagine how the API for getting icon can change. It always consists of one function. This plugin already have an abstraction under s:find, so it's easy to add support for other plugins.

Then, I need to add extra glue code (extra complexity) which is not required if the plugin just has a single code for a single purpose.

This plugin also manages other things like highlighting and syntax that I have to copy and maintain according to this repo. Thus, instead of possible inconvenience in the future, we will have 100% inconvenience right now.

lambdalisue commented 3 years ago

It would be worth supporting both "nerdfont.vim" and "nvim-web-devicons" in a single repository for developers but for users. Additionally, it would be the extra non-necessary complexity while nobody uses "nerdfont.vim" and "nvim-web-devicons" at the same time.

Shatur commented 3 years ago

Plugins usually just provide an option to choose a provider, I don't see any problem for user with that... But I got your point, I will create a separate plugin. I like nerdfont.vim a lot, nvim-web-devicons just better suit for Neovim because of lua.

Trid-collab commented 3 years ago

@Shatur Hi, did you finally get to make fern renderer with nvim-web-devicons. if so could you direct me to it. I would like to use it with my neovim nightly config

Shatur commented 3 years ago

@Shatur Hi, did you finally get to make fern renderer with nvim-web-devicons. if so could you direct me to it. I would like to use it with my neovim nightly config

See https://github.com/lambdalisue/fern.vim/issues/359#issuecomment-895251149

bluz71 commented 3 years ago

@Trid-collab,

See this comment. I think the fern_renderer_devicons plugin could be extended with nvim-web-devicons; just a matter of changing a couple API calls.

bluz71 commented 3 years ago

See this comment. I think the _fern_rendererdevicons plugin could be extended with nvim-web-devicons; just a matter of changing a couple API calls.

Augmenting API calls, not changing. Wrong wording. The fern-renderer_devicons plugin could seamlessly support both vim-devicons and nvim-web-devicons.