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. 
This commit is contained in:

committed by
GitHub

parent
b841a1dfc3
commit
67ba58215b
@ -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("<leader>ux")
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
|
Reference in New Issue
Block a user