Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
610 stars 28 forks source link

Integrating external Lua file libraries in compilation #75

Closed katawful closed 3 years ago

katawful commented 3 years ago

I'm working on a colorscheme, and I would like to use hsluv.lua, but if I put it in the fnl directory Aniseed doesn't import it, and the lua directory gets deleted upon making. I can't find anything in the docs about using these external, but integrated, Lua libraries when making a plugin. Am I missing something?

bangedorrunt commented 3 years ago

Can you just put it under vim.fn.stdpath 'config' /lua dir?

Olical commented 3 years ago

Hm yeah, you should be able to add some Lua to any directory on your package.path, normal Lua rules apply really.

Although if you're writing a plugin and using my scripts you will run into the fact that it does a rm -r lua to ensure no files are left over after you delete something from the fnl dir. I would recommend storing your deps inside a deps or tools directory then amending your Makefile to copy the appropriate files into the right places upon make.

This is actually what Aniseed does with Fennel etc, it uses the embed.sh script (in the repo somewhere... sorry, not sure exactly where right now!) to copy the deps Lua into Aniseed/Conjure's Lua dir as well as perform some sed substitutions to prefix all requires and module names with aniseed.* to prevent conflicts with other Lua based plugins relying on the same module names.

katawful commented 3 years ago

I'll mess with embed.sh, that seems like what I need