Skip to content

Commit 03b9c69

Browse files
authored
refactor: cleanup and split formatters in multiple modules (#310)
1 parent 42ae5e2 commit 03b9c69

27 files changed

Lines changed: 8674 additions & 3750 deletions

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ Install the plugin with your favorite package manager. See the [Configuration](#
112112

113113
## ⚙️ Configuration
114114

115-
> **Note**: The keymap configuration structure has been updated. Old keymaps (`keymap.global` and `keymap.window`) will be mapped to the new format (`keymap.editor`, `keymap.input_window`, `keymap.output_window`) but you should update your config to the new format. See [Keymap Configuration](#keymap-configuration) below for details.
116-
117115
```lua
118116
-- Default configuration with all available options
119117
require('opencode').setup({
@@ -298,7 +296,7 @@ require('opencode').setup({
298296
},
299297
diagnostics = {
300298
info = false, -- Include diagnostics info in the context (default to false
301-
warn = true, -- Include diagnostics warnings in the context
299+
warning = true, -- Include diagnostics warnings in the context
302300
error = true, -- Include diagnostics errors in the context
303301
only_closest = false, -- If true, only diagnostics for cursor/selection
304302
},
@@ -345,7 +343,7 @@ require('opencode').setup({
345343
},
346344
quick_chat = {
347345
default_model = nil, -- works better with a fast model like gpt-4.1
348-
default_agent = 'plan', -- plan ensure no file modifications by default
346+
default_agent = nil, -- Uses the current mode when nil
349347
instructions = nil, -- Use built-in instructions if nil
350348
},
351349
})
@@ -360,7 +358,7 @@ The keymap configuration has been restructured for better organization and clari
360358
- **`output_window`**: Keymaps specific to the output window
361359
- **`permission`**: Special keymaps for responding to permission requests (available in input/output windows when there's a pending permission)
362360

363-
**Backward Compatibility**: The plugin automatically maps configurations that use `keymap.global` and `keymap.window` to the new structure. A deprecation warning will be shown during migration. Update your configuration to use the new structure to remove the warning.
361+
Configure keymaps with the current nested tables directly: `keymap.editor`, `keymap.input_window`, and `keymap.output_window`.
364362

365363
Each keymap entry is a table consising of:
366364

@@ -670,7 +668,7 @@ You can pass additional options when running a prompt via command or API:
670668
- `current_file`
671669
- `selection`
672670
- `diagnostics.info`
673-
- `diagnostics.warn`
671+
- `diagnostics.warning`
674672
- `diagnostics.error`
675673
- `cursor_data`
676674

@@ -680,7 +678,7 @@ Run a prompt in a new session using the Plan agent and disabling current file co
680678

681679
```vim
682680
:Opencode run new_session "Please help me plan a new feature" agent=plan context.current_file.enabled=false
683-
:Opencode run "Fix the bug in the current file" model=github-copilot/claude-sonned-4
681+
:Opencode run "Fix the bug in the current file" model=github-copilot/claude-sonnet-4
684682
```
685683

686684
## 👮 Permissions
@@ -694,8 +692,8 @@ Opencode can issue permission requests for potentially destructive operations (f
694692

695693
### Responding to Permission Requests
696694

697-
- **Respond via keys:** In the input window press `a` to accept once, `A` to accept and remember (accept all), or `d` to deny. These window keys are configurable in `ui.keymap.window.permission_*`.
698-
- **Global keymaps:** There are also global keymaps to respond outside the input window: `<leader>opa` (accept once), `<leader>opA` (accept all), `<leader>opd` (deny). These are configurable in `keymap.global.permission_*`.
695+
- **Respond via the dialog:** Focus the Opencode window, move with `j`/`k` or arrow keys, then confirm with `<CR>`. Number shortcuts `1-3` also work for the visible options.
696+
- **Command:** Use `:Opencode permission accept`, `:Opencode permission accept_all`, or `:Opencode permission deny`. You can pass an index to target a specific queued permission.
699697
- **API:** Programmatic responses are available: `require('opencode.api').permission_accept()`, `require('opencode.api').permission_accept_all()`, `require('opencode.api').permission_deny()` which map to responses `"once"`, `"always"`, and `"reject"` respectively.
700698
- **Behavior:** `accept once` allows the single requested action, `accept all` grants persistent permission for similar requests in the current session, and `deny` rejects the request.
701699

@@ -722,7 +720,7 @@ Supported pickers include [`fzf-lua`](https://github.com/ibhagwan/fzf-lua), [`te
722720

723721
### Context bar
724722

725-
You can quiclkly see the current context items in the context bar at the top of the input window:
723+
You can quickly see the current context items in the context bar at the top of the input window:
726724

727725
<div align="center">
728726
<img src="https://i.imgur.com/vGgu6br.png" alt="Opencode.nvim context bar" width="90%" />
@@ -772,7 +770,7 @@ Press `<M-m>` (Alt+M) in the input window to switch between agents during a sess
772770

773771
You can create custom agents through your opencode config file. Each agent can have its own:
774772

775-
- Agentl configuration
773+
- Agent configuration
776774
- Custom prompt
777775
- Enabled/disabled tools
778776
- And more

0 commit comments

Comments
 (0)