rktjmp / lush.nvim

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

Add option to copy cterm from gui #76

Closed mcchrish closed 2 years ago

mcchrish commented 2 years ago

Closes #75

rktjmp commented 2 years ago

Have you tested this in Vim?

AFAIK, when I added the blend #29 #30 work around, I think Vim actually refused to parse the highlight at all if blend was present.

Does this mean gui=value should actually be dropped when in Vim mode? (edit: actually, I guess not otherwise someone would have raised an issue already?)

I am going to handle it a bit differently with a plugin architecture https://github.com/rktjmp/lush.nvim/commit/ece40a6c33e83c82e45c397aa83efbe44ec33407 https://github.com/rktjmp/lush.nvim/commit/19e2a5d6f0debea4667fd26a38c95147e115548d

Lush isn't really supposed to be Vim compatible but I recognize that is useful to some people. I can see there being more and more half-steps to compatibility as time goes on (say vim adds winblend vs blend) so I would rather off-shore that stuff into a specific vim compatibility layer instead of patching the compiler repeatedly.

Haven't quite thought about what the end user API for setting up plugins would look like yet. Probably um.... Just thinking out loud:

Theme folder has lushfile in the root, technically just a lua file. In it you can specify theme -> .viml files and any plugin chains for those or other transformations. This would sort of act like your build.lua.

-- lushfile

with("nodebones").generate({
  "colors/nordbones.vim" = { lush.lush }, -- lush.lush probably implicit, maybe
  "colors/nordbones_vimcompat.vim" = { lush.lush, lush.vim_compatible },
  "extra/kitty/nordbones.conf" = { lush.kitty, mcchrish.custom_something},
  "extra/css/nordbones.css" = { some_random.css_transformer }
})

-- ... etc
-- for file in dir do with(file) ...

When you want you can :Lush build and it will execute the lushfile.

That concept above is kind of mixing two ideas, the lush-viml-theme compiler plugins and a more general lush-to-anything transformers.

mcchrish commented 2 years ago

This is what it looks like in Vim: Without cterm defined:

highlight StatusLine guifg=#2C363C guibg=#D1C7C3 guisp=NONE gui=NONE
Screen Shot 2021-11-01 at 6 17 19 AM

With cterm defined:

highlight StatusLine guifg=#2C363C guibg=#D1C7C3 guisp=NONE gui=NONE cterm=NONE
Screen Shot 2021-11-01 at 6 17 54 AM

Does this mean gui=value should actually be dropped when in Vim mode? (edit: actually, I guess not otherwise someone would have raised an issue already?)

No need, vim will just use the appropriate value depending on the environment it's running.

Lush isn't really supposed to be Vim compatible but I recognize that is useful to some people. I can see there being more and more half-steps to compatibility as time goes on (say vim adds winblend vs blend) so I would rather off-shore that stuff into a specific vim compatibility layer instead of patching the compiler repeatedly.

Edit: I removed my previous thoughts as I misunderstood your idea.

I like the idea of layered compiler options.

rktjmp commented 2 years ago

Should be covered by https://github.com/rktjmp/lush.nvim/blob/main/lua/shipwright/transform/lush/vim_compatible_vimscript.lua