Update tmux config

Add:
- Toggle popup window in a scratch session
- Send current pane to a window interactively
- Send current pane to new window
- Swap windows
This commit is contained in:
Alexander Navarro 2023-10-28 18:32:49 -03:00
parent 14e72656ee
commit 6fda168c66

View file

@ -14,6 +14,7 @@ bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"
# set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set -sg escape-time 0
set-option -g focus-events on
set-option -g renumber-windows on
## Keybindings
unbind C-b
@ -31,15 +32,26 @@ bind V copy-mode
# Panes
unbind v
unbind s
unbind D
unbind % # Split vertically
unbind '"' # Split horizontally
bind s split-window -h -c "#{pane_current_path}"
bind v split-window -v -c "#{pane_current_path}"
bind C-Space display-popup -w '80%' -h '80%' -E
bind D kill-pane
bind-key C-Space if-shell -F '#{==:#{session_name},scratch}' {
detach-client
} {
display-popup -w '80%' -h '80%' -d "#{pane_current_path}" -E "tmux new-session -A -s scratch"
}
bind -r m resize-pane -Z # maximize pane
bind-key M choose-window -Nwf"##{==:##{session_name},#{session_name}}" "join-pane -h -t '%%'" # Send pane to window
bind-key N break-pane # send current pane to new window
bind-key S command-prompt -p "Swap window with:" "swap-window -d -t '%%'" # send current pane to new window
# Windows
unbind r
unbind n