Open wis opened 1 year ago
Any progress on this? I saw https://github.com/zellij-org/zellij/issues/3201 and https://github.com/zellij-org/zellij/issues/248 Cool idea about virtual modes. Cool idea about Leader key + sequences (Spacemacs, Astronvim approach). Let me explain my case:
Currently using tmux with backtick as the leader key. So backtick-c
sequence creates new tab, backtick-x
deletes tab, backtick-[
switches to copy mode, backtick-Esc
cancels the operation started. All these are not combinations but sequences and all of them operates with different input modes in your terminology (as it seems to me). So I want the sequence to do the proper job (e.g. create tab) or be canceled by Esc
and return back to the mode I called the sequence from. Sequences are widely used in Vim, Emacs, Spacemacs.
Instead of binding key sequences, we could achieve the same result with "custom modes". First we bind p
to enter a custom mode called "ModeP", then in that mode we can define "k" and "h" to their respective commands.
Additionally, we can apply a "backspace" keybinding to all modes to issue the hypothetical command "ReturnToLastMode" which will exit to the previous mode. Such a command implies that modes are maintained in a stack... So instead of having an unbounded stack-based mode system, we could opt to have "nested modes" where a mode can be nested in another mode and then we can have a command "GoToOuterMode" which will exit the current nested mode for the outer mode. Such a nested mode system could be complimented with some syntax to enter a nested mode deeply instead of always requiring nested modes be drilled down by commands. This flexibility could lead to a full state-machine with some contextual awareness via nesting.
here's my use case:
I want to be able to:
bind "ph" {}
/bind "pj" {}
/bind "pk" {}
/bind "pl" {}
to e.g. open a pane in that directiond
βw
to delete a word in Vimp
use the built-in pane mode that is entered withp
by default. but this is not optimal for ease of use or readability, and we only have a couple of built-in modes.Esc
).here's my basic config.kdl: