# ~/.tmux.conf -- see mercemay.top/src/dotfiles/
# Requires tmux 3.3+.
# ---- prefix -----------------------------------------------------------
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# ---- general ----------------------------------------------------------
set -g default-terminal "tmux-256color"
set -as terminal-features ",xterm-256color:RGB"
set -g history-limit 50000
set -g mouse on
set -g focus-events on
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -s escape-time 10
set -g display-time 2000
# ---- splits -----------------------------------------------------------
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# ---- pane navigation (vim-like) ---------------------------------------
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# ---- pane resize ------------------------------------------------------
bind -r H resize-pane -L 5
bind -r J resize-pane -D 3
bind -r K resize-pane -U 3
bind -r L resize-pane -R 5
# ---- copy-mode (vi) ---------------------------------------------------
setw -g mode-keys vi
bind [ copy-mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi V send -X select-line
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy || xclip -selection clipboard"
bind -T copy-mode-vi Escape send -X cancel
# ---- reload -----------------------------------------------------------
bind r source-file ~/.tmux.conf \; display "reloaded"
# ---- status line ------------------------------------------------------
set -g status-position top
set -g status-interval 5
set -g status-left-length 30
set -g status-right-length 60
set -g status-style "bg=default fg=white"
set -g status-left "#[fg=cyan,bold] #S "
set -g status-right "#[fg=white]%Y-%m-%d #[fg=green]%H:%M "
setw -g window-status-current-style "fg=black bg=cyan bold"