[CMP] Fix new update breaking border

This commit is contained in:
2026-01-05 17:15:52 +01:00
parent 2a3a558621
commit f9202899bc
3 changed files with 245 additions and 247 deletions

View File

@@ -1,128 +1,131 @@
return { return {
-- competion -- competion
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = { "InsertEnter", "LspAttach" }, event = { "InsertEnter", "LspAttach" },
dependencies = { dependencies = {
{ "hrsh7th/cmp-buffer" }, -- source for text in buffer { "hrsh7th/cmp-buffer" }, -- source for text in buffer
{ "hrsh7th/cmp-path" }, -- source for file system paths { "hrsh7th/cmp-path" }, -- source for file system paths
{ "L3MON4D3/LuaSnip" }, -- snippet engine { "L3MON4D3/LuaSnip" }, -- snippet engine
{ "saadparwaiz1/cmp_luasnip" }, -- for autocompletion { "saadparwaiz1/cmp_luasnip" }, -- for autocompletion
{ "rafamadriz/friendly-snippets" }, -- useful snippets { "rafamadriz/friendly-snippets" }, -- useful snippets
{ "onsails/lspkind.nvim" }, -- icons for cmp { "onsails/lspkind.nvim" }, -- icons for cmp
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
local lspkind = require("lspkind") local lspkind = require("lspkind")
local luasnip = require("luasnip") local luasnip = require("luasnip")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets) -- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } }) require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
luasnip.setup({}) luasnip.setup({})
-- luasnip.filetype_extend("htmldjango", { "html" }) -- luasnip.filetype_extend("htmldjango", { "html" })
cmp.setup({ cmp.setup({
completion = { completion = {
completeopt = "menu,menuone,preview,noselect", completeopt = "menu,menuone,preview,noselect",
}, },
window = { window = {
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered({
completion = cmp.config.window.bordered({ border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", }),
}), completion = cmp.config.window.bordered({
}, border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
}),
},
snippet = { -- configure how nvim-cmp interacts with snippet engine snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) luasnip.lsp_expand(args.body)
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.ConfirmBehavior.Select }), -- next suggestion ["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.ConfirmBehavior.Select }), -- next suggestion
["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.ConfirmBehavior.Select }), -- prev suggestion ["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.ConfirmBehavior.Select }), -- prev suggestion
["<C-S-J>"] = cmp.mapping.scroll_docs(4, { behavior = cmp.ConfirmBehavior.Select }), -- docs forward ["<C-S-J>"] = cmp.mapping.scroll_docs(4, { behavior = cmp.ConfirmBehavior.Select }), -- docs forward
["<C-S-K>"] = cmp.mapping.scroll_docs(-4, { behavior = cmp.ConfirmBehavior.Select }), -- docs back ["<C-S-K>"] = cmp.mapping.scroll_docs(-4, { behavior = cmp.ConfirmBehavior.Select }), -- docs back
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-q>"] = cmp.mapping.abort(), -- close completion window ["<C-q>"] = cmp.mapping.abort(), -- close completion window
["<CR>"] = cmp.mapping.confirm({ select = false }), -- autocomplete if selected ["<CR>"] = cmp.mapping.confirm({ select = false }), -- autocomplete if selected
-- Mapping for Tab key -- Mapping for Tab key
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }) cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
else else
-- Otherwise, fallback (insert a tab character) -- Otherwise, fallback (insert a tab character)
require("neotab").tabout() require("neotab").tabout()
-- fallback() -- fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
-- Mapping for jumping in snippets -- Mapping for jumping in snippets
["<C-p>"] = cmp.mapping(function(fallback) ["<C-p>"] = cmp.mapping(function(fallback)
if require("luasnip").jumpable() then if require("luasnip").jumpable() then
-- Jump backwards if inside a snippet -- Jump backwards if inside a snippet
require("luasnip").jump() require("luasnip").jump()
else else
-- Otherwise, fallback (insert a tab character) -- Otherwise, fallback (insert a tab character)
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
-- Mapping for jumping backwards in snippets -- Mapping for jumping backwards in snippets
["<C-S-p>"] = cmp.mapping(function(fallback) ["<C-S-p>"] = cmp.mapping(function(fallback)
if require("luasnip").jumpable() then if require("luasnip").jumpable() then
-- Jump backwards if inside a snippet -- Jump backwards if inside a snippet
require("luasnip").jump() require("luasnip").jump()
else else
-- Otherwise, fallback (insert a tab character) -- Otherwise, fallback (insert a tab character)
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
}), }),
-- sources for autocompletion -- sources for autocompletion
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- lsp { name = "nvim_lsp" }, -- lsp
{ name = "luasnip" }, -- snippets { name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer { name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths { name = "path" }, -- file system paths
}), }),
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = lspkind.cmp_format({ format = lspkind.cmp_format({
mode = "symbol", -- show only symbol annotations mode = "symbol", -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as -- can also be a function to dynamically calculate max width such as
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end, -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
ellipsis_char = "", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) ellipsis_char = "", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind -- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function(entry, vim_item) before = function(entry, vim_item)
return vim_item return vim_item
end, end,
}), }),
}, },
}) })
local opts = { silent = true } local opts = { silent = true }
opts.desc = "next snippet placeholder" opts.desc = "next snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-,>", function() vim.keymap.set({ "i", "s" }, "<C-,>", function()
luasnip.jump(1) luasnip.jump(1)
end, opts) end, opts)
opts.desc = "previous snippet placeholder" opts.desc = "previous snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-.>", function() vim.keymap.set({ "i", "s" }, "<C-.>", function()
luasnip.jump(-1) luasnip.jump(-1)
end, opts) end, opts)
opts.desc = "LuaSnip unlink" opts.desc = "LuaSnip unlink"
vim.keymap.set({ "i", "n" }, "<C-s>", function() vim.keymap.set({ "i", "n" }, "<C-s>", function()
luasnip.unlink_current() luasnip.unlink_current()
end, opts) end, opts)
end, end,
} }

