mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(scope): allow user to disable keys
This commit is contained in:
parent
bc0630e43b
commit
07f6f79d2d
1 changed files with 10 additions and 6 deletions
|
@ -774,14 +774,18 @@ end
|
|||
function M.setup()
|
||||
local keys = Snacks.config.get("scope", defaults).keys
|
||||
for key, opts in pairs(keys.textobject) do
|
||||
vim.keymap.set({ "x", "o" }, key, function()
|
||||
M.textobject(opts)
|
||||
end, { silent = true, desc = opts.desc })
|
||||
if opts then
|
||||
vim.keymap.set({ "x", "o" }, key, function()
|
||||
M.textobject(opts)
|
||||
end, { silent = true, desc = opts.desc })
|
||||
end
|
||||
end
|
||||
for key, opts in pairs(keys.jump) do
|
||||
vim.keymap.set({ "n", "x", "o" }, key, function()
|
||||
M.jump(opts)
|
||||
end, { silent = true, desc = opts.desc })
|
||||
if opts then
|
||||
vim.keymap.set({ "n", "x", "o" }, key, function()
|
||||
M.jump(opts)
|
||||
end, { silent = true, desc = opts.desc })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue