-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mini-pairs): add toggle function #1456
Conversation
Couldn't we just do the following return {
{
"echasnovski/mini.pairs",
keys = {
{
"<leader>up",
function()
local Util = require("lazy.core.util")
vim.g.minipairs_disable = not vim.g.minipairs_disable
if not vim.g.minipairs_disable then
Util.info("Enabled auto pairs", { title = "Option" })
else
Util.warn("Disabled auto pairs", { title = "Option" })
end
end,
desc = "Toggle mini.pairs",
},
},
},
}
Why introduce new code of other plugins in |
This is pretty much what I was thinking of too. The mapping and function can all be part of the plugin spec. |
Ok, I updated the keymap to be in the spec. I also switched the enabled/disabled logic and remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Only other improvement I can think of is a more descriptive title than "Option"
, but it's minor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks fine. In case you're not aware, you'll have to wait until folke (the maintainer of LazyVim) returns from vacation for any additional feedback, and to get this merged.
thansk! |
Add function and keymap to toggle mini pairs.