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:

  1. ~/.tmux.conf (legacy)

  2. ~/.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

  1. Create a minimal tmux.conf

  2. Change the prefix key

  3. Reload the configuration

  4. Verify the new prefix works

# Your config:

Exercise 2.2: Custom Keybindings

  1. Bind | to split horizontally

  2. Bind - to split vertically

  3. Bind r to reload config

  4. Add a binding to quickly switch to last window

# Your bindings:

Exercise 2.3: Status Line Customization

  1. Change status line colors

  2. Add useful information (session name, window list)

  3. Add date/time to right side

  4. 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: _