diff --git a/lua/completion.lua b/lua/completion.lua index f4f25a6..1b2aaac 100644 --- a/lua/completion.lua +++ b/lua/completion.lua @@ -2,12 +2,19 @@ vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } vim.opt.shortmess:append 'c' local lspkind = require 'lspkind' -lspkind.init {} +lspkind.init { + symbol_map = { + Copilot = '', + }, + mode = 'symbol', +} +vim.api.nvim_set_hl(0, 'CmpItemKindCopilot', { fg = '#6CC644' }) local cmp = require 'cmp' cmp.setup { sources = { + { name = 'copilot' }, { name = 'luasnip' }, { name = 'nvim_lsp' }, { name = 'path' }, diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index c7c7ea0..aa00392 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -11,6 +11,7 @@ return { { 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' }, 'saadparwaiz1/cmp_luasnip', 'rafamadriz/friendly-snippets', + 'zbirenbaum/copilot-cmp', }, config = function() require 'completion' diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..81bb3eb --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,17 @@ +return { + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + }, + }, + { + 'zbirenbaum/copilot-cmp', + config = function() + require('copilot_cmp').setup() + end, + }, +}