# minimal tmux config # history set -g history-limit 100000 # mouse set -g mouse on set -s set-clipboard on set -g allow-passthrough on # utf8 / colors set -g default-terminal "tmux-256color" set -as terminal-overrides ",*:Tc" set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' set -g extended-keys on set -as terminal-features 'xterm*:extkeys' # 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" # alt+arrow pane switching bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D # alt+[ / alt+] pane switching (prev/next) bind -n M-[ select-pane -t :.- bind -n M-] select-pane -t :.+ # swap windows left/right with PgUp/PgDn (no wrap) bind-key -n PgUp if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | head -1) ]" "swap-window -t -1\; select-window -t -1" bind-key -n PgDn if-shell "[ #{window_index} -ne $(tmux list-windows -F '##{window_index}' | tail -1) ]" "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 set -g detach-on-destroy off # Auto-rename windows: directory/process set -g automatic-rename on set -g automatic-rename-format '#{pane_current_command}@#{b:pane_current_path}#{?pane_title,: #{pane_title},}' # Rename window (prefix + R) bind R command-prompt -I "#{window_name}" "rename-window '%%'" # Move window to session (prefix + M), creates session if needed bind M run-shell 'tmux display-popup -E "tmux-move-to-session #{window_id}"' # Fuzzy window switcher (prefix + f) bind f display-popup -h 80% -E "tmux list-windows -F '#{window_index}: #{window_name}' | fzf --reverse --height=100% | cut -d: -f1 | xargs tmux select-window -t" # status bar set -g status-style "bg=#262626,fg=#a8a8a8" set -g status-left "#[fg=#080808,bg=#00af00,bold]#S#[fg=#00af00,bg=#262626,nobold]" set -g status-left-length 30 set -g status-right "" set -g status-right-length 40 # window tabs setw -g window-status-format "#{?#{m:*[13579],#{window_index}},#[fg=#262626]#[bg=#282828]#[fg=#848484] #I #W #[fg=#282828]#[bg=#262626],#[fg=#262626]#[bg=#1e1e1e]#[fg=#747474] #I #W #[fg=#1e1e1e]#[bg=#262626]}" setw -g window-status-current-format "#[fg=#262626,bg=#00af00]#[fg=#080808,bg=#00af00,bold] #I #W #[fg=#00af00,bg=#262626]" setw -g window-status-separator "" # pane borders set -g pane-border-style "fg=#444444" set -g pane-active-border-style "fg=#00af00"