Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Nushell Extra Theme Config #298

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

schrieveslaach
Copy link
Contributor

This commit adds extra files to generate a theming file for Nushell (see https://www.nushell.sh/book/coloring_and_theming.html#theming). The file can be source as in following example:

source /path/to/nightfox.nvim/extra/nightfox/nightfox_nushell.nu

let-env config = ($env.config | upsert color_config $nightfox_theme)

The following GIF shows the difference between the default theme (the first let and echo example) and the modified theme (second let and echo example).

output

I need to figure out the remaining colors. I want to get early feedback if that is something you want to include.

@EdenEast
Copy link
Owner

This looks great and is something that should be added to the extra section.

@schrieveslaach
Copy link
Contributor Author

@EdenEast, great. Happy to contribute. I think it is in a rievewable state now.

@schrieveslaach schrieveslaach marked this pull request as ready for review January 16, 2023 11:53

function M.generate(spec)
local content = [[
let nightfox_theme = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name can be taken from the palette with spec.palette.meta.name I would use this to change the table name so that you know what actual theme it is.

Suggested change
let nightfox_theme = {
let ${palette.meta.name}_theme = {

binary: "${syntax.number}"
block: "${syntax.bracket}"
bool: "${syntax.const}"
cellpath: "${palette.white}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful with setting either while or black by themselves. The issue is that for light themes like dayfox these colors will be very subtle. I would suggest that you append to the spec table with the following:

local P = spec.palette
spec.harsh = P.meta.light and P.black or P.white
spec.subtle = P.meta.light and P.white or P.black

This would then allow you to call cellpath: ${harsh}. This would be correct for both dark and light themes.

@EdenEast
Copy link
Owner

This looks good. If you could just resolve the stylua errors and we are good to get this merged.

This commit adds extra files to generate a theming file for Nushell (see
https://www.nushell.sh/book/coloring_and_theming.html#theming). The file
can be source as in following example:

```nushell
source /path/to/nightfox.nvim/extra/nightfox/nightfox_nushell.nu

let-env config = ($env.config | upsert color_config $nightfox_theme)
```
@schrieveslaach
Copy link
Contributor Author

@EdenEast, I think the stylua errors are fixed now.

Thanks for helping me getting this done and thanks for accepting my contribution,

@EdenEast
Copy link
Owner

All green LGTM!

@EdenEast EdenEast merged commit 23a678f into EdenEast:main Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants