tencent cloud

Custom Keyboard Shortcuts

Download
Focus Mode
Font Size
Last updated: 2026-09-30 18:15:50
AI-Translated
CodeBuddy Code supports custom keyboard shortcuts. Run the /keybindings command to create or open the configuration file located at ~/.codebuddy/keybindings.json.

Configuration Files

The keybindings configuration file is an object that contains a bindings array. Each block specifies a context and a mapping of keys to actions.
Note:
Changes to the keybindings file are automatically detected and applied without restarting CodeBuddy Code.
Field
Description
$schema
Optional. JSON Schema URL for editor autocompletion
$docs
Optional. Documentation URL
bindings
Array of binding blocks organized by context
The following example binds Ctrl+E to an external editor and unbinds Ctrl+U in the Chat context:
{
"$schema": "https://code.codebuddy.ai/schemas/keybindings.json",
"$docs": "https://code.codebuddy.ai/docs/keybindings",
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+e": "chat:externalEditor",
"ctrl+u": null
}
}
]
}

Contexts

Each binding block specifies a context that determines when the keyboard shortcut takes effect:
Context
Description
Global
Takes effect anywhere in the application.
Chat
When the chat input box gains focus
InputBox
When the text input box is active
Terminal
When the terminal view is active
Autocomplete
When the autocomplete menu is displayed
Confirmation
When a confirmation/permission dialog is displayed
HistorySearch
When searching command history (Ctrl+R)
Task
When a task/agent is running in the foreground
Settings
When the settings panel is open
CommandPalette
When the command palette is open
Select
When a selection/list component gains focus
PermissionDialog
When the tool permission dialog is displayed
Help
When the help page is open
Plugin
When the plugin dialog is open
DiffDialog
When the Diff dialog is open
MessageSelector
When the message selector (rewind) is open

Available Actions

Actions follow the namespace:action format, such as chat:submit to send a message and app:toggleTodos to toggle the todo list. Each context has specific available actions.

Applying Actions

Available in the Global context:
Action
Default Shortcut
Description
app:interrupt
Ctrl+C
Interrupt the current operation.
app:exit
Ctrl+D
Exit CodeBuddy Code.
app:redraw
Ctrl+L
Refresh the terminal screen.
app:toggleTodos
Ctrl+T
Toggle the to-do list.
app:toggleTranscript
Ctrl+O
Toggle detailed transcript.
app:toggleSidebar
Cmd+B
Toggle the sidebar (Web UI).
app:toggleTerminal
Cmd+J
Toggle the terminal (Web UI).
app:commandPalette
Cmd+Shift+P / Ctrl+Shift+P
Open the command palette (Web UI).
app:newChat
Cmd+N
Create a new chat (Web UI).
app:settings
Cmd+,
Open settings (Web UI).
app:focusInput
Cmd+L
Focus the input box (Web UI).

Action History

Used to navigate command history:
Action
Default Shortcut
Description
history:search
Ctrl+R
Open history search.
history:previous
Up
Previous history
history:next
Down
Next history

Chat Actions

Available in the Chat context:
Action
Default Shortcut
Description
chat:cancel
Escape
Cancel the current input or interrupt the current foreground request.
chat:submit
Enter
Sending messages.
chat:killAgents
Ctrl+X Ctrl+K
Terminate all background agents.
chat:cycleMode
Shift+Tab (Windows also supports Alt+M).
Toggle permission mode.
chat:modelPicker
Meta+P
Open the model picker.
chat:thinkingToggle
Meta+T
Toggle extended thinking.
chat:undo
Ctrl+_, Ctrl+Shift+-
Undo
chat:externalEditor
Ctrl+G, Ctrl+X Ctrl+E
Open in an external editor.
chat:stash
Ctrl+S
Stash current input.
chat:imagePaste
Ctrl+V (Windows: Alt+V)
Paste images.
Shift+Tab is used as the primary keyboard shortcut across all platforms. On Windows, Alt+M is also retained as an alias for terminals that do not support Shift+Tab.

Autocomplete Actions

Available in the Autocomplete context:
Action
Default Shortcut
Description
autocomplete:accept
Tab
Accept suggestion.
autocomplete:dismiss
Escape
Close the menu.
autocomplete:previous
Up
Previous item
autocomplete:next
Down
Next item

Confirmation Actions

Available in the Confirmation context:
Action
Default Shortcut
Description
confirm:yes
Y, Enter
OK
confirm:no
N, Escape
Cancel
confirm:previous
Up
Previous item
confirm:next
Down
Next item
confirm:toggle
Space
Toggle selection.
confirm:toggleExplanation
Ctrl+E
Toggle permission description.
permission:toggleDebug
Ctrl+D
Toggle permission debug information.

Transcription Actions

Available in the Transcript context:
Action
Default Shortcut
Description
transcript:toggleShowAll
Ctrl+E
Toggle display of all content.
transcript:exit
Q, Ctrl+C, Escape
Exit transcript view.

Search History Actions

