From e0a811ea58ac76909e313119b6645b0b6bbd5286 Mon Sep 17 00:00:00 2001 From: sudacode Date: Thu, 4 May 2023 09:15:14 -0700 Subject: [PATCH] update nvim cmp and copilot --- lua/plugins.lua | 12 +++++---- plugin-confs/nvim-cmp.lua | 56 ++++++++++++++------------------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 232d517..1288ffe 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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 = "", - accept = "", + accept = "", + -- accept = "", next = "", prev = "", dismiss = "", @@ -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 -- } diff --git a/plugin-confs/nvim-cmp.lua b/plugin-confs/nvim-cmp.lua index 4f00836..962825f 100644 --- a/plugin-confs/nvim-cmp.lua +++ b/plugin-confs/nvim-cmp.lua @@ -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('/', {