Add control to most command to send them to 1-layer-nested tmux session

This commit is contained in:
Wryn (yage) Wagner 2023-01-09 11:39:00 -07:00
parent 095cff65b2
commit f121122c56

View File

@ -10,6 +10,7 @@ set -g default-terminal "tmux-256color"
# force utf-8
setw -gq utf8 on
set-option -gw xterm-keys on
# force vi
set-window-option -g mode-keys vi
@ -27,19 +28,29 @@ set -g status-right "#(cat /sys/class/power_supply/BAT0/capacity)% | #[fg=magnet
#####################################################################
# pane switch with vim-like controls
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-h select-pane -L
bind -n C-M-h send-keys C-b Left
bind -n M-j select-pane -D
bind -n C-M-j send-keys C-b Down
bind -n M-k select-pane -U
bind -n C-M-k send-keys C-b Up
bind -n M-l select-pane -R
bind -n C-M-l send-keys C-b Right
bind -n M-H resize-pane -L 2
bind -n M-J resize-pane -D 2
bind -n M-K resize-pane -U 2
bind -n M-L resize-pane -R 2
bind -n M-H resize-pane -L 2
bind -n C-Left send-keys C-b C-Left
bind -n M-J resize-pane -D 2
bind -n C-Down send-keys C-b C-Down
bind -n M-K resize-pane -U 2
bind -n C-Up send-keys C-b C-Up
bind -n M-L resize-pane -R 2
bind -n C-Right send-keys C-b C-Right
# alt tab for window shift
bind-key -n M-Tab next-window
bind-key -n M-Tab next-window
bind-key -n M-n send-keys C-b n
bind-key -n M-BTab previous-window
bind-key -n M-p send-keys C-b p
# alt number for switch
bind-key -n M-1 select-window -t 0
@ -53,24 +64,31 @@ bind-key -n M-8 select-window -t 7
bind-key -n M-9 select-window -t 8
# new window and split pane quickly
bind-key -n M-c new-window
bind-key -n M-Enter new-window
bind-key -n M-v split-window -v
bind-key -n M-b split-window -h
bind-key -n M-q killp
bind-key -n M-z resize-pane -Z
bind-key -n M-c send-keys C-b c
bind-key -n M-v split-window -v
bind-key -n C-M-v send-keys M-v
bind-key -n M-b split-window -h
bind-key -n C-M-b send-keys M-b
bind-key -n M-q killp
bind-key -n C-M-q send-keys M-q
bind-key -n M-z resize-pane -Z
bind-key -n C-M-z send-keys M-z
# nested session with meta-a
bind-key -n M-a send-prefix
# rena[M]e session
bind-key -n M-m command-prompt -I "#S" "rename-session '%%'"
bind-key -n C-M-m send-keys M-m
# rename [w]indow
bind-key -n M-w command-prompt -I "#W" "rename-window '%%'"
bind-key -n C-M-w send-keys M-w
# toggle readonly session
bind-key -n M-r switch-client -r;
bind-key -n M-r switch-client -r
bind-key -n C-M-r send-keys M-r
#####################################################################