mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
feat(picker.keymaps): add global + buffer toggles (#705)
## Description This PR adds 2 actions to the `keymaps` picker, to toggle the `global` and `local` options. ## Related Issue(s) None. ## Screenshots https://github.com/user-attachments/assets/3f4ca80a-b554-47a2-970b-15dc84f357d8
This commit is contained in:
parent
24899315af
commit
b7c08df2b8
1 changed files with 18 additions and 0 deletions
|
@ -306,6 +306,24 @@ M.keymaps = {
|
|||
vim.api.nvim_input(item.item.lhs)
|
||||
end
|
||||
end,
|
||||
actions = {
|
||||
toggle_global = function(picker)
|
||||
picker.opts.global = not picker.opts.global
|
||||
picker:find()
|
||||
end,
|
||||
toggle_buffer = function(picker)
|
||||
picker.opts["local"] = not picker.opts["local"]
|
||||
picker:find()
|
||||
end,
|
||||
},
|
||||
win = {
|
||||
input = {
|
||||
keys = {
|
||||
["<a-g>"] = { "toggle_global", mode = { "n", "i" }, desc = "Toggle Global Keymaps" },
|
||||
["<a-b>"] = { "toggle_buffer", mode = { "n", "i" }, desc = "Toggle Buffer Keymaps" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Search lines in the current buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue