Skip to content

Tmux 使用指南

Tmux Demo

This guide recommends using the popular Oh My Tmux! configuration for a powerful and user-friendly Tmux experience.

To install this configuration:

Terminal window
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

The configuration is split into two files:

  • ~/.tmux.conf: The main configuration file (do not edit this).
  • ~/.tmux.conf.local: Your local customizations (edit this file).

Add the following to your ~/.tmux.conf.local to improve usability:

Terminal window
# Increase history size
set -g history-limit 50000
# Change prefix key to Backtick (`)
unbind C-b
set -g prefix `
bind ` send-prefix
# Move status line to top
set -g status-position top
# Enable mouse mode (optional)
set -g mouse on

Here are some useful key bindings (assuming default prefix C-b or your custom prefix):

KeyAction
Prefix + cCreate new window
Prefix + nNext window
Prefix + pPrevious window
Prefix + %Split window vertically
Prefix + "Split window horizontally
Prefix + zToggle zoom pane
Prefix + [Enter copy mode
Prefix + rReload configuration
  • Status Bar: Informative status bar with CPU, memory, and battery usage.
  • Navigation: Vim-like pane navigation (h, j, k, l).
  • Copy Mode: Enhanced copy mode with system clipboard integration.

For more details, refer to the official repository.