scottmckendry / cyberdream.nvim

🤖💤 High-contrast, Futuristic & Vibrant Coloursheme for Neovim
MIT License
609 stars 25 forks source link

Tree sitter highlighting differs a bit #84

Closed 231tr0n closed 2 months ago

231tr0n commented 2 months ago

Description

image If you compare both the themes, you can see that vim.o.wrap differs between both the themes probably due to a missing highlight group for treesitter. Do you know which highlight group could this be.

Neovim version?

NVIM v0.11.0-dev-313+gfc9b70826

What should happen?

In vim.o.wrap, o.wrap part should be highlighted as well.

What happened instead?

In vim.o.wrap, o.wrap part should was not highlighted.

Your configuration

{
    "scottmckendry/cyberdream.nvim",
    lazy = false,
    priority = 1000,
    config = function()
        require("cyberdream").setup({
            transparent = true,
            italic_comments = true,
            hide_fillchars = true,
            borderless_telescope = true,
        })
        vim.cmd("colorscheme cyberdream")
    end,
}
scottmckendry commented 2 months ago

Hello @231tr0n! Thanks for submitting 🙂

This is mostly intentional as a lot of the variable subtypes for tree-sitter and LSP highlight groups link back to their parent. In this case, the groups you're referencing in the screenshot are @variable.member (tree-sitter) and @lsp.type.property (LSP).

You can override both of these groups in your config with your desired color. For example:

 {
    "scottmckendry/cyberdream.nvim",
    lazy = false,
    priority = 1000,
    config = function()
        require("cyberdream").setup({
            transparent = true,
            italic_comments = true,
            hide_fillchars = true,
            borderless_telescope = true,
            theme = {
                overrides = function(colors)
                    return {
                        -- Change these to your liking
                        ["@variable.member"] = { fg = colors.cyan },
                        ["@lsp.type.property"] = { fg = colors.cyan },
                    }
                end,
            },
        })
        vim.cmd("colorscheme cyberdream")
    end,
}

The result looks like this: image

If you want to customise other groups, but you're not sure what they're called, you can use :Inspect while your cursor is on the token lookup which groups are being applied: image

I hope this helps!

231tr0n commented 2 months ago

Yup. This helps. Thank you for helping me out.

231tr0n commented 2 months ago

@scottmckendry just a small query like can you let me know what all treesitter and lsp highlight groups are linked like the ones you mentioned above. Is there any place I can refer to get a list of all missing highlight groups.

scottmckendry commented 2 months ago

@231tr0n certainly!

If you run :hi in Neovim, a window will open with all of the highlight groups currently defined. You'll notice there's a LOT!

You can also run :lua require("fzf-lua").highlights() to show all of these in fzf: image

Telescope also supports this with :Telescope highlights.