From b24efafbe1f7542f6ff0a21956c88044cccc3493 Mon Sep 17 00:00:00 2001
From: Parham Moieni
Date: Mon, 2 Oct 2023 20:35:03 +0330
Subject: [PATCH] fix duplicate which-key install
---
lua/lazyvim/plugins/editor.lua | 48 +++++++++++++++++++---------------
lua/lazyvim/plugins/ui.lua | 10 -------
2 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua
index 20b466fd..4d661e27 100644
--- a/lua/lazyvim/plugins/editor.lua
+++ b/lua/lazyvim/plugins/editor.lua
@@ -277,27 +277,33 @@ return {
{
"folke/which-key.nvim",
event = "VeryLazy",
- opts = {
- plugins = { spelling = true },
- defaults = {
- mode = { "n", "v" },
- ["g"] = { name = "+goto" },
- ["gz"] = { name = "+surround" },
- ["]"] = { name = "+next" },
- ["["] = { name = "+prev" },
- [""] = { name = "+tabs" },
- ["b"] = { name = "+buffer" },
- ["c"] = { name = "+code" },
- ["f"] = { name = "+file/find" },
- ["g"] = { name = "+git" },
- ["gh"] = { name = "+hunks" },
- ["q"] = { name = "+quit/session" },
- ["s"] = { name = "+search" },
- ["u"] = { name = "+ui" },
- ["w"] = { name = "+windows" },
- ["x"] = { name = "+diagnostics/quickfix" },
- },
- },
+ opts = function (_, opts)
+ if require("lazyvim.util").has("noice.nvim") then
+ opts.defaults["sn"] = { name = "+noice" }
+ end
+
+ return {
+ plugins = { spelling = true },
+ defaults = {
+ mode = { "n", "v" },
+ ["g"] = { name = "+goto" },
+ ["gz"] = { name = "+surround" },
+ ["]"] = { name = "+next" },
+ ["["] = { name = "+prev" },
+ [""] = { name = "+tabs" },
+ ["b"] = { name = "+buffer" },
+ ["c"] = { name = "+code" },
+ ["f"] = { name = "+file/find" },
+ ["g"] = { name = "+git" },
+ ["gh"] = { name = "+hunks" },
+ ["q"] = { name = "+quit/session" },
+ ["s"] = { name = "+search" },
+ ["u"] = { name = "+ui" },
+ ["w"] = { name = "+windows" },
+ ["x"] = { name = "+diagnostics/quickfix" },
+ },
+ }
+ end,
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua
index d8d6e181..9e60c849 100644
--- a/lua/lazyvim/plugins/ui.lua
+++ b/lua/lazyvim/plugins/ui.lua
@@ -224,16 +224,6 @@ return {
end,
},
- -- Displays a popup with possible key bindings of the command you started typing
- {
- "folke/which-key.nvim",
- opts = function(_, opts)
- if require("lazyvim.util").has("noice.nvim") then
- opts.defaults["sn"] = { name = "+noice" }
- end
- end,
- },
-
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
{
"folke/noice.nvim",