From cbcc636243c50831a53b4f0b4243d85c727f6ec1 Mon Sep 17 00:00:00 2001 From: bitbird development Date: Mon, 4 Nov 2024 16:42:36 +0100 Subject: [PATCH] add illuminate toggle for which-key --- lua/lazyvim/plugins/extras/editor/illuminate.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/illuminate.lua b/lua/lazyvim/plugins/extras/editor/illuminate.lua index d4f4bf89..ba8018ab 100644 --- a/lua/lazyvim/plugins/extras/editor/illuminate.lua +++ b/lua/lazyvim/plugins/extras/editor/illuminate.lua @@ -15,6 +15,21 @@ return { config = function(_, opts) require("illuminate").configure(opts) + LazyVim.toggle.map("ux", { + name = "Illuminate", + get = function() + return not require("illuminate.engine").is_paused() + end, + set = function(enabled) + local m = require("illuminate") + if enabled then + m.resume() + else + m.pause() + end + end, + }) + local function map(key, dir, buffer) vim.keymap.set("n", key, function() require("illuminate")["goto_" .. dir .. "_reference"](false)