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


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


📝 Exercises

  1. Basic: Switch to the Dracula theme and experience the visual difference.

  2. Intermediate: Complete a development task using only keyboard shortcuts (no mouse).

  3. Advanced: Customize keybindings in opencode.json to match your preferred key layout.

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