-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
Can we get a one_shot
option at the key level?
#6536
Comments
There is no automatic way to do that no. But for a single key you could explicitly call PopKeyTable action after the wanted action to simulate the one-shot behavior ...
{ key = "a", action = act.Multiple { act.ActivateLastTab, act.PopKeyTable } }
... |
I see, so I could make a table It's still a lot of code for what it does. |
Yes, keep in mind you are in a Lua interpreter, you can always write functions to simplify recurring patterns in your config ;) |
How would that work for the "root table" |
I'm not sure what behavior you want with the root table, as those keys are always available anyway 🤔 |
Yeees, I am getting mixed up with another (technically unrelated) issue I have that also impacts the "openess" of tables. If I have That's the scenario I was thinking of. |
For anything slightly more complex that the default LEADER system (which predates the Key Tables system), I'd highly suggest you to make your own |
That's the direction I am currently working towards I think? config.keys = {
{
key = 'VoidSymbol',
action = action.ActivateKeyTable({ name = 'config_keys', one_shot = false }),
}
} And then cram everything in the For the |
Is your feature request related to a problem? Please describe.
I want to be able to keep a table "open" just like we can currently do with the
one_shot
option of wezterm.action.ActivateKeyTable, but at the key level.Currently, if I want a given key to not close the table, I have to make the entire table
one_shot
, or move that key to its own table, which is unwieldy.Describe the solution you'd like
Ideally something like this:
That would be way more flexible.
Describe alternatives you've considered
I considered moving the key to its own table, but as far as I can tell, that would mean lengthening my key sequence by one more character, which is inconvenient and less ergonomic. And it also adds a lot of boilerplate code.
Additional context
~
The text was updated successfully, but these errors were encountered: