From 67ba58215b9122f4c422801c4af74412a8aa21d4 Mon Sep 17 00:00:00 2001 From: bitbird development Date: Fri, 8 Nov 2024 09:00:36 +0100 Subject: [PATCH] feat(toggle): add illuminate toggle for which-key (#4708) ## Description Adds a Toggle-Shortcut to enable/disable [Illuminate](https://github.com/RRethy/vim-illuminate) I dont think 'leader ux' is the right shortcut here. I just took the next free one. ![image](https://github.com/user-attachments/assets/65990e1b-f527-4691-8d2e-eee103695bff) --- 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..59aada0a 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) + Snacks.toggle({ + 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, + }):map("ux") + local function map(key, dir, buffer) vim.keymap.set("n", key, function() require("illuminate")["goto_" .. dir .. "_reference"](false)