Skip to content

Commit e9e6811

Browse files
committed
move in readme
1 parent 4057e8d commit e9e6811

1 file changed

Lines changed: 13 additions & 32 deletions

File tree

README.md

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Integrate the [opencode](https://github.com/sst/opencode) AI assistant with Neov
4848
vim.keymap.set({ "n", "x" }, "go", function() return require("opencode").operator("@this ") end, { desc = "Add range to opencode", expr = true })
4949
vim.keymap.set("n", "goo", function() return require("opencode").operator("@this ") .. "_" end, { desc = "Add line to opencode", expr = true })
5050

51-
-- The default <C-u>/<C-d> keymaps will work in the normal mode but it is possible to scroll opencode from any buffer:
5251
vim.keymap.set("n", "<S-C-u>", function() require("opencode").command("session.half.page.up") end, { desc = "Scroll opencode up" })
5352
vim.keymap.set("n", "<S-C-d>", function() require("opencode").command("session.half.page.down") end, { desc = "Scroll opencode down" })
5453

@@ -108,37 +107,6 @@ Select or reference prompts to review, explain, and improve your code:
108107
| `review` | Review `@this` for correctness and readability |
109108
| `test` | Add tests for `@this` |
110109

111-
### Keymaps
112-
113-
`opencode.nvim` sets these buffer-local keymaps in opencode terminal buffers by default:
114-
115-
| Keymap | Command | Description |
116-
| ------- | ------------------------ | ---------------------------- |
117-
| `<C-u>` | `session.half.page.up` | Scroll up half page |
118-
| `<C-d>` | `session.half.page.down` | Scroll down half page |
119-
| `<Esc>` | `session.interrupt` | Interrup (same as esc press) |
120-
| `gg` | `session.first` | Go to first message |
121-
| `G` | `session.last` | Go to last message |
122-
123-
You can customize or disable these keymaps:
124-
125-
```lua
126-
vim.g.opencode_opts = {
127-
-- Customize keymaps
128-
keymaps = {
129-
n = {
130-
["<C-u>"] = { "session.half.page.up", desc = "Scroll up" },
131-
["<C-d>"] = { "session.half.page.down", desc = "Scroll down" },
132-
["gg"] = false, -- Disable this keymap
133-
-- Add custom keymaps
134-
["<C-n>"] = { "session.new", desc = "New session" },
135-
},
136-
},
137-
-- Or disable all default keymaps
138-
-- keymaps = false,
139-
}
140-
```
141-
142110
### Provider
143111

144112
You can manually run `opencode` inside Neovim's CWD however you like and `opencode.nvim` will find it!
@@ -276,6 +244,19 @@ vim.g.opencode_opts = {
276244

277245
Please submit PRs adding new providers! 🙂
278246

247+
#### Keymaps
248+
249+
`opencode.nvim` sets these buffer-local keymaps in provider terminals for Neovim-like message navigation:
250+
251+
| Keymap | Command | Description |
252+
| ------- | ------------------------ | ---------------------------- |
253+
| `<C-u>` | `session.half.page.up` | Scroll up half page |
254+
| `<C-d>` | `session.half.page.down` | Scroll down half page |
255+
| `<Esc>` | `session.interrupt` | Interrup (same as esc press) |
256+
| `gg` | `session.first` | Go to first message |
257+
| `G` | `session.last` | Go to last message |
258+
259+
279260
## 🚀 Usage
280261

281262
### ✍️ Ask — `require("opencode").ask()`

0 commit comments

Comments
 (0)