feat(snacks): use toggle

This commit is contained in:
Folke Lemaitre 2024-11-05 00:21:08 +01:00
parent a3070f3c08
commit 8ffbc98161
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
7 changed files with 58 additions and 208 deletions

View file

@ -108,7 +108,7 @@ return {
ft = { "markdown", "norg", "rmd", "org" },
config = function(_, opts)
require("render-markdown").setup(opts)
LazyVim.toggle.map("<leader>um", {
Snacks.toggle({
name = "Render Markdown",
get = function()
return require("render-markdown.state").enabled
@ -121,7 +121,7 @@ return {
m.disable()
end
end,
})
}):map("<leader>um")
end,
},
}

View file

@ -21,7 +21,7 @@ return {
end,
})
LazyVim.toggle.map("<leader>ua", {
Snacks.toggle({
name = "Mini Animate",
get = function()
return not vim.g.minianimate_disable
@ -29,7 +29,7 @@ return {
set = function(state)
vim.g.minianimate_disable = not state
end,
})
}):map("<leader>ua")
local animate = require("mini.animate")
return {

View file

@ -4,8 +4,7 @@ return {
event = "VeryLazy",
opts = function()
local tsc = require("treesitter-context")
LazyVim.toggle.map("<leader>ut", {
Snacks.toggle({
name = "Treesitter Context",
get = tsc.enabled,
set = function(state)
@ -15,8 +14,7 @@ return {
tsc.disable()
end
end,
})
}):map("<leader>ut")
return { mode = "cursor", max_lines = 3 }
end,
}