tmux 工具使用,終端分屏

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

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章