add copilot

This commit is contained in:
Thomas Ruoff
2024-09-20 07:54:46 +02:00
parent 4020b3de41
commit c190f92ee7
3 changed files with 26 additions and 1 deletions

View File

@@ -2,12 +2,19 @@ vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.shortmess:append 'c' vim.opt.shortmess:append 'c'
local lspkind = require 'lspkind' 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' local cmp = require 'cmp'
cmp.setup { cmp.setup {
sources = { sources = {
{ name = 'copilot' },
{ name = 'luasnip' }, { name = 'luasnip' },
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'path' }, { name = 'path' },

View File

@@ -11,6 +11,7 @@ return {
{ 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' }, { 'L3MON4D3/LuaSnip', build = 'make install_jsregexp' },
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
'zbirenbaum/copilot-cmp',
}, },
config = function() config = function()
require 'completion' require 'completion'

17
lua/plugins/copilot.lua Normal file
View File

@@ -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,
},
}