Skip to content

Commit

Permalink
update tmux pane management
Browse files Browse the repository at this point in the history
  • Loading branch information
wongsingfo committed Jan 26, 2024
1 parent e47444e commit 1304797
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions stow-dotfiles/tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,43 @@ bind C-s send-prefix -2
#
# Use <prefix>:q to select pane by number

bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
# Use 'q'+number to select pane. Use ; to move the last selected pane.
# bind k select-pane -U
# bind j select-pane -D
# bind h select-pane -L
# bind l select-pane -R

# The default key-binding for 'last-window' is 'l'. We change it to 'o',
# because we have bound 'l' to 'select-pane'.
bind o last-window
# bind o last-window

bind -r K resize-pane -U 5
bind -r J resize-pane -D 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# The default key-binding is M-Left, M-Right, M-Up, M-Down.
# bind -r K resize-pane -U 5
# bind -r J resize-pane -D 5
# bind -r H resize-pane -L 5
# bind -r L resize-pane -R 5

# https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
bind -r C-h swap-window -t -1\; select-window -t -1
bind -r C-l swap-window -t +1\; select-window -t +1
bind -r H swap-window -t -1\; select-window -t -1
bind -r L swap-window -t +1\; select-window -t +1

# current pane full screen toggle
bind o resize-pane -Z
# Maximize the current pane
bind _ if-shell -F '#{==:#{PANE_VERTICAL},true}' {
resize-pane -y 70%
setenv -g PANE_VERTICAL false
} {
resize-pane -y 100%
setenv -g PANE_VERTICAL true
}
bind | if-shell -F '#{==:#{PANE_HORIZONTAL},true}' {
resize-pane -x 70%
setenv -g PANE_HORIZONTAL false
} {
resize-pane -x 100%
setenv -g PANE_HORIZONTAL true
}

# Join the last active pane to the current window
bind W "join-pane -s !"
Expand Down

0 comments on commit 1304797

Please sign in to comment.