C.W.K.
Stream
Lesson 01 of 03 · published

Essential .tmux.conf Settings

~14 min · tmux, config, keybindings

Level 0Trapped
0 XP0/35 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Where the config lives

tmux reads ~/.tmux.conf at startup. To reload after edits without restarting, run tmux source-file ~/.tmux.conf from a shell, or bind it to a key (we will, below).

The first move: rebind the prefix

Ctrl-b is two finger jumps from the home row. Ctrl-a is right next to your left pinky. Most experienced tmux users rebind. The catch: Ctrl-a is also the start-of-line shortcut in bash/readline, so you'll need Ctrl-a a (or whatever you map) when you actually want start-of-line. Worth the trade.

The escape-time fix — critical for Vim

By default tmux waits a fraction of a second after Esc to see if you're starting an escape sequence (like an arrow key on legacy terminals). If you're a Vim user, that delay feels horrible — every Esc sticks. set -sg escape-time 0 eliminates it. Single most important tmux setting for Vim users.

The quality-of-life cluster

set -g base-index 1 + setw -g pane-base-index 1 make windows and panes start numbering at 1, matching the keyboard row. set -g renumber-windows on renumbers when one is killed so you don't end up with 1, 3, 7. set -g history-limit 50000 raises scrollback from the default 2000. set -g mouse on for click-to-focus and wheel-to-scroll. setw -g mode-keys vi for vi-style copy mode. set -g focus-events on so Vim's autoread works when you switch panes.

True-color and tmux 3.6 niceties

set -g default-terminal "tmux-256color" + set -ag terminal-overrides ",xterm-256color:RGB" enables 24-bit color so your Vim color scheme actually looks right inside tmux. tmux 3.6 (current as of 2026) added pane scrollbars: set -g pane-scrollbars on.

Better split bindings — and keeping the working directory

Bind | and - to split commands. Add -c "#{pane_current_path}" so the new pane opens in the current pane's working directory — an enormous quality-of-life win you'll feel immediately.

Vim-style pane navigation

Bind prefix + h/j/k/l to select-pane -L/-D/-U/-R so you navigate panes the way you navigate Vim splits. Track 7 introduces vim-tmux-navigator which removes the prefix + requirement entirely.

One config, all changes purposeful. Same lesson as Track 4: don't grab a 500-line config off the internet. Start with the 25-line block below; understand every line; add when you feel a pain point. tmux is small; your config can be small too.

Code

Reload .tmux.conf·bash
# From shell after editing
tmux source-file ~/.tmux.conf

# Or from inside tmux
prefix + :
source-file ~/.tmux.conf
The starter ~/.tmux.conf — paste this whole block·tmux
# ───────────── Prefix ─────────────
unbind C-b
set -g prefix C-a
bind C-a send-prefix     # press Ctrl-a twice to send a literal Ctrl-a

# ───────────── Reload binding ─────────────
bind r source-file ~/.tmux.conf \; display "Config reloaded"

# ───────────── Indexing ─────────────
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on

# ───────────── Behavior ─────────────
set -sg escape-time 0          # critical for Vim users
set -g history-limit 50000
set -g mouse on
setw -g mode-keys vi           # vi keys in copy mode
set -g focus-events on         # so Vim's autoread fires

# ───────────── Colors ─────────────
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"

# ───────────── Splits — | and - keep cwd ─────────────
unbind '"'
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

# ───────────── Vim-style pane navigation ─────────────
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Repeatable resize
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
Copy-mode keybindings — start/end selection like Vim·tmux
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel

External links

Exercise

Create or open ~/.tmux.conf. Paste the starter config above. From a shell, tmux kill-server to kill all running sessions, then tmux new -s test. Verify: (1) Ctrl-a is the new prefix, (2) prefix + | splits vertically and the new pane is in the same directory, (3) prefix + h/j/k/l moves between panes, (4) prefix + r reloads the config and prints "Config reloaded."

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.