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

Configuring highlight of type "@variable" #69

Closed
hdemers opened this issue Mar 27, 2024 · 3 comments · Fixed by #71
Closed

Configuring highlight of type "@variable" #69

hdemers opened this issue Mar 27, 2024 · 3 comments · Fixed by #71
Assignees
Labels
bug Something isn't working

Comments

@hdemers
Copy link

hdemers commented Mar 27, 2024

First, thank you for such a nice colorscheme! Really well done. I especially like the way we can easily configure it using the highlight option:

require('solarized').setup {
    highlights = function (colors, colorhelper)
        local darken = colorhelper.darken
        local lighten = colorhelper.lighten
        local blend = colorhelper.blend

        return {
            LineNr = { fg = c.base1, bg = c.base02 },
            CursorLineNr = { bg = c.base02 },
            CursorLine = { bg = c.base02 },
            Function = { italic = false },
            Visual = { bg = c.cyan },
        }
    end
}

I'd like to know what's your recommended approach to configure highlights that start with an @ sign, like @variable? Thanks again.

@maxmx03
Copy link
Owner

maxmx03 commented Mar 27, 2024

You enclose a string within square brackets with the name of the highlight group you want to customize, for example:

require('solarized').setup {
    highlights = function ()
        return {
          ['@character.printf'] = { link = '@keyword' },
        }
    end
}

@hdemers
Copy link
Author

hdemers commented Mar 27, 2024

Gotcha. I should have mentioned that I actually tried that, and it appeared to work, in the sense that the highlight was changed, but it was reported by :highlight as the following, assuming I did:

require('solarized').setup {
    highlights = function ()
        return {
          ['@function.builtin'] = { link = 'Special' },
        }
    end
}

image

Is that how it should be?

@maxmx03
Copy link
Owner

maxmx03 commented Mar 28, 2024

I will take a look later, but links have high priority even if there are guifg or guibg colors. Nothing to worry about.

@maxmx03 maxmx03 self-assigned this Mar 28, 2024
@maxmx03 maxmx03 added the bug Something isn't working label Mar 28, 2024
maxmx03 added a commit that referenced this issue Mar 28, 2024
feat: github workflows, vusted, stylua
@maxmx03 maxmx03 linked a pull request Mar 28, 2024 that will close this issue
maxmx03 added a commit that referenced this issue Mar 28, 2024
feat: github workflows, vusted, stylua
nigonro pushed a commit to nigonro/solarized.nvim that referenced this issue May 3, 2024
feat: github workflows, vusted, stylua
This was referenced May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants