Adding custom sources as separate repos? #403
Replies: 4 comments 9 replies
-
I think it's a good idea and one I have considered before. The only thing stopping me was:
All in all, it's probably best to decouple sources from the main repo like you suggested. I would say the thing to do is to have the extension register itself, it would really be a simple change to make. |
Beta Was this translation helpful? Give feedback.
-
OK, I think I have a functional setup for this now, it's still sitting in a PR: #406 You can pull that branch and give it a try. Basically, you just need to add a I extracted the Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
Hi, just created a source for neo-tree here. (An integration for zk.) I've been using it for a few days and so far I'm quite happy with it. (Congrats for the extensible design.) My only (small) issue is that I have not found a way to set a default config (would make user experience slightly simpler). Also where do we maintain a list of user sources? (nvim-cmp uses a wiki and an hashtag) If there are things you think I should do differently don't hesitate to tell. best regards! |
Beta Was this translation helpful? Give feedback.
-
I was just about to submit a pull request for a diagnostics source I've been tinkering with the last few weeks when I noticed this discussion. I reworked it a bit and placed it here. It seems to work great. I did make a few minor changes to the internals, however, and might submit some pull requests. One thing I think would be worth adding is a way to hook into the neo-tree highlight module, for consistency in highlight group definitions. Currently, I'm awkwardly falling back to already defined highlight groups, which makes it cumbersome to customize component highlights. I reckon it doesn't have to be more complicated than exposing Well done, by the way, on designing this plugin! It's been a true delight to explore and work with. |
Beta Was this translation helpful? Give feedback.
-
One awkward thing I've bumped up against when trying to add my own source is having to modify
defaults.lua
andsetup/init.lua
(where sources are defined). If it weren't for needing to make changes to those files, I could actually develop my custom source in a new repository and just put my source files (init.lua, components.lua, commands.lua) inmy_repo_root/lua/neo-tree/sources/my_custom_source/
and the imports forneo-tree.sources.$SOURCE
would work fine. I'm not sure if this is an intended path for development (to be able to add sources as standalone repos), but it might be nice to have. If desirable, adding something like telescope'sregister_extension
to modify the sources table insetup/init.lua
would probably do it. Orsetup/init.lua
could take in sources via user config in the setup call. What do you think?Beta Was this translation helpful? Give feedback.
All reactions