-
Notifications
You must be signed in to change notification settings - Fork 161
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
Feature request: unmatched sequence "pass-through" behaviour #248
Comments
Thanks for filing the issue! I've thought about this in the past but never got around to it, so this gave me a reason to look at it again. You can test this out in #249, can read the documentation here. |
Cool! I tried out
I want to respect your maintainership so I'd like to explicitly state that I have no expectations of a specific outcome from this ticket, I'm only stating my hopes and dreams! I respect whatever implementation you decide is best. Thank you for sharing your efforts. Full config, in case it's useful:
|
Maybe this config change could work for you, with no change to the kanata code:
Let me know how that goes. |
I could also easily make the change so that sending sequence leader again when sequence mode is already active will not reset the sequence. Edit: I've pushed this change |
The suggestion you made:
had some slightly funky behaviour- I think pressing
There's only one little thing that doesn't behave basically exactly as I'd want: once I enter the sequence, if I hold a "modifier key" (e.g.
I would expect the sequence to be exited and Thanks for working closely with me here, it's been great. |
This was not too hard to fix, just required me to remove a line of code haha. I think the latest push should do the trick, let me know if it does when you can. |
Perfect. Don't know what to say. Really cool, thank you! Let me know if there's some way I can buy you a coffee or a beer or something! |
I appreciate the thought! I'm intentionally not accepting any form of funding for kanata right now, so all good on that front. |
Is your feature request related to a problem? Please describe.
When a sequence is not "matched", i.e.
sequence-timeout
expires, or a non-sequence key is pressed, Kanata swallows the typed keys.Describe the solution you'd like
I would like Kanata to (optionally, perhaps) emit non-matched or timed-out sequence key presses.
The implementation notes on sequences (#97) describe them as being vim-like, but make an explicit carve-out for non-leaf sequence. I use the sequence "fd" to exit insert mode in vim, and I'm trying to map it to
esc
globally in Kanata. In Vim, when the sequence is not "matched", eithertimeoutlen
(in Kanata,sequence-timeout
) expires, or a non-sequence key is pressed, the unmapped part of the sequence is emitted.Describe alternatives you've considered
It's possible to mostly achieve this behaviour by mapping all possible subsequent keys into the sequence, see e.g.: https://github.com/partiallyordered/dotfiles/blob/d0082ced7d5b2efc9ceab7cacfd7954b924d5e1e/xps.kanata.s#L44-L162 . For my purposes, this has the shortcoming that when I want to type just
f
(which is a frequent occurrence because of vim keybindings elsewhere!), I must holdf
, instead of waiting forsequence-timeout
.It's also possible to mostly achieve this by defining a "sequence" layer, in this example called
f-layer
: https://github.com/partiallyordered/dotfiles/blob/679c733d007f3cd52f916003307f516ac83c1b1f/xps.kanata.s#L16 . Then defining each key in that layer to execute a macro, with the exception of the "sequence": https://github.com/partiallyordered/dotfiles/blob/679c733d007f3cd52f916003307f516ac83c1b1f/xps.kanata.s#L74 . This has the shortcoming that in order to emit an f character, one must typef-something
, e.g.fa
, then backspace over the second emitted character.Additional context
None
The text was updated successfully, but these errors were encountered: