opencode-scroll-mode 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,42 @@
2
2
 
3
3
  OpenCode TUI 的「对话滚动模式」插件:一键切换编辑 / 滚动两种状态,滚动时支持 vim 键位、消息搜索与 visual 选区复制。
4
4
 
5
+ ## 安装
6
+
7
+ ### npm(推荐)
8
+
9
+ ```sh
10
+ opencode plugin add opencode-scroll-mode
11
+ ```
12
+
13
+ `opencode plugin add` 会从 npm 安装并写入全局 `opencode.json(c)` 的 `plugins`。也可以锁定版本:
14
+
15
+ ```sh
16
+ opencode plugin add opencode-scroll-mode@0.3.3
17
+ ```
18
+
19
+ 升级 / 移除:
20
+
21
+ ```sh
22
+ opencode plugin update opencode-scroll-mode
23
+ opencode plugin remove opencode-scroll-mode
24
+ ```
25
+
26
+ ### 手动配置
27
+
28
+ 在 `opencode.json(c)` 的 `plugins` 中加入包名,OpenCode 会在启动时自动安装缺失的 npm 包:
29
+
30
+ ```jsonc
31
+ {
32
+ "$schema": "https://opencode.ai/config.json",
33
+ "plugins": ["opencode-scroll-mode"]
34
+ }
35
+ ```
36
+
37
+ > 本插件同时包含 server 与 TUI 入口,因此配置在 `opencode.json(c)`;只含 TUI 的插件才放在 `cli.json`。
38
+ >
39
+ > 如果不使用 npm 包,也可以把插件目录放在自动加载路径(如 `~/.config/opencode/plugins/scroll-mode/`),无需再写进 `plugins`。
40
+
5
41
  ## 功能
6
42
 
7
43
  - `ctrl+[`(默认,可用 `toggleKey` 配置)在「编辑模式」与「滚动模式」之间切换。
@@ -80,13 +116,13 @@ yank 后写入系统剪贴板:优先 **OSC52**(iTerm2 需在设置里允许
80
116
 
81
117
  ## 配置
82
118
 
83
- 放在自动加载目录(如 `~/.config/opencode/plugins/scroll-mode/`)即生效。若需传参数,在 `opencode.json` 的 `plugins` 中显式列出:
119
+ 传参数时使用 `plugins` 的对象形式;`package` 可以是 npm 包名,也可以是本地插件目录(本地目录若已在自动加载路径中,则二选一,避免重复加载):
84
120
 
85
121
  ```jsonc
86
122
  {
87
123
  "plugins": [
88
124
  {
89
- "package": "./plugins-src/scroll-mode",
125
+ "package": "opencode-scroll-mode",
90
126
  "options": {
91
127
  "vim": true,
92
128
  "search": true,
@@ -120,8 +156,6 @@ yank 后写入系统剪贴板:优先 **OSC52**(iTerm2 需在设置里允许
120
156
  > - `ctrl+[` 在多数终端里和 `Esc` 发送同一个字节(`0x1b`):只有终端开启 **kitty keyboard 协议**(kitty / WezTerm / Ghostty / 新版 iTerm2)时才能被识别成独立的 `Ctrl+[`;跑在 Neovim `:terminal` / sidekick.nvim 里时它就是纯 `Esc`,不会触发切换。
121
157
  > - 如果在你的环境里 `ctrl+[` 没反应,改用 `"toggleKey": "f9"`(nvim / 终端都不拦截)最稳。
122
158
 
123
- > 提示:同一目录若既位于自动加载的 `plugins/` 下、又在 `plugins` 中显式列出,可能被加载两次。二选一。
124
-
125
159
  ## 结构
126
160
 
127
161
  - `index.ts` — 服务端入口(仅注册 id)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-scroll-mode",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "license": "MIT",
5
5
  "description": "OpenCode TUI scroll mode plugin — toggle edit/scroll states with vim keys, message search, and line-precise visual selection/copy",
6
6
  "type": "module",