update nvim cmp and copilot

This commit is contained in:
sudacode 2023-05-04 09:15:14 -07:00
parent 7cff58dede
commit e0a811ea58
2 changed files with 27 additions and 41 deletions

View File

@ -20,7 +20,7 @@ require('packer').startup(function(use)
vim.defer_fn(function()
require('copilot').setup({
panel = {
enabled = true,
enabled = false,
auto_refresh = false,
keymap = {
jump_prev = "[[",
@ -39,8 +39,8 @@ require('packer').startup(function(use)
auto_trigger = true,
debounce = 75,
keymap = {
-- accept = "<Tab>",
accept = "<Right>",
accept = "<C-l>",
-- accept = "<Right>",
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
@ -76,10 +76,12 @@ require('packer').startup(function(use)
use {
"zbirenbaum/copilot-cmp",
after = { "copilot.lua" },
-- after = { "copilot.lua" },
config = function ()
require("copilot_cmp").setup({
method = "getCompletionsCycling",
suggestion = { enabled = false },
panel = { enabled = false },
-- method = "getCompletionsCycling",
-- formatters = {
-- insert_text = require("copilot_cmp.format").remove_existing
-- }

View File

@ -20,34 +20,6 @@ lspkind.init({
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"})
local kind_icons = {
Text = "",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰇽",
Variable = "󰂡",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰅲",
}
cmp.setup({
snippet = {
expand = function(args)
@ -225,15 +197,27 @@ cmp.setup({
sorting = {
priority_weight = 2,
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
require("copilot_cmp.comparators").prioritize,
require("copilot_cmp.comparators").score,
require("copilot_cmp.comparators").recently_used,
require("copilot_cmp.comparators").kind,
require("copilot_cmp.comparators").sort_text,
require("copilot_cmp.comparators").length,
require("copilot_cmp.comparators").order,
-- 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.cmdline('/', {