Files
2026-09-16 21:44:25 +08:00

107 lines
4.8 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# herdr 配置 —— 由 ~/.dotfile/tmux/.tmux.conf 映射而来
#
# 仓库内真实文件: ~/.dotfile/herdr/config.toml
# 由 script/herdr-init.sh 软链到: ~/.config/herdr/config.toml
#
# 校验: herdr config check
# 热重载: prefix+shift+r,或 herdr server reload-config
# 默认值: herdr --default-config
#
# 这里只写与 herdr 默认值不同(或需要显式强调)的键,未写到的沿用默认。
# 概念对照: tmux session → herdr workspace,tmux window → herdr tab,tmux pane → herdr pane
[keys]
# ---------------------------------------------------------------- 前缀
# tmux 里的 prefix 相关行都被注释掉了,所以沿用 ctrl+b(herdr 默认值,无需显式设置)
# prefix = "ctrl+b"
# tmux: bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
reload_config = "prefix+r" # herdr 默认是 prefix+shift+r
# ---------------------------------------------------------------- 分屏
# 按“分隔线的形状”对齐:
# | 是竖线 → 把 pane 切成左右
# - 是横线 → 把 pane 切成上下
# herdr 就是按分隔线形状命名的,而 tmux 的 -v/-h 按“排列方向”命名,所以二者相反:
# tmux splitw -v(上下堆叠)= 横线 = herdr split_horizontal(向下切)
# tmux splitw -h(左右并排)= 竖线 = herdr split_vertical (向右切)
# tmux: bind - splitw -v -c '#{pane_current_path}' → 切成上下
split_horizontal = "prefix+minus"
# tmux: bind | splitw -h -c '#{pane_current_path}' → 切成左右
split_vertical = "prefix+|"
# tmux 的 -c '#{pane_current_path}' 对应 [terminal] new_cwd = "follow"(默认值)
# ---------------------------------------------------------------- pane 切换
# 注释写的是“绑定 hjkl 键为面板切换”,其中 h/l 两行被注释掉了,这里按原意启用
focus_pane_left = "prefix+h"
focus_pane_down = "prefix+j"
focus_pane_up = "prefix+k"
focus_pane_right = "prefix+l"
# tmux: bind -r K/J/H/L resizep -U/-D/-L/-R 10
# herdr 可直接绑定 resize,不必先进入 resize mode;步长不可配(tmux 那边是 10 格)
resize_pane_up = "prefix+shift+k"
resize_pane_down = "prefix+shift+j"
resize_pane_left = "prefix+shift+h"
# 注: tmux 里 prefix+shift+l 被后面的 `bind L switch-client -l` 覆盖,此处留给“回上一个”
# 向右 resize 用 prefix+r 进 resize mode,或在此写回 "prefix+shift+l"
# tmux: bind L switch-client -l (注释写“返回上一个窗口”)
previous_tab = "prefix+shift+l"
# 想要真正的“来回切换”(不按顺序),可改为 last_pane = "prefix+shift+l"
# tmux: bind M command-prompt -p "插入窗口到位置:" "move-window -b -t ':%%'"
# herdr 没有“输入索引插入”这种交互,改成相邻平移
move_tab_previous = "alt+shift+left"
move_tab_next = "alt+shift+right"
# ---------------------------------------------------------------- 复制模式
# tmux: setw -g mode-keys vi(tmux 默认用 prefix+[ 进入 copy mode)
# herdr 0.8.2 支持 copy_mode 键(未写进 --default-config,但 herdr config check 认可)
copy_mode = "prefix+["
# tmux 里没有的: 把 scrollback 丢给 $EDITOR(herdr 默认 prefix+e)
# edit_scrollback = "prefix+e"
# ---------------------------------------------------------------- 故意不复刻的 tmux 绑定
# tmux: bind -r j select-pane -t .+1 \; resize-pane -Z
# 它覆盖了上面的 `bind j select-pane -D`,含义是“切到下一个 pane 且每次都 toggle zoom”,
# 语义含糊,不复刻。循环切换用 herdr 默认的 prefix+tab / prefix+shift+tab,
# zoom 用 prefix+z。
# tmux: bind m (切换鼠标模式)
# herdr 没有鼠标开关的运行时按键: 行为由 [ui] mouse_capture 决定,
# 运行时可开 prefix+s(设置)面板调整。
# herdr 自带、tmux 那边靠插件实现的能力(均为默认键):
# prefix+w workspace picker(≈ tmux-fzf)
# prefix+g goto
# prefix+? 列出所有有效绑定
[terminal]
# tmux 新建 pane/window 都带 -c '#{pane_current_path}'
new_cwd = "follow"
[ui]
# tmux: set -g mouse on
mouse_capture = true
# tmux: set -s set-clipboard on
copy_on_select = true
# tmux: set-titles on / set-titles-string "#{session_name}"
window_title = "{workspace}"
# tmux: automatic-rename on(窗口名跟随当前目录)→ 关掉 herdr 的新 tab 命名询问
prompt_new_tab_name = false
# tmux 风格: 只要内部分隔线,不要外面那圈边框
pane_outer_borders = false
# tmux: set -as terminal-features ",*:osc9" + allow-passthrough,让外层终端弹通知
# herdr 直接把 pane 里的通知转发给外层终端(Ghostty)
[ui.toast]
delivery = "terminal"
[session]
# 近似替代 tmux-resurrect 的会话恢复
# (原生会话恢复需要对应 agent 装了 herdr integration,如 herdr integration install claude)
resume_agents_on_restore = true
[experimental]
# 近似替代 tmux-resurrect 的 scrollback 恢复: 重启 server 后保留 pane 屏幕历史
pane_history = true