68 lines
2.3 KiB
Bash
68 lines
2.3 KiB
Bash
# server options
|
|
set -s escape-time 0
|
|
|
|
# terminal
|
|
set -g default-terminal "tmux-256color"
|
|
set -ga terminal-overrides ",xterm-ghostty:RGB,xterm-256color:RGB"
|
|
set -ga terminal-features ",xterm-ghostty:clipboard,xterm-256color:clipboard"
|
|
set -g set-clipboard on
|
|
set -g allow-passthrough on
|
|
|
|
# general
|
|
set -g prefix C-s
|
|
set -g base-index 1
|
|
set -g focus-events on
|
|
set -g update-environment "SSH_AUTH_SOCK SSH_CONNECTION SSH_TTY DISPLAY"
|
|
# when a session dies under the client (e.g. a failed ssh in tmux-ssher) go to
|
|
# the most recently used session instead of detaching. not "previous": that
|
|
# path crashes the whole server on 3.7b+ (tmux issue 5344, fixed after 3.7c)
|
|
set -g detach-on-destroy off
|
|
|
|
# status bar
|
|
set -g status-style 'bg=default fg=default'
|
|
set -g status-left-length 20
|
|
|
|
# window options
|
|
set -wg mode-keys vi
|
|
set -g pane-base-index 1
|
|
set -g renumber-windows on
|
|
|
|
# prefix
|
|
unbind C-b
|
|
|
|
# copy mode
|
|
bind -T copy-mode-vi v send-keys -X begin-selection
|
|
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
|
|
|
|
# navigation
|
|
bind ^ last-window
|
|
bind k select-pane -U
|
|
bind j select-pane -D
|
|
bind h select-pane -L
|
|
bind l select-pane -R
|
|
|
|
# windows and panes: inside an ssh session (@ssh_host set by tmux-ssher) new
|
|
# panes open on the same host over the multiplexed connection.
|
|
# new-window/split-window do not expand formats in their command, run-shell does
|
|
bind c if-shell -F "#{@ssh_host}" 'run-shell "tmux new-window -t \"#{session_name}\" -n \"#{@ssh_host}\" \"ssh #{@ssh_host}\""' "new-window"
|
|
bind '"' if-shell -F "#{@ssh_host}" 'run-shell "tmux split-window -v -t \"#{pane_id}\" \"ssh #{@ssh_host}\""' "split-window -v"
|
|
bind % if-shell -F "#{@ssh_host}" 'run-shell "tmux split-window -h -t \"#{pane_id}\" \"ssh #{@ssh_host}\""' "split-window -h"
|
|
|
|
# reload
|
|
bind r source-file "$XDG_CONFIG_HOME/tmux/tmux.conf"
|
|
|
|
# sessionizer
|
|
bind f run-shell "tmux neww ~/.config/tmux/scripts/tmux-sessionizer"
|
|
bind R run-shell "tmux neww ~/.config/tmux/scripts/tmux-sessionizer ~"
|
|
bind g run-shell "tmux neww ~/.config/tmux/scripts/tmux-sessionizer ~/.config"
|
|
bind T run-shell "tmux neww ~/.config/tmux/scripts/tmux-sessionizer ~/temp"
|
|
|
|
# clone
|
|
bind G run-shell "tmux neww ~/.config/tmux/scripts/tmux-ggclone"
|
|
|
|
# ssh
|
|
bind F run-shell "tmux neww ~/.config/tmux/scripts/tmux-ssher"
|
|
|
|
# project
|
|
bind N run-shell "tmux neww ~/.config/tmux/scripts/tmux-new-project"
|