mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: add keymap to toggle treesitter context
This commit is contained in:
parent
7fe68d9f05
commit
8014928cbf
1 changed files with 17 additions and 0 deletions
|
|
@ -110,6 +110,23 @@ return {
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
opts = { mode = "cursor" },
|
opts = { mode = "cursor" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>ut",
|
||||||
|
function()
|
||||||
|
local Util = require("lazy.core.util")
|
||||||
|
require("treesitter-context").toggle()
|
||||||
|
if require("treesitter-context.config").enable then
|
||||||
|
require("treesitter-context.config").enable = false
|
||||||
|
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||||
|
else
|
||||||
|
require("treesitter-context.config").enable = true
|
||||||
|
Util.info("Enabled Treesitter Context", { title = "Option" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Toggle Treesitter Context",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Automatically add closing tags for HTML and JSX
|
-- Automatically add closing tags for HTML and JSX
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue