Minimalistic Configuration Guide for tmux
What is tmux?
tmux is a terminal multiplexer.
Why use it?
tmux lets you have multiple windows and panes inside a single terminal session. Think of it like a web browser — one window, multiple tabs.
How do I install it?
On most distros, just use your package manager to install the package named tmux.
Create the tmux config directory:
mkdir ~/.config/tmux
Create the config files:
touch ~/.config/tmux/keymaps.conf ~/.config/tmux/options.conf ~/.config/tmux/tmux.con
Only tmux.conf is required, but splitting the config into separate files makes it easier to read and modify.
Now that the directory and files are created, we can start configuring tmux.
tmux.conf
This file just sources the other two:
# source files
source-file ~/.config/tmux/keymaps.conf
source-file ~/.config/tmux/options.conf
options.conf
This file holds the general settings for tmux:
# change indexing to be more human-readable
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# color config
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*:RGB"
# clipboard
set -g set-clipboard on
# enable status bar
set -g status "on"
# status bar config
set -g status-justify "left"
set-option -g status-position top
keymaps.conf
This file holds all the keybindings (shortcuts) for tmux:
# unbind default keymaps
unbind -n Left
unbind -n Right
unbind -n Up
unbind -n Down
unbind C-b
unbind %
unbind '"'
unbind r
# set prefix to Alt+b
set -g prefix M-b
bind-key M-b send-prefix
# open/close windows
bind -n M-t new-window -c "#{pane_current_path}"
bind -n M-w kill-pane
bind -n M-q kill-window
# open panes
bind -n M-r split-window -h -c "#{pane_current_path}"
bind -n M-f split-window -v -c "#{pane_current_path}"
# reload config
bind -n M-R source-file $HOME/.config/tmux/tmux.conf
# pane movement
bind -n M-Left select-pane -L
bind -n M-Down select-pane -D
bind -n M-Up select-pane -U
bind -n M-Right select-pane -R
# Alt+number window selection
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
Now that tmux is configured, here's a summary of what each file does.
options.conf
The status bar is enabled — it shows your current window and other open windows, with the hostname, time, and date on the right side.
Window indexing starts at 1 instead of 0, which makes navigation more comfortable.
Clipboard integration is enabled, and color profiles are configured for proper terminal color support.
keymaps.conf
All default tmux keybindings are unbound, and the prefix key is changed from Ctrl+b to Alt+b.
To open a new window, press Alt+t. To close a window, press Alt+q.
To open a pane in the current window, press Alt+r for a vertical split or Alt+f for a horizontal split.
To reload the config, press Alt+R (i.e. Alt+Shift+r).
To move between panes, hold Alt and use the arrow keys.
To switch windows, press Alt and a number key.