From 7c93199293f3699e7de843d9543e002bb3758c59 Mon Sep 17 00:00:00 2001 From: Steffen Rademacker Date: Sat, 3 Feb 2024 17:54:46 +0100 Subject: [PATCH] better copilot --- nvim/init.lua | 14 ++------------ nvim/lua/plugins/cmp.lua | 7 ++----- nvim/lua/plugins/copilot.lua | 4 ++-- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 349f483b..7f73b604 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -72,18 +72,8 @@ require('lazy').setup({ dependencies = 'nvim-lua/plenary.nvim', config = get_config('neorg'), }, - { 'github/copilot.vim' }, - -- { 'zbirenbaum/copilot.lua', event = 'InsertEnter', config = get_config('copilot') }, - -- { 'zbirenbaum/copilot-cmp', config = true }, - -- { 'jackMort/ChatGPT.nvim', - -- event = 'VeryLazy', - -- dependencies = { - -- 'MunifTanjim/nui.nvim', - -- 'nvim-lua/plenary.nvim', - -- 'nvim-telescope/telescope.nvim' - -- }, - -- config = true, - -- }, + { 'zbirenbaum/copilot.lua', event = 'InsertEnter', config = get_config('copilot') }, + { 'zbirenbaum/copilot-cmp', config = true }, }) -- general sane vim options diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index eeff2efa..08b6dbda 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -1,9 +1,6 @@ local cmp = require('cmp') cmp.setup({ - completion = { - keyword_length = 2, - }, snippet = { expand = function(args) vim.fn['vsnip#anonymous'](args.body) @@ -13,7 +10,7 @@ cmp.setup({ [''] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ - -- { name = 'copilot' }, + { name = 'copilot' }, { name = 'nvim_lsp' }, { name = 'buffer', @@ -30,7 +27,7 @@ cmp.setup({ formatting = { format = function(entry, vim_item) vim_item.menu = ({ - -- copilot = '[Copilot]', + copilot = '[Copilot]', nvim_lsp = '[LSP]', buffer = '[Buffer]', path = '[Path]', diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua index ace85f6e..696d4cca 100644 --- a/nvim/lua/plugins/copilot.lua +++ b/nvim/lua/plugins/copilot.lua @@ -1,4 +1,4 @@ require('copilot').setup({ - suggestion = { enabled = true }, - panel = { enabled = true }, + suggestion = { enabled = false }, + panel = { enabled = false }, })