zenbones-theme / zenbones.nvim

🪨 A collection of contrast-based Vim/Neovim colorschemes
MIT License
650 stars 46 forks source link

Wish : Option to config TSParameter to bold #166

Closed sbyang closed 3 months ago

sbyang commented 3 months ago

Thanks for making such an amazing colorscheme.

I wish to see differentiated font on function parameters and globals like in nightfox, catppuccin, tokyonight..

Is there a config to change the sytle of the fuction parameters to bold, or can you make them different style by default?

mcchrish commented 3 months ago

You can always extend the colorscheme using the Colorscheme autocommand + nvim highlight API:

vim.api.nvim_create_autocmd({ "ColorScheme" }, {
    pattern = "zenbones",
    callback = function()
        vim.api.nvim_set_hl(0, "@variable.parameter", vim.tbl_extend( "keep", { bold = true, italic = true }, vim.api.nvim_get_hl(0, { name = "@variable.parameter", link = false })))
    end,
})
sbyang commented 3 months ago

Thank you @mcchrish it works great!

Here is the config with above changes for LazyVim, if anyone is intrested in making parameter bold, italic.

    {
        "mcchrish/zenbones.nvim",
        requires = "rktjmp/lush.nvim",
        config = function()
            vim.api.nvim_create_autocmd(
                { "ColorScheme" },
                {
                    pattern = "*bones",
                    callback = function()
                        vim.api.nvim_set_hl(0, "@variable.parameter", vim.tbl_extend( "keep", { bold = true, italic = true }, vim.api.nvim_get_hl(0, { name = "@variable.parameter", link = false })))
                    end
                }
            )
        end,
    },