add: keybinding mirroring the default ctrl-b o

This commit is contained in:
Jabir Ali Ouassou 2024-05-15 17:53:37 +02:00
parent 5a6316a340
commit d51f7a9d1e
2 changed files with 5 additions and 1 deletions

View file

@ -107,6 +107,7 @@ while a "pane" is what `i3wm` would call a "window" and `vim` would call a "spli
| <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>0</kbd>-<kbd>9</kbd> | Move pane to workspace 0-9 | | <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>0</kbd>-<kbd>9</kbd> | Move pane to workspace 0-9 |
| <kbd>Alt</kbd> + <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd> | Move focus left/down/up/right | | <kbd>Alt</kbd> + <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd> | Move focus left/down/up/right |
| <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd> | Move pane left/down/up/right | | <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><kbd>l</kbd> | Move pane left/down/up/right |
| <kbd>Alt</kbd> + <kbd>o</kbd> | Move focus to next pane |
| <kbd>Alt</kbd> + <kbd>Enter</kbd> | Create a new pane at "the end" of the current layout | | <kbd>Alt</kbd> + <kbd>Enter</kbd> | Create a new pane at "the end" of the current layout |
| <kbd>Alt</kbd> + <kbd>s</kbd> | Switch to layout: split then vsplit | | <kbd>Alt</kbd> + <kbd>s</kbd> | Switch to layout: split then vsplit |
| <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | Switch to layout: only split | | <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>s</kbd> | Switch to layout: only split |

View file

@ -15,7 +15,7 @@
# shellcheck disable=SC2250 # shellcheck disable=SC2250
# Check input parameters {{{ # Check input parameters {{{
# Whether we need to use legacy workarounds (required before tmux 2.7). # Whether we need to use legacy workarounds (required before Tmux 2.7).
legacy="$(tmux -V | grep -E 'tmux (1\.|2\.[0-6])')" legacy="$(tmux -V | grep -E 'tmux (1\.|2\.[0-6])')"
# Read user options. # Read user options.
@ -166,6 +166,9 @@ else
tmux $bind "${mod}r" run-shell 'tmux select-layout'\\\; send escape tmux $bind "${mod}r" run-shell 'tmux select-layout'\\\; send escape
fi fi
# Switch pane via Alt + o. (Mirrors Tmux `Ctrl-b o` and Emacs `Ctrl-x o`.)
tmux $bind "${mod}o" select-pane -t :.+1
# Switch to pane via Alt + hjkl. # Switch to pane via Alt + hjkl.
tmux $bind "${mod}${h}" select-pane -L tmux $bind "${mod}${h}" select-pane -L
tmux $bind "${mod}${j}" select-pane -D tmux $bind "${mod}${j}" select-pane -D