hotpot.nvim icon indicating copy to clipboard operation
hotpot.nvim copied to clipboard

[FR] Plugin development template with Hotpot

Open bangedorrunt opened this issue 1 year ago • 4 comments

It would be great where people could clone a Hotpot template repo so they can get their development up and running at ease. Aniseed already got this with embeded scripts and library.

bangedorrunt avatar Sep 14 '22 01:09 bangedorrunt

It's a good idea, do you have ideas of what should be in it? I think it would really just be a build.fnl that called out to hotpot.api.make, and two empty fnl and lua dirs. Not sure if that's worth an extra repo but a "writing-plugins-with-fennel.md" should exist.

From what I remember, aniseed had a testing library too as well as frankly just needing more "setup" than a theoretical plugin built with hotpot would need.

There is some sticky decisions that depend on the developer, I personally gitignore lua/* so it doesn't show up in my file picker but that means I must remember to force add changed files, not sure I would want to force this on people.

Also since hotpot will always prefer things found in lua/ (to be a good neighbour), you also need to dump that dir during dev (or rebuild all the time).

Indeed, even building out a lua folder isn't a technical requirement unless you don't want to force hotpot as a requirement (though in most cases you probably don't).

I will improve the documentation around this, not sure an actual repo would be a good fit or not, probably depends how complicated the docs get!

rktjmp avatar Sep 14 '22 06:09 rktjmp

It's a good idea, do you have ideas of what should be in it? I think it would really just be a build.fnl that called out to hotpot.api.make, and two empty fnl and lua dirs. Not sure if that's worth an extra repo but a "writing-plugins-with-fennel.md" should exist.

I still prefer a template, also you can put a doc inside it. From there, we can customize based on personal need. Your suggession about template structure is everything we need. Of course we need an embeded Hotpot as a dependency, but only used for development. All I need is lua after built by Hotpot

From what I remember, aniseed had a testing library too as well as frankly just needing more "setup" than a theoretical plugin built with hotpot would need.

Yes, Aniseed has a testing library, here is my suggestion https://github.com/andreyorst/fennel-test

Personal speaking, I got some idea and wanna learn to develop Lua plugins. However, I'm feeling attached with Fennel, so really wanna build sth with the language I love :)

bangedorrunt avatar Sep 14 '22 06:09 bangedorrunt

Yes, Aniseed has a testing library, here is my suggestion https://github.com/andreyorst/fennel-test

Not sure if i'm correct. But isn't this library test only fennel files? How much is it usable if you need to test some lua code inside neovim runtime? Personally i would just go with plenary (is there any other good testing library for neovim lua?) to test my compiled lua code, not fennel code.

monkoose avatar Sep 14 '22 06:09 monkoose

Good catch 👍

bangedorrunt avatar Sep 14 '22 07:09 bangedorrunt

I've added a plugin guide draft.

Hotpot wont provide a template as I don't believe setup is complex enough to warrant the extra work.

rktjmp avatar Oct 01 '22 05:10 rktjmp

Thank you!

bangedorrunt avatar Oct 01 '22 11:10 bangedorrunt