Skip to content

Conversation

@danyel117
Copy link
Contributor

The keybinds documentation was significantly out of sync with the actual configuration schema, causing confusion for users trying to customize their keybinds.

Issues Fixed:

Incorrect Key Names:

  • Changed help to app_help to match schema
  • Updated messages_previous/messages_next bindings from ctrl+alt+k/ctrl+alt+j to ctrl+up/ctrl+down
  • Corrected app_exit default from ctrl+c,<leader>q to ctrl+c,q

Missing Keybinds:

Added documentation for keybinds that were in the schema but missing from docs:

  • switch_mode (tab) - Switch between different modes
  • session_unshare (u) - Unshare current session
  • file_list (f) - List files
  • file_close (esc) - Close file
  • file_search (/) - Search file
  • file_diff_toggle (v) - Toggle between split and unified diff view
  • messages_layout_toggle (p) - Toggle layout
  • messages_copy (y) - Copy message
  • messages_revert (r) - Revert message

Removed Non-existent Keybinds:

  • Removed history_previous and history_next which don't exist in the schema

Format Improvements:

  • Updated example JSON to use actual schema defaults instead of leader key combinations
  • Added comprehensive documentation section explaining all available keybinds with descriptions
  • Maintained the leader key explanation but corrected the examples

This brings the documentation in line with the actual implementation and provides users with accurate information for customizing their keybinds.

The keybinds documentation was significantly out of sync with the actual configuration schema, causing confusion for users trying to customize their keybinds.

## Issues Fixed:

### Incorrect Key Names:
- Changed `help` to `app_help` to match schema
- Updated `messages_previous`/`messages_next` bindings from `ctrl+alt+k`/`ctrl+alt+j` to `ctrl+up`/`ctrl+down`
- Corrected `app_exit` default from `ctrl+c,<leader>q` to `ctrl+c,q`

### Missing Keybinds:
Added documentation for keybinds that were in the schema but missing from docs:
- `switch_mode` (tab) - Switch between different modes
- `session_unshare` (u) - Unshare current session
- `file_list` (f) - List files
- `file_close` (esc) - Close file
- `file_search` (/) - Search file
- `file_diff_toggle` (v) - Toggle between split and unified diff view
- `messages_layout_toggle` (p) - Toggle layout
- `messages_copy` (y) - Copy message
- `messages_revert` (r) - Revert message

### Removed Non-existent Keybinds:
- Removed `history_previous` and `history_next` which don't exist in the schema

### Format Improvements:
- Updated example JSON to use actual schema defaults instead of leader key combinations
- Added comprehensive documentation section explaining all available keybinds with descriptions
- Maintained the leader key explanation but corrected the examples

This brings the documentation in line with the actual implementation and provides users with accurate information for customizing their keybinds.
@adamdotdevin
Copy link
Contributor

this is helpful, thank you! curious though, i'm not seeing these:

Added comprehensive documentation section explaining all available keybinds with descriptions
Maintained the leader key explanation but corrected the examples

is it confusing to remove the <leader> in the docs like that?

@danyel117
Copy link
Contributor Author

danyel117 commented Jul 11, 2025

I agree about the <leader>, I've included it again.

this is helpful, thank you! curious though, i'm not seeing these:

Sorry, i added those initially and then deleted them because they felt redundant. Here they are anyways. Let me know if you'd like me to add them.

Available Keybinds

General

  • app_help: Show help dialog
  • switch_mode: Switch between different modes
  • app_exit: Exit the application

Editor

  • editor_open: Open external editor

Session Management

  • session_new: Create a new session
  • session_list: List all sessions
  • session_share: Share current session
  • session_unshare: Unshare current session
  • session_interrupt: Interrupt current session
  • session_compact: Compact the session

Tools and UI

  • tool_details: Toggle tool details
  • model_list: List available models
  • theme_list: List available themes
  • project_init: Create/update AGENTS.md

File Operations

  • file_list: List files
  • file_close: Close file
  • file_search: Search file
  • file_diff_toggle: Toggle between split and unified diff view

Input Controls

  • input_clear: Clear input field
  • input_paste: Paste from clipboard
  • input_submit: Submit input
  • input_newline: Insert newline in input

Message Navigation

  • messages_page_up: Scroll messages up by one page
  • messages_page_down: Scroll messages down by one page
  • messages_half_page_up: Scroll messages up by half page
  • messages_half_page_down: Scroll messages down by half page
  • messages_previous: Navigate to previous message
  • messages_next: Navigate to next message
  • messages_first: Navigate to first message
  • messages_last: Navigate to last message
  • messages_layout_toggle: Toggle layout
  • messages_copy: Copy message
  • messages_revert: Revert message

Thanks!

@jayair
Copy link
Contributor

jayair commented Jul 11, 2025

I guess file_search is now @

But otherwise this is useful. Maybe we could add these descriptions as comments to the code snippet we have in the doc. And separate them into the sections you have here by adding new lines between them?

{
  "$schema": "https://opencode.ai/config.json",
  "keybinds": {
     // General
    "leader": "ctrl+x", // Leader key
    "help": "<leader>h", // Show help dialog

    // Editor
    "editor_open": "<leader>e", // Open external editor
  }
}

@danyel117
Copy link
Contributor Author

danyel117 commented Jul 11, 2025

I put those new lines between the categories in the commands. I think those descriptions could be added to the code snippets. I can open another PR for that.

I guess file_search is now @

I still see <leader>/ for file search in opencode.json. Should i change it to @?

@adamdotdevin
Copy link
Contributor

I put those new lines between the categories in the commands. I think those descriptions could be added to the code snippets. I can open another PR for that.

I guess file_search is now @

I still see <leader>/ for file search in opencode.json. Should i change it to @?

oh, actually, the @<file> feature isn't configurable, it's always @.

@adamdotdevin adamdotdevin requested a review from jayair July 14, 2025 12:49
@jayair jayair merged commit fc45c0c into anomalyco:dev Jul 16, 2025
nipuna-perera pushed a commit to nipuna-perera/opencode that referenced this pull request Jul 26, 2025
achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants