Skip to content

Personalization

Personalization

Customize Opencode to match your preferences and workflow with personalized settings. Tailoring your environment can significantly enhance your productivity and overall user experience.

Theme Customization

Opencode offers flexible theme options to suit your visual preferences and working environment.

Setting the Theme

You can configure the theme in your global or project configuration file:

{
  "theme": "dark" // Options: dark, light, system
}

Theme Options

  • dark: A dark background with light text, ideal for low-light environments
  • light: A light background with dark text, suitable for well-lit spaces
  • system: Automatically follows your operating system’s theme setting

Custom Themes

For advanced users, you can create custom themes by modifying the CSS variables in your configuration:

# .opencode
theme:
  primary: "#4f46e5"
  secondary: "#10b981"
  background: "#111827"
  text: "#f9fafb"
  accent: "#f59e0b"

Keyboard Shortcuts

Customize keyboard shortcuts to streamline your workflow and access features more efficiently.

Default Shortcuts

ActionShortcut
Open Command PaletteCtrl/Cmd + Shift + P
Save ChangesCtrl/Cmd + S
UndoCtrl/Cmd + Z
RedoCtrl/Cmd + Y
FindCtrl/Cmd + F
ReplaceCtrl/Cmd + H

Customizing Shortcuts

Define your own keyboard shortcuts in the configuration file:

# .opencode
shortcuts:
  command_palette: "Ctrl+Shift+P"
  save: "Ctrl+S"
  undo: "Ctrl+Z"
  redo: "Ctrl+Y"
  find: "Ctrl+F"
  replace: "Ctrl+H"
  
  # Add custom shortcuts
  run_agent: "Ctrl+Enter"
  toggle_plan_mode: "Ctrl+P"

Code Formatting Tools

Configure code formatting tools to maintain consistent code style across your projects.

Built-in Formatters

Opencode includes built-in support for popular code formatters:

  • Prettier
  • Black (Python)
  • gofmt (Go)
  • rustfmt (Rust)

Configuration Example

# .opencode
formatting:
  enabled: true
  default_formatter: "prettier"
  format_on_save: true
  
  # Language-specific formatters
  language_formatters:
    python: "black"
    go: "gofmt"
    rust: "rustfmt"
    javascript: "prettier"
    typescript: "prettier"
    html: "prettier"
    css: "prettier"

Custom Formatting Rules

For project-specific formatting rules, you can use standard configuration files for each formatter:

  • .prettierrc for Prettier
  • pyproject.toml for Black
  • .golangci.yml for Go linting

User Experience Benefits

Personalizing Opencode offers several key benefits:

  1. Increased Productivity: Custom shortcuts and workflows reduce repetitive actions
  2. Reduced Eye Strain: Theme options adapt to your working environment
  3. Consistent Code Quality: Automated formatting ensures clean, standardized code
  4. Enhanced Focus: A personalized environment minimizes distractions
  5. Improved Accessibility: Customizable settings accommodate different needs

Best Practices

  • Start Simple: Begin with basic theme and shortcut adjustments
  • Test Gradually: Try one change at a time to assess its impact
  • Document Changes: Keep track of your customizations for reference
  • Share Configurations: Export and share your settings with team members
  • Update Regularly: Review and refine your configuration as your workflow evolves

Example Configuration

Here’s a comprehensive example of a personalized configuration:

# .opencode

# Theme settings
theme: "dark"

# Keyboard shortcuts
shortcuts:
  command_palette: "Ctrl+Shift+P"
  save: "Ctrl+S"
  undo: "Ctrl+Z"
  redo: "Ctrl+Y"
  find: "Ctrl+F"
  replace: "Ctrl+H"
  run_agent: "Ctrl+Enter"
  toggle_plan_mode: "Ctrl+P"

# Code formatting
formatting:
  enabled: true
  default_formatter: "prettier"
  format_on_save: true
  language_formatters:
    python: "black"
    javascript: "prettier"
    typescript: "prettier"

# Additional settings
context_window_limit: 128000
ignore:
  - "dist/"
  - "*.lock"

By taking advantage of these personalization options, you can create a coding environment that feels tailored specifically to your needs, making your development process more efficient and enjoyable.