navarasu / onedark.nvim

One dark and light colorscheme for neovim >= 0.5.0 written in lua based on Atom's One Dark and Light theme. Additionally, it comes with 5 color variant styles
MIT License
1.58k stars 159 forks source link

CMP does not working highlight anymore #168

Open RigottiG opened 1 year ago

RigottiG commented 1 year ago

After I install Onedark, the cmp stopped working the highlight.

I have a minimal setup for Onedark and the highlight works on NeoTree or Telescope for example.

local present, onedark = pcall(require, "onedark")

if not present then
  return
end
onedark.setup({
  -- Main options --
  style = 'darker',            -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
  transparent = true,          -- Show/hide background
  cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu

  code_style = {
    comments = 'italic',
    keywords = 'none',
    functions = 'none',
    strings = 'none',
    variables = 'none'
  },

  -- Lualine options --
  lualine = {
    transparent = true, -- lualine center bar transparency
  },

  -- Plugins Config --
  diagnostics = {
    darker = true,     -- darker colors for diagnostic
    undercurl = true,  -- use undercurl instead of underline for diagnostics
    background = true, -- use background color for virtual text
  },
})

ezgif com-video-to-gif

ByteDrummer commented 1 month ago

I encountered this issue yesterday. This is most likely because in cmp.setup() your definition for window.completion.winhighlight is missing CursorLine since the docs for nvim-cmp are misleading. I set winhighlight it to "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None" and it worked.

You may also want to customize the Pmenu highlight to something nicer, since it also modifies the foreground colors of the entry once selected. I added vim.api.nvim_set_hl(0, "PmenuSel", { bg = "#393f4a", fg = "NONE" }) to my config after the theme is loaded. #393f4a is the color for dark.bg2 as defined in lua/onedark/palette.lua of this repo. It looks like you might be using a variant of the theme, so pick the appropriate hex value.