Skip to content

Instantly share code, notes, and snippets.

@sdebnath
Last active October 2, 2025 04:56
Show Gist options
  • Select an option

  • Save sdebnath/5b601d6d63d31187f1ac228167a1014d to your computer and use it in GitHub Desktop.

Select an option

Save sdebnath/5b601d6d63d31187f1ac228167a1014d to your computer and use it in GitHub Desktop.
tmux.conf
#────────────────────────────────────────────────────────────────
#──── [0] Terminal & Colors
#────────────────────────────────────────────────────────────────
# Advertise a 256-color terminal (uncomment if needed).
# Many modern setups prefer "tmux-256color" in terminfo.
# set -g default-terminal "screen-256color"
# set -g default-terminal "tmux-256color"
# Enable truecolor (24-bit) in xterm-like terminals.
# (Appends to existing overrides rather than replacing them.)
set-option -sa terminal-overrides ",xterm*:Tc"
#────────────────────────────────────────────────────────────────
#──── [1] Core UX Defaults
#────────────────────────────────────────────────────────────────
# Enable mouse for pane/window selection, resizing, and scrollback.
set -g mouse on
# Start windows and panes at 1 (nicer for human counting).
set -g base-index 1
set -g pane-base-index 1
# Keep window numbers compact after closing one.
set -g renumber-windows on
# Make key-chord escape timeout short so tmux feels snappier.
set -sg escape-time 1
# Grow scrollback buffer so long command output is preserved.
set-option -g history-limit 99999
#────────────────────────────────────────────────────────────────
#──── [2] Prefix Key & Reload
#────────────────────────────────────────────────────────────────
# Swap the default prefix (C-b) for something less common: Ctrl-t.
unbind C-b
set -g prefix C-t
bind C-t send-prefix
# Quickly reload this config without leaving tmux.
bind r source-file ~/.tmux.conf \; display "Configuration reloaded"
#────────────────────────────────────────────────────────────────
#──── [3] Navigation (Panes & Windows) — No Prefix Needed
#────────────────────────────────────────────────────────────────
# Use Alt + Arrow keys to move between panes directly.
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
# Use Shift + Left/Right to move between windows directly.
bind -n S-Left previous-window
bind -n S-Right next-window
#────────────────────────────────────────────────────────────────
#──── [4] Splits — Keep New Panes in the Same Working Directory
#────────────────────────────────────────────────────────────────
# Vertical split (stacked). "split-window -v"
bind '"' split-window -v -c "#{pane_current_path}"
# Horizontal split (side-by-side). "split-window -h"
bind % split-window -h -c "#{pane_current_path}"
#────────────────────────────────────────────────────────────────
#──── [5] Copy Mode — Vi Keybindings
#────────────────────────────────────────────────────────────────
# Use vi-style keys inside copy mode.
set-window-option -g mode-keys vi
# Start selection with 'v', toggle rectangle with Ctrl-v,
# and yank (copy) selection with 'y' (then exit copy mode).
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
#────────────────────────────────────────────────────────────────
#──── [6] Status Bar Styling
#────────────────────────────────────────────────────────────────
# Simple colors for the status line.
set -g status-bg blue
set -g status-fg white
# (Modern equivalent would be:
# set -g status-style "bg=blue,fg=white"
# )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment