rktjmp / lush.nvim

Create Neovim themes with real-time feedback, export anywhere.
MIT License
1.44k stars 47 forks source link

Add auto-export like mcchrish/zenbones.nvim? #62

Closed rktjmp closed 2 years ago

rktjmp commented 3 years ago

mcchrish/zenbones.nvim ships with colors/zenbones.vim which contains an exported lush theme and colors/zenbones-lua.vim for the lush loaded theme.

This seems.... really obvious....

Exporting a theme could (will) impact existing theme files though, and it would make developing themes a bit awkward (colorsheme my-theme-lua), but it should probably be a function (auto export) and maybe some affordances made in the template repo for this.

The export could place some in-file markers and only replace inside them, which might let it be a bit more opt in and less violent.


Probably:

This fixes a long standing pet-peev of mine where end user lush-themes generally require a runtime dependency (lush).


Painpoints:

rktjmp commented 3 years ago

Probably:

This fixes a long standing pet-peev of mine where end user lush-themes generally require a runtime dependency (lush).

rktjmp commented 3 years ago

This may expand to a "lush transformers" set of functions, which savq has mentioned before. Probably external to the main repo (expected use by devs only), where it would provide say "lush-alacritty.lua" that takes a table and produces at least a buffer if not a file that can be used to theme alacritty.

This implies additional files that either run the exporter completely or at least define variables.

mcchrish commented 2 years ago

I just built out a very simple template building structure to zenbones. Example template: https://github.com/mcchrish/zenbones.nvim/blob/main/lua/zenbones/build/alacritty.lua Build script: https://github.com/mcchrish/zenbones.nvim/blob/main/lua/zenbones/build.lua

I copied a lot of ideas from melange and tokyonight.

The build script is just a wrapper of this simple string interpolation solution http://lua-users.org/wiki/StringInterpolation then write it out to the specified file path.

I got the luxury of having just a light theme so the implementation is quite simple.

rktjmp commented 2 years ago

"I got the luxury of having just a light theme so the implementation is quite simple." he says before creating 30 variants :smile:

Closing in favour #78 #77

mcchrish commented 2 years ago

"I got the luxury of having just a light theme so the implementation is quite simple." he says before creating 30 variants 😄

Lua and lush are just too good. I can't stop writing more code. 😂