View File

@@ -1,137 +1,137 @@
return { return {
-- color theme -- color theme
"EdenEast/nightfox.nvim", "EdenEast/nightfox.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function() config = function()
local Shade = require("nightfox.lib.shade") local Shade = require("nightfox.lib.shade")
require("nightfox").setup({ require("nightfox").setup({
options = { options = {
transparent = true, transparent = true,
styles = { styles = {
comments = "italic", comments = "italic",
functions = "italic", functions = "italic",
keywords = "italic", keywords = "italic",
types = "italic", types = "italic",
}, },
}, },
palettes = { palettes = {
all = { all = {
black = Shade.new("#404944", 0.15, -0.15), black = Shade.new("#404944", 0.15, -0.15),
gray = Shade.new("#505050", 0.15, -0.15), gray = Shade.new("#505050", 0.15, -0.15),
white = Shade.new("#dee4df", 0.15, -0.15), white = Shade.new("#dee4df", 0.15, -0.15),
red = Shade.new("#ff6060", 0.15, -0.15), red = Shade.new("#ff6060", 0.15, -0.15),
darkred = Shade.new("#AA3030", 0.15, -0.15), darkred = Shade.new("#AA3030", 0.15, -0.15),
strongred = Shade.new("#bb0000", 0.15, -0.15), strongred = Shade.new("#bb0000", 0.15, -0.15),
orange = Shade.new("#ce8c14", 0.15, -0.15), orange = Shade.new("#ce8c14", 0.15, -0.15),
green = Shade.new("#a3d397", 0.10, -0.15), green = Shade.new("#a3d397", 0.10, -0.15),
darkgreen = Shade.new("#005602", 0.10, -0.15), darkgreen = Shade.new("#005602", 0.10, -0.15),
darkyellow = Shade.new("#dfd100", 0.10, -0.15), darkyellow = Shade.new("#dfd100", 0.10, -0.15),
yellow = Shade.new("#e3c46d", 0.15, -0.15), yellow = Shade.new("#e3c46d", 0.15, -0.15),
darkblue = Shade.new("#1010cc", 0.15, -0.15), darkblue = Shade.new("#1010cc", 0.15, -0.15),
blue = Shade.new("#7070dd", 0.15, -0.15), blue = Shade.new("#7070dd", 0.15, -0.15),
magenta = Shade.new("#C02490", 0.30, -0.15), magenta = Shade.new("#C02490", 0.30, -0.15),
pink = Shade.new("#ff82c2", 0.15, -0.15), pink = Shade.new("#ff82c2", 0.15, -0.15),
purple = Shade.new("#761464", 0.15, -0.15), purple = Shade.new("#761464", 0.15, -0.15),
turquoise = Shade.new("#3fffb0", 0.15, -0.15), turquoise = Shade.new("#3fffb0", 0.15, -0.15),
cyan = Shade.new("#7ac9ff", 0.15, -0.15), cyan = Shade.new("#7ac9ff", 0.15, -0.15),
lightblue = Shade.new("#add8e6", 0.15, -0.15), lightblue = Shade.new("#add8e6", 0.15, -0.15),
softblue = Shade.new("#10aaff", 0.15, -0.15), softblue = Shade.new("#10aaff", 0.15, -0.15),
brown = Shade.new("#664010", 0.15, -0.15), brown = Shade.new("#664010", 0.15, -0.15),
bg0 = "#0f1512", -- Dark bg (status line and float) bg0 = "#0f1512", -- Dark bg (status line and float)
bg1 = "#0f1512", -- Default bg bg1 = "#0f1512", -- Default bg
bg2 = "#1b211e", -- Lighter bg (colorcolm folds) bg2 = "#1b211e", -- Lighter bg (colorcolm folds)
bg3 = "#252b28", -- Lighter bg (cursor line) bg3 = "#252b28", -- Lighter bg (cursor line)
bg4 = "#303633", -- Conceal, border fg bg4 = "#303633", -- Conceal, border fg
fg0 = "#dee4df", -- Lighter fg fg0 = "#dee4df", -- Lighter fg
fg1 = "#dee4df", -- Default fg fg1 = "#dee4df", -- Default fg
fg2 = "#dee4df", -- Darker fg (status line) fg2 = "#dee4df", -- Darker fg (status line)
fg3 = "#89938d", -- Darker fg (line numbers, fold colums) fg3 = "#89938d", -- Darker fg (line numbers, fold colums)
sel0 = "#404944", -- Popup bg, visual selection sel0 = "#404944", -- Popup bg, visual selection
sel1 = "#00513b", -- Popup sel bg, search bg sel1 = "#00513b", -- Popup sel bg, search bg
comment = "#89938d", comment = "#89938d",
}, },
}, },
specs = { specs = {
carbonfox = { carbonfox = {
syntax = { syntax = {
comment = "comment", comment = "comment",
bracket = "darkyellow", bracket = "darkyellow",
builtin0 = "turquoise", builtin0 = "turquoise",
builtin1 = "cyan", builtin1 = "cyan",
builtin2 = "lightblue", builtin2 = "lightblue",
conditional = "darkblue", conditional = "darkblue",
const = "gray", const = "gray",
dep = "darkred", dep = "darkred",
field = "green", field = "green",
func = "pink", func = "pink",
ident = "darkgreen", ident = "darkgreen",
keyword = "blue", keyword = "blue",
number = "yellow", number = "yellow",
operator = "white", operator = "white",
preproc = "strongred", preproc = "strongred",
regex = "purple", regex = "purple",
statement = "magenta", statement = "magenta",
string = "softblue", string = "softblue",
type = "red", type = "red",
variable = "orange", variable = "orange",
}, },
diag = { diag = {
error = "darkred", error = "darkred",
warn = "yellow", warn = "yellow",
info = "softblue", info = "softblue",
hint = "fg3", hint = "fg3",
ok = "darkgreen", ok = "darkgreen",
}, },
diag_bg = { diag_bg = {
error = "red", error = "red",
warn = "#a16b00", warn = "#a16b00",
info = "cyan", info = "cyan",
hint = "bg3", hint = "bg3",
ok = "green", ok = "green",
}, },
diff = { diff = {
add = "darkgreen", add = "darkgreen",
delete = "darkred", delete = "darkred",
changed = "softblue", changed = "softblue",
text = "fg0", text = "fg0",
}, },
git = { git = {
add = "darkgreen", add = "darkgreen",
removed = "darkred", removed = "darkred",
changed = "softblue", changed = "softblue",
conflict = "orange", conflict = "orange",
ignored = "gray", ignored = "gray",
}, },
}, },
}, },
groups = { groups = {
all = { all = {
Cursor = { fg = "palette.white", bg = "palette.lightblue" }, -- character under the cursor Cursor = { fg = "palette.white", bg = "palette.lightblue" }, -- character under the cursor
WinSeparator = { fg = "palette.bg2" }, -- the column separating vertically split windows WinSeparator = { fg = "palette.bg2" }, -- the column separating vertically split windows
EndOfBuffer = { link = "WinSeparator" }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. EndOfBuffer = { link = "WinSeparator" }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
CursorLine = { bg = "palette.bg1" }, CursorLine = { bg = "palette.bg1" },
CursorLineNr = { fg = "palette.cyan", style = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. CursorLineNr = { fg = "palette.cyan", style = "bold" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
Search = { fg = "palette.softblue", bg = "#00513b" }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. Search = { fg = "palette.softblue", bg = "#00513b" }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
IncSearch = { fg = "palette.softblue", bg = "#1a6b51" }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c" IncSearch = { fg = "palette.softblue", bg = "#1a6b51" }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
ModeMsg = { fg = "palette.fg3", style = "bold" }, -- 'showmode' message (e.g., "-- INSERT --") ModeMsg = { fg = "palette.fg3", style = "bold" }, -- 'showmode' message (e.g., "-- INSERT --")
SnacksDashboardNormal = { fg = "palette.green" }, SnacksDashboardNormal = { fg = "palette.green" },
SnacksDashboardDesc = { fg = "palette.softblue" }, SnacksDashboardDesc = { fg = "palette.softblue" },
SnacksDashboardFile = { fg = "palette.softblue" }, SnacksDashboardFile = { fg = "palette.softblue" },
SnacksDashboardIcon = { fg = "palette.orange" }, SnacksDashboardIcon = { fg = "palette.orange" },
SnacksDashboardHeader = { fg = "palette.darkred" }, SnacksDashboardHeader = { fg = "palette.darkred" },
SnacksDashboardTitle = { fg = "palette.turquoise" }, SnacksDashboardTitle = { fg = "palette.turquoise" },
SnacksIndentScope = { fg = "palette.lightblue" } SnacksIndentScope = { fg = "palette.lightblue" },
}, },
}, },
}) })
if not vim.g.vscode then if not vim.g.vscode then
vim.cmd([[colorscheme carbonfox]]) vim.cmd([[colorscheme carbonfox]])
end end
end, end,
} }

View File

@@ -1,5 +0,0 @@
return {
-- prettier prompts
"stevearc/dressing.nvim",
event = "VeryLazy",
}