fix(theme): cmp selection and border colors

This commit is contained in:
2024-08-08 17:07:11 +02:00
parent 36f2050e1c
commit d1c695ff5d
2 changed files with 6 additions and 4 deletions

View File

@@ -8,11 +8,12 @@ return {
opts = function() opts = function()
local cmp = require("cmp") local cmp = require("cmp")
local lspkind = require("lspkind") local lspkind = require("lspkind")
local border = require("409.ui").border
local cmp_select = { behavior = cmp.SelectBehavior.Select } local cmp_select = { behavior = cmp.SelectBehavior.Select }
local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None" local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None"
vim.api.nvim_set_hl(0, "CmpPmenuBorder", { link = "FloatBorder" })
return { return {
snippet = { snippet = {
expand = function(args) expand = function(args)
@@ -36,18 +37,18 @@ return {
}, },
window = { window = {
documentation = { documentation = {
border = border, border = "single",
winhighlight = winhighlight, winhighlight = winhighlight,
}, },
completion = { completion = {
border = border, border = "single",
winhighlight = winhighlight, winhighlight = winhighlight,
}, },
}, },
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item) format = function(entry, vim_item)
local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 70 })(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true }) local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " " kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")" kind.menu = " (" .. (strings[2] or "") .. ")"

View File

@@ -13,6 +13,7 @@ return {
vim.api.nvim_set_hl(0, "TelescopeResultsBorder", { fg = "#44475a" }) vim.api.nvim_set_hl(0, "TelescopeResultsBorder", { fg = "#44475a" })
vim.api.nvim_set_hl(0, "TelescopePromptCounter", { fg = "#44475a" }) vim.api.nvim_set_hl(0, "TelescopePromptCounter", { fg = "#44475a" })
vim.api.nvim_set_hl(0, "FloatBorder", { fg = "#44475a" }) vim.api.nvim_set_hl(0, "FloatBorder", { fg = "#44475a" })
vim.api.nvim_set_hl(0, "PmenuSel", { fg = "#282a36", bg = "#50fa7b", bold = true })
end, end,
}, },
} }