From 6678af37ee3100882b4c08451fa8aaa37e37fd69 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 13:59:51 +0200 Subject: [PATCH] fix(copilot-chat): no need to schedule which-key keys. just use default --- .../plugins/extras/coding/copilot-chat.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 090ade0c..7e636b65 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -50,13 +50,6 @@ return { mode = { "n", "v" }, }, }, - init = function() - LazyVim.on_load("which-key.nvim", function() - vim.schedule(function() - require("which-key").register({ a = { name = "+ai" } }, { prefix = "" }) - end) - end) - end, config = function(_, opts) local chat = require("CopilotChat") require("CopilotChat.integrations.cmp").setup() @@ -73,6 +66,16 @@ return { end, }, + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { + ["a"] = { name = "+ai" }, + }, + }, + }, + -- Telescope integration { "nvim-telescope/telescope.nvim",