|
10 | 10 | <img src="https://raw.githubusercontent.com/sst/opencode/dev/packages/web/src/assets/logo-ornate-dark.svg" alt="Opencode logo" width="30%" /> |
11 | 11 | </div> |
12 | 12 |
|
13 | | -### Quick buffer chat (<leader>o/) EXPERIMENTAL: |
| 13 | +### Quick buffer chat (<leader>o/) EXPERIMENTAL |
14 | 14 |
|
15 | 15 | This is an experimental feature that allows you to chat with the AI using the current buffer context. In visual mode, it captures the selected text as context, while in normal mode, it uses the current line. The AI will respond with quick edits to the files that are applied by the plugin. |
16 | 16 |
|
@@ -219,6 +219,9 @@ require('opencode').setup({ |
219 | 219 | wrap = false, -- Wraps text inside input window |
220 | 220 | }, |
221 | 221 | }, |
| 222 | + picker = { |
| 223 | + snacks_layout = nil -- `layout` opts to pass to Snacks.picker.pick({ layout = ... }) |
| 224 | + }, |
222 | 225 | completion = { |
223 | 226 | file_sources = { |
224 | 227 | enabled = true, |
@@ -371,6 +374,61 @@ Available icon keys (see implementation at lua/opencode/ui/icons.lua lines 7-29) |
371 | 374 | - status_on, status_off |
372 | 375 | - border, bullet |
373 | 376 |
|
| 377 | +### Picker Layout |
| 378 | + |
| 379 | +You can customize the layout of the picker used for history, session, references, and timeline |
| 380 | + |
| 381 | +#### Snacks Picker Layout |
| 382 | + |
| 383 | +There's 3 main ways on how to change the snacks picker layout |
| 384 | + |
| 385 | +1. Don't specify the new options -> it'll just default to the user's snack picker layout preset from their snacks config |
| 386 | +2. Specify the new options for opencode, e.g. |
| 387 | + |
| 388 | + ```lua |
| 389 | + require("opencode").setup({ |
| 390 | + ui = { |
| 391 | + picker = { |
| 392 | + ---@module "snacks" |
| 393 | + ---@type snacks.picker.layout.Config | nil |
| 394 | + snacks_layout = { |
| 395 | + layout = { border = "none", box = "vertical", ... } |
| 396 | + }, |
| 397 | + }, |
| 398 | + }, |
| 399 | + }) |
| 400 | + ``` |
| 401 | + |
| 402 | +3. Specify a [builtin layout preset](https://github.com/folke/snacks.nvim/blob/main/docs/picker.md#%EF%B8%8F-layouts) for snacks picker OR a custom layout defined in your snacks config's `opts.picker.layouts` |
| 403 | + |
| 404 | + ```lua |
| 405 | + -- opencode.lua |
| 406 | + require("opencode").setup({ |
| 407 | + ui = { |
| 408 | + picker = { |
| 409 | + ---@module "snacks" |
| 410 | + ---@type snacks.picker.layout.Config | nil |
| 411 | + snacks_layout = { |
| 412 | + preset = "custom_layout" -- or builtin snacks, like "select", "default", etc |
| 413 | + }, |
| 414 | + }, |
| 415 | + }, |
| 416 | + }) |
| 417 | + ``` |
| 418 | + |
| 419 | + ```lua |
| 420 | + -- snacks.lua |
| 421 | + { |
| 422 | + "folke/snacks.nvim", |
| 423 | + opts = { |
| 424 | + picker = { |
| 425 | + layouts = { |
| 426 | + custom_layout = { |
| 427 | + layout = { border = "none", box = "vertical", ... } |
| 428 | + -- ... |
| 429 | + } |
| 430 | + ``` |
| 431 | + |
374 | 432 | ## 🧰 Usage |
375 | 433 |
|
376 | 434 | ### Available Actions |
@@ -458,7 +516,7 @@ Run a prompt in a new session using the Plan agent and disabling current file co |
458 | 516 | :Opencode run "Fix the bug in the current file" model=github-copilot/claude-sonned-4 |
459 | 517 | ``` |
460 | 518 |
|
461 | | -##👮 Permissions |
| 519 | +## 👮 Permissions |
462 | 520 |
|
463 | 521 | Opencode can issue permission requests for potentially destructive operations (file edits, reverting files, running shell commands, or enabling persistent tool access). Permission requests appear inline in the output and must be responded to before the agent performs the action. Visit [Opencode Permissions Documentation](https://opencode.ai/docs/permissions/) for more details. |
464 | 522 |
|
|
0 commit comments