smartinellimarco / nvcheatsheet.nvim

NvChad cheatsheet as a standalone neovim plugin
GNU General Public License v3.0
21 stars 2 forks source link

No color Highlights on neoVim #1

Open thgoncalves opened 3 months ago

thgoncalves commented 3 months ago

Hey.. that's a great Plugin. I like the idea of having a plugin to remember all my custom Keymaps

Question: I don't see any color on my Cheatsheet. Do you have any suggestions? I am using Catppuccin and when I tried NvChad I also used Catppuccin and I was able to see colors an highlights

image

Thanks for the great work

Onefabis commented 2 months ago

Hey, @thgoncalves, I found that workaround: you need to overwrite the highlight group for each color presented in the description of that plugin https://neovim.io/doc/user/api.html#nvim_set_hl() It is better to setup that highlight group in the color theme that you've installed for your neovim. So here is the example of the code for kanagawa theme that installed on my neovim. This is the Lazy representation of the plugin, so you need to tweak it for your package manager if it's not Lazy.

local function color(name, bgcolor, fgcolor)
    vim.api.nvim_set_hl(0, name, { bg = bgcolor, fg = fgcolor })
end
return {
    "rebelot/kanagawa.nvim",
    priority = 1000,
    config = function()
        require("kanagawa").setup({
            overrides = function(colors)
                return {
                    color("NvChAsciiHeader", colors.palette.sumiInk3, colors.palette.fujiWhite), -- Title
                    color("NvChSection", colors.palette.sumiInk2), -- Each card
                    color("NvCheatsheetWhite", colors.palette.oldWhite, colors.palette.sumiInk3),
                    color("NvCheatsheetGray", colors.palette.dragonGray, colors.palette.sumiInk3),
                    color("NvCheatsheetBlue", colors.palette.dragonBlue2, colors.palette.sumiInk3),
                    color("NvCheatsheetCyan", colors.palette.lotusCyan, colors.palette.sumiInk3),
                    color("NvCheatsheetRed", colors.palette.waveRed, colors.palette.sumiInk3),
                    color("NvCheatsheetGreen", colors.palette.springGreen, colors.palette.sumiInk3),
                    color("NvCheatsheetOrange", colors.palette.surimiOrange, colors.palette.sumiInk3),
                    color("NvCheatsheetPurple", colors.palette.dragonPink, colors.palette.sumiInk3),
                    color("NvCheatsheetMagenta", colors.palette.dragonPink, colors.palette.sumiInk3),
                    color("NvCheatsheetYellow", colors.palette.boatYellow1, colors.palette.sumiInk3),
                }
            end,
            colors = {
                palette = {
                    -- change all usages of these colors
                    sumiInk3 = "#14141a", -- main background color
                    sumiInk4 = "#14141a", -- line number background color
                    sumiInk2 = "#1c1c25", -- cheatsheet column color
                },
            },
        })
        vim.cmd.colorscheme("kanagawa-wave")
    end,
}

So here how it looks: изображение

smartinellimarco commented 2 months ago

@thgoncalves Were you able to solve it?