Files
dotfiles/config/shared/tmux
2026-02-25 16:39:30 +02:00

88 lines
2.3 KiB
Plaintext

##### Prefix #####
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
##### General #####
# set -s default-terminal "tmux-256color"
# set -sa terminal-overrides "$term:rgb"
set -g window-size largest
set -g aggressive-resize on
set -s escape-time 10
set -s focus-events on
set -s set-clipboard on
set -g allow-passthrough on
# set -g default-command "${SHELL}"
set -g base-index 1 # window index
set -g renumber-windows on # window index
set -g history-limit 10000
set -g repeat-time 0
set -g mouse on
set -g set-titles on
set -g set-titles-string "#S"
# set -g remain-on-exit on
set -gw pane-base-index 1 # pane index
##### Appearance #####
set -g status-style fg=black,bg=default
set -g window-status-current-style fg=blue,bold
set -g message-style fg=blue,bg=default
# set -g status-left "#[fg=blue,bold][#{s/^dev-//:#{session_name}}] "
set -g status-left "#[fg=blue,bold][#{s/^(dev-)?[0-9][0-9]_//:#{session_name}}] "
set -g status-right " #{?DF_IMAGE,#{DF_IMAGE} | ,}#{?DF_NAMESPACE,#{DF_NAMESPACE},#H}@#{?DF_PLATFORM,#{DF_PLATFORM},local}"
set -g status-left-length 50
set -g status-right-length 50
set -g pane-active-border-style fg=blue
##### Vim-like #####
set -gw mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi WheelUpPane send -N1 -X scroll-up
bind -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# Resize Opt/Alt-hjkl
bind -n M-h resize-pane -L 5
bind -n M-j resize-pane -D 5
bind -n M-k resize-pane -U 5
bind -n M-l resize-pane -R 5
# Last window instead of session
bind ';' last-window
# Open session
unbind '"'
unbind "%"
unbind s
unbind c
unbind n
unbind x
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# For some reason, choose-session is what I had before and it was working; however,
# it does not appear in man page and does not allow customization
# bind o choose-session
bind o choose-tree -Zs -O name
bind N new-window
bind n new-window -c "#{pane_current_path}"
bind c confirm-before -p "kill-pane \#P? (y/n)" kill-pane
##### Misc #####
bind r source-file ~/.tmux.conf \; display "Reloaded!"
unbind d
bind e detach
bind d command-prompt -I "flow " 'run-shell "/home/tomas/bin/dev-tmux-wrapper.sh %1 --from #{session_name}"'