1 安装:
sudo apt-get install tmux
可能会遇到问题,自行搜索解决
2 安装成功后
在~ 路径下创建文件 .tmux.conf
将下面内容拷贝到.tmux.conf文件中:
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# =====> TMUX display <=====
# use 256 colors
set -g default-terminal "screen-256color"
# use vi mode
setw -g mode-keys vi
# start window indexing at one instead of zero
set -g base-index 1
# auto reorder windows number
set-option -g renumber-windows on
# =====> TMUX key bindings <=====
# split window to two horizontal panes
# Ctrl+a then shift + |
bind | split-window -h
# split window to two vertical panes
# Ctrl+a then -
bind - split-window -v
# resize-pane with hjkl
# Ctrl+a then Ctrl+h
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
# select-pane with hjkl
# Ctrl+a then h
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# Ctrl+a then c :create anther
# Ctrl+a then p or n : select current or pre or next
# Ctrl+a then w :
# Ctrl+a then x :show down the current window
# Ctrl+a then d :show down the pane
就可以使用了
如何使用:
~$:tmux new -s basic 创建一个名叫“basic”
可参考上面.tmux.conf文档内容及命令使用方式 进行操作。
参考文献:
https://www.cnblogs.com/wsine/p/7631721.html
https://blog.csdn.net/sinat_36330809/article/details/80907284