快捷键从 Ctrl-b 改成 Ctrl-a, 手指按着就不费劲了
# Use Ctrl-a instead of Ctrl-b (screen-style)
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# general
set -g mouse on
set -g history-limit 100000
set -g base-index 1
setw -g pane-base-index 1
# fast reload
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# splits
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# pane navigation (vim-style)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes
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
# window
bind c new-window
bind n next-window
bind p previous-window
# copy mode (vim-like)
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
# status bar
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-left "#[fg=green]#S "
set -g status-right "#[fg=cyan]%Y-%m-%d %H:%M"
# performance
set -g focus-events on
set -g aggressive-resize on使用
tmux # new session
tmux new -s dev # named session
tmux ls
tmux attach -t dev