Very restrictive triggers list #749
-
Hello, In the version 2, I only allowed my Leader key, I could not achieve the same thing with the v3. First the triggers is not documented in the help, so I am a bit unsure what I should set there. The former value does not work. I looked a bit into the code I tried to find where In the This discussion is not about asking for help. In the I am writing this for two things:
*: Progressively I will add more triggers. I love the plugin, I think it can be very comfortable to work with. Edit: Add my solution, with lazy table plugin definition. Interesting enouch, ---Disable unwanted triggers
---@param ctx {keys: string, mode: string, plugin?: string}
---@return boolean
local function disable_triggers(ctx)
return (ctx.mode ~= "n") or (string.len(ctx.keys) ~= 7) or (ctx.keys:sub(1, 7) ~= "<Space>")
end
plugin.opts = {
disable = { trigger = disable_triggers },
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Just set |
Beta Was this translation helpful? Give feedback.
That freeze is because you map
<leader>
yourself and wk doesn't know it's a trigger.Nothing I can do about that, so please don't open an issue.
There's probably ways to make it work, but I'm not going to support this.
You could look in making
opts.trigger
a function instead that only allows a trigger on<leader>
.That way wk will know it's a trigger and you won't have a loop.