From 540b5b0c7223e02969c51401fe1de1c2aa808a0c Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sun, 5 Nov 2023 18:09:41 +0000 Subject: [PATCH] feat(vim): finally commit the copilot config I have been using this for quite a while now. This add the copilot plugin and the intergration with nvim-cmp --- modules/nvim.lua | 2 ++ site-modules/core/files/vim/plugin/completion.lua | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/modules/nvim.lua b/modules/nvim.lua index 0518df0..2846a2e 100644 --- a/modules/nvim.lua +++ b/modules/nvim.lua @@ -49,6 +49,8 @@ local start_plugins = { ["vim-rhubarb"] = { url = "https://github.com/tpope/vim-rhubarb.git" }, ["conjure"] = { url = "https://github.com/Olical/conjure.git" }, ["cmp-cmdline"] = { url = "https://github.com/hrsh7th/cmp-cmdline.git", revision = "main" }, + ["copilot"] = { url = "https://github.com/zbirenbaum/copilot.lua.git" }, + ["copilot-cmp"] = { url = "https://github.com/zbirenbaum/copilot-cmp.git" }, } local opt_plugins = { diff --git a/site-modules/core/files/vim/plugin/completion.lua b/site-modules/core/files/vim/plugin/completion.lua index b1671f5..0411b75 100644 --- a/site-modules/core/files/vim/plugin/completion.lua +++ b/site-modules/core/files/vim/plugin/completion.lua @@ -1,6 +1,14 @@ local cmp = require'cmp' local luasnip = require'luasnip' +require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, +}) + +require("copilot_cmp").setup() + + local icons = { Text = "", Method = "", @@ -55,6 +63,7 @@ cmp.setup({ }), sources = { { name = "luasnip" }, + { name = "copilot" }, { name = 'nvim_lsp' }, { name = 'buffer' }, { name = 'path' },