安裝 tmux
sudo apt install tmux
安裝 tmux 主題
cd ~
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
安裝 tmux 插件管理器
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
編輯配置文件 ~/.tmux.conf啥容,在文件末尾添加:
# Last saved environment is automatically restored when tmux is started
set -g mouse on
set -g @continuum-restore 'on'
# Tmux is automatically started after the computer/server is turned on
set -g @continuum-boot 'on'
# Set the saving interval to 60 (minutes)
set -g @continuum-save-interval '60'
# Restoring bash history
set -g @resurrect-save-bash-history 'on'
# This plugin enables saving and restoring tmux pane contents
set -g @resurrect-capture-pane-contents 'on'
# for vim to save the session
set -g @resurrect-strategy-vim 'session'
# for neovim to save the session
set -g @resurrect-strategy-nvim 'session'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
重新導入 tmux 配置環(huán)境
tmux
source ~/.tmux.conf
修改~/.bashrc 解決配色沖突
alias tmux="TERM=screen-256color-bce tmux"
安裝插件使配置文件生效
tmux new -s tmp # 創(chuàng)建一個 tmux 會話