6个快捷键2步激活:herdr-annotate按键配置从零上手教程

原创2026-11-01 19:52:061,692 阅读

6个快捷键2步激活:herdr-annotate按键配置从零上手教程

herdr-annotate 是 Herdr 终端环境里的批注插件:选中终端里的任意文本写批注、审阅 Markdown 文档和 AI Agent 的回复,再把反馈一键发回给 Agent。全文只需掌握 6 个快捷键,跟着 2 步激活流程(安装插件 → 绑定按键)走一遍,零基础也能快速上手终端批注。

herdr-annotate 终端批注插件横幅图:在 Herdr 中注释终端选中文本并回传给 Agent


一、herdr-annotate 是什么?为什么需要它?

日常用终端跑 AI Agent(Claude Code、Codex、Copilot CLI 等)时,经常会想:

  • 终端滚过去的一大段输出里,某几行有问题,怎么精准指给 Agent?
  • Agent 刚输出的方案文档,想逐条批注后再让它修改?
  • 写好的反馈想攒一批,统一作为上下文发给 Agent?

herdr-annotate 就是解决这类需求的:

能力 说明
📌 终端批注 选中终端文本,弹出评论框写批注
📋 批量回传 所有批注自动转成结构化 Markdown 上下文
📄 文档审阅 Full 版集成 plannotator-tui,审阅文档和 Agent 回复
🏷️ 归档管理 批注可存档、恢复、删除,管理面板一目了然

💡 它没有需要单独安装的运行环境,插件会下载一个小巧的预构建二进制并校验 SHA-256。

项目主清单可参考:herdr-plugin.toml,Lite 精简版清单在:lite/herdr-plugin.toml。


二、先选版本:Full 还是 Lite?

安装前先花 10 秒选对版本(两者插件 id 相同,后续安装另一个会自动替换):

版本 适合人群 快捷键数量
Full(默认) 想同时批注终端文本 + 审阅文档/Agent 回复 6 + 3
Lite 只需要终端批注,轻量够用 6
Windows Full(预览) Windows 11 用户,需 Herdr ≥ 0.9.0 同 Full

安装命令(二选一):

# Full 版(推荐)
herdr plugin install plannotator/herdr-annotate

# Lite 版
herdr plugin install plannotator/herdr-annotate/lite

⚠️ 环境要求:Herdr 0.8.0 及以上,支持 macOS / Linux / Windows。Linux 上若要用剪贴板功能,请提前装好 wl-clipboard、xclip 或 xsel 之一。


三、6个快捷键速查表(先混个脸熟)

herdr-annotate 的所有操作都挂在 Herdr 的 prefix 键(默认 Ctrl+B)之后。核心 6 键如下:

快捷键 命令 作用 一句话记忆
Ctrl+B A annotate.capture 对选中文本写批注 ✍️ 写批注
Ctrl+B Shift+A annotate.copy-context 复制全部批注为 Markdown 📋 只复制
Ctrl+B Ctrl+A annotate.copy-archive 复制全部批注并归档 📋 复制+归档
Ctrl+B Ctrl+V annotate.paste-archive 粘贴到当前 Agent 输入框(不发送)并归档 📥 贴入不发送
Ctrl+B Ctrl+S annotate.send-archive 直接作为 Agent 的下一条消息发送并归档 🚀 发送
Ctrl+B M annotate.manage 打开批注管理面板 🗂️ 管理

管理面板里的二级按键

打开 Ctrl+B M 管理面板后,常用按键:

  • e:编辑选中的批注(Ctrl+S 保存,Esc 取消)
  • y:复制单条 · c:复制全部 · Shift+C:复制并归档
  • Tab:进入归档视图(y 复制 · u 恢复 · d d 删除)
  • q:关闭面板

批注列表默认**按写入顺序(最旧在前)**排列,Agent 读到的反馈顺序和你批注的顺序完全一致。


四、2步激活:从安装到按键生效

Step 1|安装插件(约 1 分钟)

执行上面选好的安装命令即可,构建钩子会自动拉取预构建二进制:

