added copilot to cmp

This commit is contained in:
Oliver Hartmann 2025-04-01 20:27:10 +00:00
parent e835520de0
commit cf05586a00

View File

@ -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 {
['<CR>'] = 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 = {