From cf05586a0064515595203ba502f719a3d52c7be4 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Tue, 1 Apr 2025 20:27:10 +0000 Subject: [PATCH] added copilot to cmp --- lua/plugins/cmp.lua | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index e3b3973..23f0632 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -10,38 +10,18 @@ return { 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'onsails/lspkind.nvim', + 'zbirenbaum/copilot-cmp', }, config = function() local cmp = require('cmp') local lspkind = require('lspkind') + lspkind.init({ + symbol_map = { + Copilot = '', + }, + }) + require('copilot_cmp').setup() - local kind_icons = { - Text = '', - Method = '󰆧', - Function = '󰊕', - Constructor = '', - Field = '󰇽', - Variable = '󰂡', - Class = '󰠱', - Interface = '', - Module = '', - Property = '󰜢', - Unit = '', - Value = '󰎠', - Enum = '', - Keyword = '󰌋', - Snippet = '', - Color = '󰏘', - File = '󰈙', - Reference = '', - Folder = '󰉋', - EnumMember = '', - Constant = '󰏿', - Struct = '', - Event = '', - Operator = '󰆕', - TypeParameter = '󰅲', - } cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine @@ -61,9 +41,9 @@ return { [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ + { name = 'copilot' }, { name = 'nvim_lsp' }, { name = 'luasnip' }, -- For luasnip users. - }, { { name = 'buffer' }, }), formatting = {