mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
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:
parent
b841a1dfc3
commit
67ba58215b
1 changed files with 15 additions and 0 deletions
|
@ -15,6 +15,21 @@ return {
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("illuminate").configure(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)
|
local function map(key, dir, buffer)
|
||||||
vim.keymap.set("n", key, function()
|
vim.keymap.set("n", key, function()
|
||||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue