2 files changed,
24 insertions(+),
7 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2025-02-19 15:21:44 +0200
Parent:
47b552b
jump to
| M | lazy-lock.json |
| M | lua/plugins/copilot.lua |
M
lazy-lock.json
@@ -1,4 +1,5 @@
{ + "CopilotChat.nvim": { "branch": "main", "commit": "dbce8a231d1ac72c68ce00b86b415c9304417102" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },@@ -15,7 +16,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "helpful.vim": { "branch": "master", "commit": "2778c123fffef922641b99995e192c016f37987e" }, "image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" }, - "lazy.nvim": { "branch": "main", "commit": "7527af40ddd4a93a02911be570b32609b9d4ea53" }, + "lazy.nvim": { "branch": "main", "commit": "f15a93907ddad3d9139aea465ae18336d87f5ce6" }, "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
M
lua/plugins/copilot.lua
@@ -1,4 +1,4 @@
-local enabled = false +local enabled = true ---@type LazySpec return {@@ -31,28 +31,44 @@ {
"CopilotC-Nvim/CopilotChat.nvim", dependencies = { "copilot.lua" }, enabled = enabled, - branch = "canary", cmd = { "CopilotChat" }, build = "make tiktoken", keys = { { "<leader>C", ":CopilotChat ", mode = { "n", "v" } }, }, + ---@module "CopilotChat" + ---@type CopilotChat.config opts = { + auto_insert_mode = true, mappings = { + ---@diagnostic disable-next-line: missing-fields reset = { insert = "<C-r>", normal = "<C-r>", }, + ---@diagnostic disable-next-line: missing-fields submit_prompt = { insert = "<C-CR>", }, + ---@diagnostic disable-next-line: missing-fields + show_help = { normal = "?" }, }, }, }, { - "zbirenbaum/copilot-cmp", - dependencies = { "copilot.lua", "nvim-cmp" }, - enabled = enabled, - opts = {}, + "nvim-cmp", + cond = enabled, + dependencies = { + { "zbirenbaum/copilot-cmp", config = true }, + "copilot.lua", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, 1, { + name = "copilot", + group_index = 2, + max_item_count = 3, + }) + end, }, }