From df77dc00b18e98e6256b894a9ae3b45f7eceae9c Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 3 Mar 2023 15:08:48 -0500 Subject: [PATCH] Copilot fixes --- lua/install-plugins.lua | 4 ++++ lua/plugins/copilot.lua | 4 ++-- lua/plugins/nvim-cmp.lua | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/install-plugins.lua b/lua/install-plugins.lua index 96d9714..c05e6f6 100644 --- a/lua/install-plugins.lua +++ b/lua/install-plugins.lua @@ -335,6 +335,10 @@ return require('packer').startup(function(use) } use { 'zbirenbaum/copilot-cmp', + requires = { + 'hrsh7th/nvim-cmp', + 'zbirenbaum/copilot.lua', + }, config = function () require('plugins.copilot-cmp') end diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 4a371e5..22b3a21 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -1,4 +1,4 @@ require('copilot').setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, + suggestion = { enabled = true }, + panel = { enabled = true }, }); diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index b0214b0..4638800 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -27,7 +27,7 @@ cmp.setup({ [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [''] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. [""] = cmp.mapping(function(fallback) if cmp.visible() and has_words_before() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })