tmux配置文件.tmux.conf (tmux 2.6)
本文是基于tmux 2.6进行的配置,使用tmux -V可查看版本
下面是配置文件内容,在家目录下创建.tmux.conf,并粘贴下面内容保存后,进入tmux, ctrl+b,然后输入命令:source-file ~/.tmux.conf 即可(或 在bash下执行tmux source ~/.tmux.conf)。
因为下面的命令中,bind了r作为source-file ~/.tmux.conf,所以在输入ctrl+b之后输入 r即可 reloaded
设置完成后,可参照 https://www.cnblogs.com/zhchy89/p/10058005.html 设置懒人启动脚本,以便每次在启动terminal的时候执行命令,直接进入切分好的窗口。
#将r 设置为加载配置文件,并显示"reloaded!"信息
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Use Shift-arrow keys to switch panes
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# Alt-arrow to switch windows
bind -n M-Left previous-window
bind -n M-Right next-window
#Enable mouse mode (tmux 2.1 and above)
setw -g mouse on
set -g mouse on
#Enable oh my zsh in tmux
set -g default-command /bin/zsh
# Mouse based copy
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
#开启status-bar uft-8支持
set -g status-utf8 on
#设置终端颜色为256色
set -g default-terminal "screen-256color"
#开启status-bar uft-8支持
set -g status-utf8 on
#设置pan前景色
set -g pane-border-fg green
#设置pane背景色
set -g pane-border-bg black
#设置活跃pane前景色
set -g pane-active-border-fg white
#设置活跃pane背景色
set -g pane-active-border-bg yellow
#设置消息前景色
set -g message-fg white
#设置消息背景色
set -g message-bg black
#设置消息高亮显示
set -g message-attr bright
#设置status-bar颜色
set -g status-fg white
set -g status-bg black
#设置窗口列表颜色
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
#设置当前窗口在status bar中的颜色
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
#设置status bar格式
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-right "#[fg=cyan]%b %d %R"
set -g status-interval 60
set -g status-justify centre
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具