Chapter 2: Configuring tmux
Chapter Overview
Topics covered:
-
Introducing the .tmux.conf File
-
Customizing Keys, Commands, and User Input
-
Changing How tmux Looks
-
Customizing the Status Line’s Content
Key Concepts
Config File Location
tmux looks for config in this order:
-
~/.tmux.conf(legacy) -
~/.config/tmux/tmux.conf(XDG - preferred)
Config Reload
# Reload config without restarting tmux
tmux source-file ~/.config/tmux/tmux.conf
Binding Syntax
# Basic binding
bind <key> <command>
# Binding with prefix
bind-key <key> <command>
# Binding without prefix (-n flag)
bind -n <key> <command>
# Unbind a key
unbind <key>
Configuration Sections
General Settings
# Settings from book:
Key Bindings
# Bindings from book:
Appearance
# Colors and styling from book:
Status Line
# Status line configuration from book:
Exercises
Exercise 2.1: Basic Configuration
-
Create a minimal tmux.conf
-
Change the prefix key
-
Reload the configuration
-
Verify the new prefix works
# Your config:
Exercise 2.2: Custom Keybindings
-
Bind
|to split horizontally -
Bind
-to split vertically -
Bind
rto reload config -
Add a binding to quickly switch to last window
# Your bindings:
Exercise 2.3: Status Line Customization
-
Change status line colors
-
Add useful information (session name, window list)
-
Add date/time to right side
-
Experiment with status-interval
# Your status line config:
Notes
Write your observations, insights, and questions here as you read.
Config Ideas
Settings from this chapter to include in quantum config:
# Ideas for dots-quantum/tmux/.config/tmux/tmux.conf
Comparison: Book vs Current Config
| Setting | Book Recommendation | Current tmux-config |
|---|---|---|
Prefix |
||
Split bindings |
||
Status line |
Chapter Completed
-
Read chapter
-
Completed exercises
-
Tested configurations
-
Noted config ideas
Date completed: _