OpenCode: OpenCode Theme and Appearance
Last updated: 2026-08-31
--- title: OpenCode Themes, Keybindings and Custom Commands description: Customize appearance themes, keyboard shortcuts, and custom commands order: 14 lang: en
Customizing themes, keybindings, and commands significantly improves the OpenCode experience.
1. What You Will Learn
- Theme switching and customization
- Keybinding configuration
- Custom commands
- TUI appearance adjustments
2. Themes
Switch in TUI: /themes or Ctrl+X → T
Built-in themes: default, dark, light, monokai, dracula
Config file:
JSON
{ "theme": "dracula" }
3. Keybindings
Ctrl+X is the default leader key (like Vim Leader):
| Function | Shortcut |
|---|---|
| Help | Ctrl+X → H |
| New session | Ctrl+X → N |
| Undo | Ctrl+X → U |
| Redo | Ctrl+X → R |
| Models | Ctrl+X → M |
| Themes | Ctrl+X → T |
| Export | Ctrl+X → X |
| Agents | Ctrl+X → A |
| Init | Ctrl+X → I |
| Editor | Ctrl+X → E |
| Compact | Ctrl+X → C |
| Exit | Ctrl+X → Q |
Custom keybindings in opencode.json:
JSON
{
"keybinds": {
"agent_cycle": "tab",
"session_child_cycle": "ctrl+right"
}
}
4. Core Interaction Syntax
| Prefix | Function | Example |
|---|---|---|
/ |
Built-in commands | /models |
@ |
File references | @src/index.ts |
! |
Shell commands | !npm test |
5. TUI Configuration
JSON
{
"tui": {
"scroll_speed": 3,
"scroll_acceleration": { "enabled": true }
}
}
❓ FAQ
Q Can I customize the Leader Key?
A Yes, in opencode.json keybinds config. But Ctrl+X is the community convention—changing it is not recommended.
Q Keybindings conflict with Vim?
A OpenCode keybindings only apply when the input box is focused. When using /editor to open Vim, OpenCode shortcuts don't apply.
📖 Summary
/themesswitches themes, Ctrl+X → T for quick switch- Ctrl+X is the keybinding leader key
- Interaction syntax:
/commands,@references,!Shell - Customize keybindings and TUI in opencode.json
📝 Exercises
-
Basic: Switch to the Dracula theme and experience the visual difference.
-
Intermediate: Complete a development task using only keyboard shortcuts (no mouse).
-
Advanced: Customize keybindings in opencode.json to match your preferred key layout.