which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

Missing/Deprecated highlight group(?)

Open dharmx opened this issue 3 years ago • 0 comments

Missing/Deprecated highlight group(?)

A few days ago I lost my Neovim configs so naturally, my which-key config was lost as well... Anyways, I started to reconfigure it and noticed that a highlight group wasn't applying. I don't know what it was (configured it a while back) but, my best guess is the WhichKeySeperator group(?) Used to have a cool aesthetic effect on my separators:

Before

screenshot-1646513346 screenshot-1646513360 Notice the slight blue line at the end?

After

screenshot-1646513269 I can't seem to replicate it no matter how I try.

Other relevant info

Following are the which-key configs and highlight configs

which-key config

local present, which_key = pcall(require, "which-key")

if not present then
  return
end

local config = {
  plugins = {
    marks = true,
    registers = true,
    spelling = {
      enabled = true,
      suggestions = 20,
    },
    presets = {
      operators = true,
      motions = true,
      text_objects = true,
      windows = true,
      nav = true,
      z = true,
      g = true,
    },
  },
  operators = { gc = "Comments" },
  key_labels = {
    ["<space>"] = "SPC",
    ["<Space>"] = "SPC",
    ["<leader>"] = "SPC",
    ["<Leader>"] = "SPC",
    ["<cr>"] = "RET",
    ["<Cr>"] = "RET",
    ["<CR>"] = "RET",
    ["<tab>"] = "TAB",
    ["<Tab>"] = "TAB",
    ["<TAB>"] = "TAB",
    ["<bs>"] = "BSPC",
    ["<esc>"] = "ESC",
    ["<BS>"] = "BSPC",
    ["<Esc>"] = "ESC",
  },
  icons = {
    -- ▐
    breadcrumb = " ",
    separator = " ▎",
    group = " ",
  },
  popup_mappings = require("mappings").which_key_nvim,
  window = {
    border = "none", -- none, single, double, shadow
    position = "bottom", -- bottom, top
    margin = { 0, 0, 0, 0 }, -- extra window margin [top, right, bottom, left]
    padding = { 3, 3, 3, 3 }, -- extra window padding [top, right, bottom, left]
    winblend = 1,
  },
  layout = {
    height = { min = 4, max = 25 },
    width = { min = 20, max = 50 },
    spacing = 4,
    align = "left",
  },
  ignore_missing = true,
  hidden = { "<silent>", "<cmd>", "<Cmd>", "<CMD>", "<CR>", "call", "lua", "^:", "^ " },
  show_help = true,
  triggers = "auto",
  triggers_blacklist = {
    i = { "j", "k" },
    v = { "j", "k" },
  },
}

for _, plugin in ipairs { "buffers", "plugins", "others", "prompts" } do
  local loaded = require("configs.whichkey." .. plugin)
  which_key.register(loaded.mappings, loaded.options)
end

which_key.setup(config)

Highlight configs

local W = {}

function W.get(theme)
  return {
    WhichKeyFloat = { background = theme.shades.shade05 },
    WhichKeyGroup = { foreground = theme.common.base11 },
    WhichKeyDesc = { foreground = theme.common.base08 },
    WhichKeySeparator = { foreground = theme.common.base09 },
    WhichKeyValue = { foreground = theme.common.base14 },
    WhichKey = { foreground = theme.common.base14 },
  }
end

return W

Sample theme colors

local N = {}

N.common = {
  -- Polar Night
  ["base00"] = "#2E3440",
  ["base01"] = "#3B4252",
  ["base02"] = "#434C5E",
  ["base03"] = "#4C566A",

  -- Snow Storm
  ["base04"] = "#D8DEE9",
  ["base05"] = "#E5E9F0",
  ["base06"] = "#ECEFF4",

  -- Frost
  ["base07"] = "#8FBCBB",
  ["base08"] = "#88C0D0",
  ["base09"] = "#81A1C1",
  ["base10"] = "#5E81AC",

  -- Aurora
  ["base11"] = "#BF616A",
  ["base12"] = "#D08770",
  ["base13"] = "#EBCB8B",
  ["base14"] = "#A3BE8C",
  ["base15"] = "#B48EAD",
}

N.shades = {
  ["shade00"] = "#505763",
  ["shade01"] = "#505A63",
  ["shade02"] = "#484d61",
  ["shade03"] = "#414754",
  ["shade04"] = "#333947",
  ["shade05"] = "#393f4C",
  ["shade06"] = "#333947",
  ["shade07"] = "#282E38",
  ["shade08"] = "#272B37",
  ["shade09"] = "#252A33",
  ["shade10"] = "#252B37",
  ["shade11"] = "#262c38",
}

N.rainbow = {
  ["cobalt"] = "#AFC2E5",
  ["pink"] = "#C48EAD",
  ["cyan"] = "#DDBBB1",
  ["green"] = "#AFBE8C",
  ["yellow"] = "#FFBB8B",
  ["orange"] = "#D08770",
  ["purple"] = "#C0A0F0",
}

N.modes = setmetatable({
  ["n"] = "#88C0D0",
  ["no"] = "#88C0D0",
  ["v"] = "#A3BE8C",
  ["V"] = "#E0AF8B",
  [""] = "#DBA08B",
  ["s"] = "#CE878F",
  ["S"] = "#CE878F",
  [""] = "#CE878F",
  ["i"] = "#C09AC0",
  ["ic"] = "#C09AC0",
  ["R"] = "#D08770",
  ["Rv"] = "#D08770",
  ["c"] = "#BF616A",
  ["cv"] = "#BF616A",
  ["ce"] = "#BF616A",
  ["r"] = "#DFBB8B",
  ["rm"] = "#EBCB8B",
  ["r?"] = "#DE878F",
  ["!"] = "#DFBF8B",
  ["t"] = "#5E81AC",
}, {
  __index = function()
    return "#B48EAD"
  end,
})

N.syntax = {
  ["color16"] = "#88C0D0",
  ["color09"] = "#8FBCBB",

  ["color00"] = "#81A1C1",
  ["color03"] = "#7797B7",
  ["color02"] = "#6F8EAD",
  ["color19"] = "#5E81AC",

  ["color17"] = "#BF616A",
  ["color20"] = "#D08770",

  ["color13"] = "#C08770",
  ["color01"] = "#D0A78F",
  ["color05"] = "#CBA08B",

  ["color12"] = "#AFBE8C",
  ["color15"] = "#A3BE8C",
  ["color04"] = "#99BB8B",

  ["color06"] = "#B48EAD",
  ["color08"] = "#B08F90",

  ["color10"] = "#EBCB8B",
  ["color11"] = "#EBCBAB",

  ["color18"] = "#333947",
  ["color14"] = "#414754",
  ["color07"] = "#D8DEE9",
}

return N

I know this is a stupid issue but I've wasted too much time on this LOL...can't give up now.

dharmx avatar Mar 05 '22 20:03 dharmx