Files
dotfiles/.tmux.conf
2026-02-09 00:21:58 +01:00

41 lines
1.3 KiB
Bash

# minimal tmux config
# history
set -g history-limit 100000
# mouse
set -g mouse on
# utf8 / colors
set -g default-terminal "screen-256color"
set -q -g status-utf8 on
setw -q -g utf8 on
# panes retain path
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# shift+arrow window switching (no wrap)
bind -n S-Left if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | head -1) ]" "previous-window"
bind -n S-Right if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | tail -1) ]" "next-window"
# swap windows left/right with Ctrl+Shift+Arrow
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
# sensible defaults
set -s escape-time 10
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Auto-rename windows: directory/process
set -g automatic-rename on
set -g automatic-rename-format '#{pane_current_command}@#{b:pane_current_path}'
# Rename window (prefix + R)
bind R command-prompt -I "#{window_name}" "rename-window '%%'"
# Fuzzy window switcher (prefix + f)
bind f display-popup -E "tmux list-windows -F '#{window_index}: #{window_name}' | fzf --reverse | cut -d: -f1 | xargs tmux select-window -t"