Skip to content

Instantly share code, notes, and snippets.

@cerebrux
Forked from spicycode/tmux.conf
Last active June 7, 2025 22:41
Show Gist options
  • Save cerebrux/037721094593539ca9600599c4ebe81e to your computer and use it in GitHub Desktop.
Save cerebrux/037721094593539ca9600599c4ebe81e to your computer and use it in GitHub Desktop.
The best and greatest tmux.conf ever
##### GENERAL SETTINGS #####
# Start window numbering from 1 (instead of default 0)
set -g base-index 1
# Automatically rename window titles to reflect running commands
set -g automatic-rename on
# Allow tmux to set terminal title in your terminal emulator
set -g set-titles on
# Renumber windows sequentially after one is closed
set -g renumber-windows on
# Set the default terminal type for tmux (enables 256 colors)
set -g default-terminal "screen-256color"
# Increase command history buffer to 10,000 lines
set -g history-limit 10000
# Make Escape key response instant (useful for vi-mode users)
set -sg escape-time 0
# Duration (in ms) that pane indicators remain visible
set -g display-panes-time 800
# Duration (in ms) that status messages are displayed
set -g display-time 1000
# Use vi-style key bindings in status line and copy mode
set -g status-keys vi
setw -g mode-keys vi
# Clear screen and history when pressing Ctrl-L
bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history
# Enable mouse support (click to select pane, scroll, etc.)
set -g mouse on
# Redraw status line every 10 seconds (for dynamic stats)
set -g status-interval 10
# Monitor for activity in other windows
set -g monitor-activity on
# Disable visual bell when activity is detected
set -g visual-activity off
##### KEY BINDINGS #####
# Split the current pane vertically with `_` key
bind _ split-window -v
# Split the current pane horizontally with `|` key
bind | split-window -h
# Navigate to previous/next window using Shift + arrow keys
bind -n S-Left previous-window
bind -n S-Right next-window
# Reload this tmux config with `prefix + r` and show a message
bind r source-file ~/.tmux.conf \; display-message "tmux config reloaded!"
##### STATUS BAR THEME #####
# Set background and foreground color of the status bar
set -g status-bg black
set -g status-fg white
# Style for the currently active window: black text on white background
set -g window-status-current-style "fg=black,bg=white"
# Status line updates every 5 seconds
set -g status-interval 5
# Max length for the left side of the status bar
set -g status-left-length 130
# Left side of the status bar: display load average
set -g status-left '#[fg=yellow]#(uptime | sed "s/.*load average: //")#[default] #[fg=white]#[default]'
# Right side of the status bar: show session name and user
set -g status-right '#[fg=blue](#S) #(whoami)'
@sourman
Copy link

sourman commented Apr 3, 2025

Thanks for sharing

@cerebrux
Copy link
Author

cerebrux commented Apr 7, 2025

Thanks for sharing

glad it was usefull for you

@cerebrux
Copy link
Author

cerebrux commented Jun 7, 2025

Moved to dedicated and installable repository https://github.com/SynergOps/.tmux.
This gist will remain for historical reasons. Further updates will happen in the repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment