2 files changed,
17 insertions(+),
10 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-01-23 15:28:23 +0200
Parent:
42f5619
jump to
| M | lua/plugins/completion.lua |
| M | lua/plugins/copilot.lua |
M
lua/plugins/completion.lua
@@ -9,18 +9,15 @@ "hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp", { "hrsh7th/cmp-cmdline", keys = { ":" } }, { "kirasok/cmp-hledger", ft = "ledger" }, - { - "zbirenbaum/copilot-cmp", - dependencies = "copilot.lua", - enabled = true, - opts = {}, - }, }, config = function() local cmp = require "cmp" - local cmp_autopairs = require "nvim-autopairs.completion.cmp" + + cmp.event:on( + "confirm_done", + require("nvim-autopairs.completion.cmp").on_confirm_done() + ) - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) ---@diagnostic disable-next-line: missing-fields cmp.setup.filetype({ "gitcommit", "NeogitCommitMessage" }, { sources = { { name = "buffer" }, { name = "luasnip" } },@@ -73,7 +70,6 @@ Operator = "",
TypeParameter = "", Copilot = "", })[vim_item.kind] - return vim_item end, },@@ -102,7 +98,7 @@ end,
}, sources = cmp.config.sources { { name = "orgmode", group_index = 0, max_item_count = 3 }, - { name = "hledger" }, + { name = "hledger", group_index = 0 }, { name = "copilot", group_index = 2, max_item_count = 3 }, { name = "lazydev", group_index = 0 }, { name = "nvim_lsp", max_item_count = 12 },
M
lua/plugins/copilot.lua
@@ -1,7 +1,11 @@
+local enabled = false + ---@type LazySpec return { + enabled = enabled, { "zbirenbaum/copilot.lua", + enabled = enabled, cmd = "Copilot", build = ":Copilot auth", opts = {@@ -26,6 +30,7 @@
{ "CopilotC-Nvim/CopilotChat.nvim", dependencies = { "copilot.lua" }, + enabled = enabled, branch = "canary", cmd = { "CopilotChat" }, build = "make tiktoken",@@ -43,5 +48,11 @@ insert = "<C-CR>",
}, }, }, + }, + { + "zbirenbaum/copilot-cmp", + dependencies = { "copilot.lua", "nvim-cmp" }, + enabled = enabled, + opts = {}, }, }