From d34b91cfd854092469d3a1ff6658879a5239853d Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Thu, 22 Jun 2023 14:12:12 +0200 Subject: [PATCH] Fix copilot setup --- lua/plugins/cmp.lua | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index f72c46a..d99e213 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -16,6 +16,24 @@ return { 'hrsh7th/vim-vsnip', 'hrsh7th/vim-vsnip-integ', 'onsails/lspkind.nvim', + { + 'zbirenbaum/copilot-cmp', + dependencies = { "hrsh7th/nvim-cmp", + { + 'zbirenbaum/copilot.lua', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + filetypes = { + mail = false, + } + } + } + }, + config = function () + require("copilot_cmp").setup() + end + }, }, config = function() local cmp = require('cmp') @@ -33,7 +51,7 @@ return { [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }), @@ -64,19 +82,4 @@ return { }) end, }, - { - 'zbirenbaum/copilot-cmp', - dependencies = { "hrsh7th/nvim-cmp", - { - 'zbirenbaum/copilot.lua', - opts = { - suggestion = { enabled = false }, - panel = { enabled = false }, - filetypes = { - mail = false, - } - } - } - }, - }, }