copilot como fonte do lsp

This commit is contained in:
serxoz 2024-02-28 12:13:52 +01:00
parent 9e21d634a4
commit 095d157420
3 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,4 @@
require('copilot').setup({
suggestion = { enabled = false },
panel = { enabled = false },
})

View File

@ -35,8 +35,36 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil
-- cmp.setup({
-- mapping = cmp_mappings,
-- sources = {
-- -- Copilot sources
-- { name = 'copilot' },
-- -- Other sources
-- { name = 'nvim_lsp' },
-- { name = 'buffer' },
-- { name = 'path' },
-- { name = 'calc' },
-- { name = 'emoji' },
-- { name = 'treesitter' },
-- { name = 'vsnip' },
-- }
-- })
lsp.setup_nvim_cmp({
mapping = cmp_mappings
mapping = cmp_mappings,
sources = {
-- Copilot sources
{ name = 'copilot' },
-- Other sources
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'calc' },
{ name = 'emoji' },
{ name = 'treesitter' },
{ name = 'vsnip' },
}
})
lsp.set_preferences({

View File

@ -60,7 +60,14 @@ return require('packer').startup(function(use)
}
use("folke/zen-mode.nvim")
use("github/copilot.vim")
use("zbirenbaum/copilot.lua")
use {
"zbirenbaum/copilot-cmp",
after = { "copilot.lua" },
config = function ()
require("copilot_cmp").setup()
end
}
use("CopilotC-Nvim/CopilotChat.nvim")
use("eandrju/cellular-automaton.nvim")
-- use("laytan/cloak.nvim")