Available in the HistorySearch context:
Action
Default Shortcut
Description
historySearch:next
Ctrl+R
Next match
historySearch:accept
Escape, Tab
Accept selection.
historySearch:cancel
Ctrl+C
Cancel search.
historySearch:execute
Enter
Execute selected command.

Task Actions

Available in the Task context:
Action
Default Shortcut
Description
task:background
Ctrl+B
Move the current task to the background.

Help Actions

Available in the Help context:
Action
Default Shortcut
Description
help:dismiss
Escape
Close the help menu.

Settings Actions

Available in the Settings context:
Action
Default Shortcut
Description
settings:search
/
Enter search mode.
settings:close
Enter
Save and close the configuration panel.

Selection List Actions

Available in the Select context:
Action
Default Shortcut
Description
select:next
Down, J, Ctrl+N
Next item
select:previous
Up, K, Ctrl+P
Previous item
select:accept
Enter
Confirm selection.
select:cancel
Escape
Cancel selection.

Command Palette Actions

Available in the CommandPalette context:
Action
Default Shortcut
Description
commandPalette:previous
Up
Previous item
commandPalette:next
Down
Next item
commandPalette:execute
Enter
Execute command.
commandPalette:close
Escape
Close panel.

Diff Actions

Available in the DiffDialog context:
Action
Default Shortcut
Description
diff:dismiss
Escape
Close the Diff viewer.
diff:previousFile
Up
Previous file
diff:nextFile
Down
Next file
diff:viewDetails
Enter
View details.

Message Selector Actions

Available in the MessageSelector context:
Action
Default Shortcut
Description
messageSelector:up
Up, K, Ctrl+P
Move up.
messageSelector:down
Down, J, Ctrl+N
Move down.
messageSelector:top
Shift+Up
Jump to top.
messageSelector:bottom
Shift+Down
Jump to bottom.
messageSelector:select
Enter
Select message.

Plugin Actions

Available in the Plugin context:
Action
Default Shortcut
Description
plugin:toggle
Space
Toggle plugin selection.
plugin:install
I
Install the selected plugin.

Keystroke Syntax

Modifier Keys

Combine modifier keys using the + delimiter:
ctrl or control — Control key
alt, opt, or option — Alt/Option key
shift — Shift key
meta, cmd, or command — Meta/Command key
Example:
ctrl+k Single modifier key + key
shift+tab Shift + Tab
meta+p Command/Meta + P
ctrl+shift+c Multiple modifier keys

Chord Sequences

A chord sequence is a combination of consecutive keys separated by spaces:
ctrl+x ctrl+k Press Ctrl+X, release, and then press Ctrl+K
ctrl+x ctrl+e Press Ctrl+X, release, and then press Ctrl+E
A chord sequence has a 1000ms timeout. If the second step is not completed within the timeout, the chord sequence will be canceled.

Special Keys

escape or esc — Escape key
enter or return — Enter key
tab — Tab key
space — Space key
up, down, left, right — Arrow keys
backspace, delete — Delete key

Unbinding Default Keyboard Shortcuts

Set the action to null to unbind the default shortcut:
{
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+s": null
}
}
]
}
After unbinding all chord combinations, you can use the prefix key as a single-key binding:
{
"bindings": [
{
"context": "Chat",
"bindings": {
"ctrl+x ctrl+k": null,
"ctrl+x ctrl+e": null,
"ctrl+x": "chat:newline"
}
}
]
}
If only some chord sequences are unbound, pressing the prefix key still enters chord waiting mode.

Reserved Keyboard Shortcuts

The following shortcuts cannot be rebound:
Shortcut Keys
Reason
Ctrl+C
Hardcoded interrupt/cancel
Ctrl+D
Hardcoded exit
Ctrl+M
Equivalent to Enter in a terminal (both send CR).

Terminal Conflicts

Some shortcuts may conflict with terminal multiplexers:
Shortcut Keys
Conflict
Ctrl+B
tmux prefix key (press twice to send)
Ctrl+A
GNU screen prefix key
Ctrl+Z
Unix process suspension (SIGTSTP)

Web UI Visual Configuration

In addition to editing the JSON file, you can also manage shortcuts through the visual interface in the Web UI:
1. Click the Shortcuts navigation item in the sidebar, or use the URL #/keybindings
2. Use the search box to filter shortcuts by name, key, or context.
3. Click the edit button (pencil icon) to record a new shortcut combination.
4. The recording dialog box displays conflict detection in real time.
5. User-defined bindings are marked with a highlighted border on the left.
6. Click the reset button to restore a single binding to its default value.

REST API

The Web UI manages shortcuts through the REST API:
Endpoint
Methodology
Description
/api/v1/keybindings
GET
Obtain all shortcut keys (default + user + merged).
/api/v1/keybindings
PUT
Save user shortcut key configuration.
/api/v1/keybindings/reset
POST
Reset to default values (delete user configuration).
/api/v1/keybindings/validate
POST
Validate configuration (without saving).

Verification

CodeBuddy Code validates your shortcut configuration and displays warnings for the following situations:
Parse error (invalid JSON or structure)
Invalid context name
Preserve shortcut conflicts
Terminal multiplexer conflicts
Duplicate bindings in the same context

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback