Timeline

2025-10-20

init


tmux Installation

1
2
3
4
sudo pacman -Sy tmux

# Start
tmux

If using WSL, you can configure it to start tmux on launch by appending -- tmux to the command line options in the Archlinux settings.

tmux Configuration

Install tpm:

1
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Configuration file ~/.tmux.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Set prefix key to Ctrl+q
unbind C-b
set -g prefix C-q
bind C-q send-prefix

# Mouse support (click to switch panes/windows)
set -g mouse on
# Let tmux properly forward extended keys to Emacs.
set -g xterm-keys on
set -g default-terminal "tmux-256color"
set -g renumber-windows on
set -g base-index 1 # Set window starting index to 1
set -g pane-base-index 1 # Set pane starting index to 1

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'


set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @catppuccin_flavor 'mocha'
# set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_text "#W"
set -g @catppuccin_window_current_text "#W"

# Make the status line pretty and add some modules
set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""

# set -g status-right "#{E:@catppuccin_status_session}"
set -g status-right "#{E:@catppuccin_status_uptime}"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Then press C-q I to download the plugins.

Common Shortcuts

Session Management

Command/Shortcut Description
tmux new -s <name> Create a new session named name
Ctrl+q d Detach current session (continues in background)
tmux ls List all sessions
tmux attach -t <name> Reattach to a specified session
Ctrl+q $ Rename current session
Ctrl+q s Switch session

Window Management

Command/Shortcut Description
Ctrl+q c Create new window
Ctrl+q & Close current window
Ctrl+q n Switch to next window
Ctrl+q p Switch to previous window
Ctrl+q <number> Switch to window by number
Ctrl+q , Rename current window

Pane Management

Command/Shortcut Description
Ctrl+q % Split vertically
Ctrl+q " Split horizontally
Ctrl+q <arrow> Move focus between panes
Ctrl+q x Close current pane
Ctrl+q z Maximize/restore current pane
Ctrl+q Space Switch pane layout

History

In tmux, “history mode” is copy-mode. Once entered, you can:

  • Use arrow keys to scroll through history (arrows or C-p C-n)
  • Use mouse wheel to scroll

Press:
Ctrl + b [