初识
安装
bash
1 | apt install tmux |
使用
bash
1 | tmux # 打开tmux |
常用prefix指令
在tmux中输入^b
进入prefix模式,该模式下可以使用一些指令进行分屏等操作
c
创建新窗口%
竖向分屏"
垂直分屏0
,1
,2
,…,9
切换窗口- 方向键 切换分屏
w
显示窗口列表d
保存会话推出tmux
配置
在~/.tmux.conf
中添加配置,以下是一些常用的配置
plaintext
1 | # set -g prefix C-z |
美化 - tmux-powerline
安装tpm
bash
1 | git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm |
在~/.tmux.conf
中加入tpm的配置,并加入tmux-powerline插件
plaintext
1 | # List of plugins |
bash
1 | # type this in terminal if tmux is already running |
prefix
+I
在tmux中使用指令安装插件
tmux-powerline
配置
参考:https://github.com/erikw/tmux-powerline?tab=readme-ov-file#configuration
生成配置文件
bash
1 | ~/.tmux/plugins/tmux-powerline/generate_config.sh |
复制默认主题作为自己的主题
bash
1 | mkdir -p ~/.config/tmux-powerline/themes |
在配置文件中引用自己的主题
bash
1 | $EDITOR ~/.config/tmux-powerline/config.sh # TMUX_POWERLINE_THEME=my-theme |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 热爱生活!