Skip to content

Instantly share code, notes, and snippets.

@mdalvi
Last active January 14, 2025 16:16
Show Gist options
  • Save mdalvi/9f1210733b21740792ac00ef4916f088 to your computer and use it in GitHub Desktop.
Save mdalvi/9f1210733b21740792ac00ef4916f088 to your computer and use it in GitHub Desktop.
tmux configuration
# Increase the scrollback buffer size from the default 2000 to 10000 lines
set-option -g history-limit 10000
# Disable automatic window renaming
set-option -g allow-rename off
# Make tmux use 256 colors for better color rendering in terminal applications
set -g default-terminal "screen-256color"
# Change the default prefix key from 'Ctrl-b' to 'Ctrl-a' (more ergonomic)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Start window numbering at 1 (easier to reach on keyboard)
set -g base-index 1
# Enable mouse support (works in tmux 2.1 and above)
set -g mouse on
# Start pane numbering at 1 to match window numbering
set -g pane-base-index 1
# Reload tmux configuration with 'prefix + r'
bind r source-file ~/.tmux.conf \; display "Configuration reloaded!"
# Switch panes using Alt-arrow without prefix (for quick navigation)
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
# Enable vi-style navigation in copy mode
setw -g mode-keys vi
# Status bar customization for better visibility
set -g status-style bg=black,fg=white
set -g window-status-current-style bg=white,fg=black,bold
# Increase the speed of repeating commands (useful for resizing panes)
set -g repeat-time 1000
# Set a longer display time for status messages
set -g display-time 2000
@mdalvi
Copy link
Author

mdalvi commented Jan 14, 2025

Save this configuration to your ~/.tmux.conf file

chmod 644 ~/.tmux.conf
tmux source-file ~/.tmux.conf

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