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() vim.defer_fn(function()
require('copilot').setup({ require('copilot').setup({
panel = { panel = {
enabled = true, enabled = false,
auto_refresh = false, auto_refresh = false,
keymap = { keymap = {
jump_prev = "[[", jump_prev = "[[",
@ -39,8 +39,8 @@ require('packer').startup(function(use)
auto_trigger = true, auto_trigger = true,
debounce = 75, debounce = 75,
keymap = { keymap = {
-- accept = "<Tab>", accept = "<C-l>",
accept = "<Right>", -- accept = "<Right>",
next = "<M-]>", next = "<M-]>",
prev = "<M-[>", prev = "<M-[>",
dismiss = "<C-]>", dismiss = "<C-]>",
@ -76,10 +76,12 @@ require('packer').startup(function(use)
use { use {
"zbirenbaum/copilot-cmp", "zbirenbaum/copilot-cmp",
after = { "copilot.lua" }, -- after = { "copilot.lua" },
config = function () config = function ()
require("copilot_cmp").setup({ require("copilot_cmp").setup({
method = "getCompletionsCycling", suggestion = { enabled = false },
panel = { enabled = false },
-- method = "getCompletionsCycling",
-- formatters = { -- formatters = {
-- insert_text = require("copilot_cmp.format").remove_existing -- 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"}) 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({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
@ -225,15 +197,27 @@ cmp.setup({
sorting = { sorting = {
priority_weight = 2, priority_weight = 2,
comparators = { comparators = {
cmp.config.compare.offset, require("copilot_cmp.comparators").prioritize,
cmp.config.compare.exact, require("copilot_cmp.comparators").score,
cmp.config.compare.score, require("copilot_cmp.comparators").recently_used,
cmp.config.compare.kind, require("copilot_cmp.comparators").kind,
cmp.config.compare.sort_text, require("copilot_cmp.comparators").sort_text,
cmp.config.compare.length, require("copilot_cmp.comparators").length,
cmp.config.compare.order, 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('/', { cmp.setup.cmdline('/', {