Replies: 1 comment 8 replies
-
|
what if you bind the any key in the table to switch back to the table? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to create key bindings that can be enabled and disabled on entering/leaving a special mode in a way that other bindings for the prefix and root key tables work while this special mode is being enabled.
Here's a typical workflow example I'm thinking of:
Ctrl+h/j/k/lto navigating between panes in a mode that is deactivated by default.prefix + R.prefix + Ragain.After some research, I tried to implement this using key tables. I added this to my
.tmux.conf:In this (incomplete) implementation, in tmux 3.5 (running with Alacritty and Arch Linux), while the
LAYOUTtable is active, as soon as I press a key that is not defined in this table, this table is deactivated, so the bindings forCtrl+h/j/k/lare reset. Instead, I would like to keep these bindings on so everything else works as normal (and onlyCtrl+h/j/k/lare overridden) as long as I pressprefix + Rto exit the mode. (It's possible to do this in i3 and Sway.)As an alternative, I've managed to write a shell script that sets a user variable, and depending on its state, it manually creates and removes these bindings whenever this script is run:
My question is, is this the best way to create these bindings? Or are key tables the way to go? Can the code snippet(s) above be improved?
Beta Was this translation helpful? Give feedback.
All reactions