mirror of
https://github.com/tmux/tmux.git
synced 2026-07-09 02:49:30 +00:00
Restore { and } to swap-pane and for floating panes and use a separate
key table accessed by g (short for "gove and/or gesize") for floating
panes. So "C-b g Up" moves the pane to top-centre, "C-b g M-Up" moves
and resizes it. This means we not only do not lose the surprisingly
popular { and } bindings, but we can have more than four keys for moving
and resizing panes.
This commit is contained in:
@@ -410,10 +410,8 @@ key_bindings_init(void)
|
||||
"bind -N 'Choose a window from a list' w { choose-tree -Zw }",
|
||||
"bind -N 'Kill the active pane' x { confirm-before -p\"kill-pane #P? (y/n)\" kill-pane }",
|
||||
"bind -N 'Zoom the active pane' z { resize-pane -Z }",
|
||||
"bind -N 'Move pane to top-left corner' '{' { resize-pane -x50% -y50%; move-pane -P top-left }",
|
||||
"bind -N 'Move pane to top-right corner' '}' { resize-pane -x50% -y50%; move-pane -P top-right }",
|
||||
"bind -N 'Move pane to bottom-left corner' 'M-{' { resize-pane -x50% -y50%; move-pane -P bottom-left }",
|
||||
"bind -N 'Move pane to bottom-right corner' 'M-}' { resize-pane -x50% -y50%; move-pane -P bottom-right }",
|
||||
"bind -N 'Swap the active pane with the pane above' '{' { swap-pane -U }",
|
||||
"bind -N 'Swap the active pane with the pane below' '}' { swap-pane -D }",
|
||||
"bind -N 'Show messages' '~' { show-messages }",
|
||||
"bind -N 'Enter copy mode and scroll up' PPage { copy-mode -u }",
|
||||
"bind -N 'Select the pane above the active pane' -r Up { select-pane -U }",
|
||||
@@ -444,6 +442,25 @@ key_bindings_init(void)
|
||||
"bind -N 'Resize the pane left' -r C-Left if -F '#{?floating_pane_flag}' { resizep -R-1 } { resize-pane -L }",
|
||||
"bind -N 'Resize the pane right' -r C-Right { resize-pane -R }",
|
||||
|
||||
/* Floating pane movement. */
|
||||
"bind -N 'Move a floating pane' g { switch-client -Tmove }",
|
||||
"bind -Tmove -N 'Move pane to top-left corner' 1 { move-pane -P top-left }",
|
||||
"bind -Tmove -N 'Move pane to top-right corner' 2 { move-pane -P top-right }",
|
||||
"bind -Tmove -N 'Move pane to bottom-left corner' 3 { move-pane -P bottom-left }",
|
||||
"bind -Tmove -N 'Move pane to bottom-right corner' 4 { move-pane -P bottom-right }",
|
||||
"bind -Tmove -N 'Move pane to top-left corner and resize' M-1 { resize-pane -x50% -y50%; move-pane -P top-left }",
|
||||
"bind -Tmove -N 'Move pane to top-right corner and resize' M-2 { resize-pane -x50% -y50%; move-pane -P top-right }",
|
||||
"bind -Tmove -N 'Move pane to bottom-left corner and resize' M-3 { resize-pane -x50% -y50%; move-pane -P bottom-left }",
|
||||
"bind -Tmove -N 'Move pane to bottom-right corner and resize' M-4 { resize-pane -x50% -y50%; move-pane -P bottom-right }",
|
||||
"bind -Tmove -N 'Move pane to top' 'Up' { move-pane -P top-centre }",
|
||||
"bind -Tmove -N 'Move pane to bottom' 'Down' { move-pane -P bottom-centre }",
|
||||
"bind -Tmove -N 'Move pane to left' 'Left' { move-pane -P centre-left }",
|
||||
"bind -Tmove -N 'Move pane to right' 'Right' { move-pane -P centre-right }",
|
||||
"bind -Tmove -N 'Move pane to top and resize' 'M-Up' { resizep -x100% -y50%; move-pane -P top-centre }",
|
||||
"bind -Tmove -N 'Move pane to bottom and resize' 'M-Down' { resizep -x100% -y50%; move-pane -P bottom-centre }",
|
||||
"bind -Tmove -N 'Move pane to left and resize' 'M-Left' { resizep -x50% -y100%; move-pane -P centre-left }",
|
||||
"bind -Tmove -N 'Move pane to right and reize' 'M-Right' { resizep -x50% -y100%; move-pane -P centre-right }",
|
||||
|
||||
/* Menu keys */
|
||||
"bind -N 'Display window menu' < { display-menu -xW -yW -T '#[align=centre]#{window_index}:#{window_name}' " DEFAULT_WINDOW_MENU " }",
|
||||
"bind -N 'Display pane menu' > { display-menu -xP -yP -T '#[align=centre]#{pane_index} (#{pane_id})' " DEFAULT_PANE_MENU " }",
|
||||
|
||||
12
tmux.1
12
tmux.1
@@ -363,13 +363,13 @@ Toggle zoom state of the current pane.
|
||||
.It Tab
|
||||
Choose a new window and session by fuzzy matching.
|
||||
.It {
|
||||
Move floating pane to top-left corner.
|
||||
Swap the current pane with the previous pane.
|
||||
.It }
|
||||
Move floating pane to top-right corner.
|
||||
.It M-{
|
||||
Move floating pane to bottom-left corner.
|
||||
.It M-}
|
||||
Move floating pane to bottom-right corner.
|
||||
Swap the current pane with the next pane.
|
||||
.It g 1, 2, 3, 4
|
||||
.It g Up, Down, Left, Right
|
||||
Move floating pane to corners or edges.
|
||||
Meta resizes the pane as well.
|
||||
.It \[ti]
|
||||
Show previous messages from
|
||||
.Nm ,
|
||||
|
||||
Reference in New Issue
Block a user