Add copilot configs for nvim and zed

This commit is contained in:
Alexander Navarro 2024-11-04 12:50:17 -03:00
parent a3804e67a5
commit 3fc3675808
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
9 changed files with 197 additions and 209 deletions

View file

@ -13,6 +13,12 @@ return {
"petertriho/cmp-git",
"saadparwaiz1/cmp_luasnip",
"windwp/nvim-autopairs",
{
"zbirenbaum/copilot-cmp",
config = function()
require("copilot_cmp").setup()
end
},
},
config = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
@ -64,6 +70,7 @@ return {
}),
sources = cmp.config.sources({
{ name = "conventionalcommits" },
{ name = "copilot" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
@ -88,7 +95,24 @@ return {
hl_group = "CmpGhostText",
},
},
sorting = defaults.sorting,
sorting = {
priority_weight = 2,
comparators = {
require("copilot_cmp.comparators").prioritize,
-- Below is the default comparitor list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
}
cmp.setup(opts)