herdr plugin install plannotator/herdr-annotate

想升级到最新 release?重新跑一遍同一条命令即可(安装会固定在它来源的 commit 上)。

Step 2|绑定快捷键 + 重载配置(关键一步)

这一步必须做:插件本身不抢占按键,你需要在 Herdr 的配置里声明这 6 个键绑定,然后用配置校验 + 重载命令激活。

在 Herdr 的配置文件中加入 [[keys.command]] 条目(Lite 版 6 条完整配置如下):

[[keys.command]]
key = "prefix+a"
type = "plugin_action"
command = "annotate.capture"
description = "annotate text"

[[keys.command]]
key = "prefix+shift+a"
type = "plugin_action"
command = "annotate.copy-context"
description = "copy annotations as context"

[[keys.command]]
key = "prefix+ctrl+a"
type = "plugin_action"
command = "annotate.copy-archive"
description = "copy annotations as context and archive them"

[[keys.command]]
key = "prefix+ctrl+v"
type = "plugin_action"
command = "annotate.paste-archive"
description = "paste annotations into the agent's prompt and archive them"

[[keys.command]]
key = "prefix+ctrl+s"
type = "plugin_action"
command = "annotate.send-archive"
description = "send annotations to the agent and archive them"

[[keys.command]]
key = "prefix+m"
type = "plugin_action"
command = "annotate.manage"
description = "manage annotations"

最后两条命令,先检查再重载,确保配置无误后立即生效:

herdr config check
herdr server reload-config

✅ 到这一步,6 个快捷键全部激活!试着选中一段终端文本按 Ctrl+B A,批注弹框就会出现在眼前。


五、Full 版加餐:文档审阅三键

装了 Full 版的话,还有 3 个审阅快捷键值得绑定(由 plannotator-tui 驱动,支持 Claude Code、Codex、pi、Copilot CLI、OpenCode 等):

快捷键 命令 打开什么
Ctrl+B O annotate.open 当前文件夹的文件树审阅
Ctrl+B Shift+O annotate.last Agent 最近一条回复
Ctrl+B Ctrl+O annotate.last-newest Agent 最新回复(免选择直接开)

审阅界面里按 S 可以把审阅结果作为 Agent 的下一条消息发送并关闭,q 关闭。

小技巧:还有一个 annotate.terminal 动作(审阅当前面板最近 200 行终端输出)没有默认键,可自行绑定,例如 key = "prefix+t"。


六、新手避坑清单

问题 原因与解决
按了快捷键没反应 没做 Step 2 绑定,或绑定后没执行 herdr server reload-config 重载
Ctrl+B Ctrl+S 没发送 面板里没有已识别的运行中 Agent(或 Agent 正在启动/等待审批),插件会主动拒绝并保留批注
选中文本抓不到 插件读取的是 Herdr 复制到系统剪贴板的文本,无法读取 Neovim 等程序内部的选区;Neovim 用户可参考 README.md 的 mapping 方案
远程 SSH 场景选区丢失 服务器端配置 copy_on_select = false,并用 herdr plugin action invoke annotate.capture 远程触发,详见 README 的 "Remote sessions" 一节
旧版升级后 Ctrl+点击 链接不打开 md 文件 0.9.0 起该行为拆分为独立的 Links 附加插件,按需 herdr plugin install plannotator/herdr-annotate/links 装回

七、总结:30 秒回顾

  1. 装:herdr plugin install plannotator/herdr-annotate(Full)或加 /lite(Lite)
  2. 绑:在配置里写 6 个 [[keys.command]] 条目
  3. 验:herdr config check + herdr server reload-config
  4. 用:选中文本 → Ctrl+B A 写批注 → Ctrl+B Ctrl+S 一键回传 Agent

配置细节与全部命令定义都可以在 herdr-plugin.toml 中按 action 对应查看,Lite 版行为测试说明见 docs/lite-testing.md。装好这 6 个键,终端里的"指着说问题"时代就到来了 🎉

登录后查看全文
herdr-annotate