Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emanuele-web04/dpcode/llms.txt

Use this file to discover all available pages before exploring further.

DP Code reads keyboard shortcut rules from ~/.dpcode/userdata/keybindings.json. The file is a JSON array of rule objects. Each rule maps a key combination to a command and can optionally restrict activation to a particular UI context using a when condition.
Invalid rules and invalid config files are silently ignored — DP Code logs a warning to the server but continues with the remaining valid rules. On first launch, the file is created automatically and pre-populated with all default shortcuts.

File location

~/.dpcode/userdata/keybindings.json

Rule format

Each entry in the array is an object with the following fields:
FieldRequiredDescription
keyYesKey combination string, for example "mod+j"
commandYesCommand identifier to execute
whenNoBoolean expression; rule is only active when this evaluates to true
[
  { "key": "mod+j", "command": "terminal.toggle" },
  { "key": "mod+shift+g", "command": "terminal.new", "when": "terminalFocus" }
]

Default keybindings

DP Code ships with the following defaults. You can override any of them by adding a rule for the same command — your rule replaces the default for that command.
[
  { "key": "mod+b", "command": "sidebar.toggle", "when": "!terminalFocus" },
  { "key": "mod+k", "command": "sidebar.search" },
  { "key": "mod+shift+o", "command": "sidebar.addProject", "when": "!terminalFocus" },
  { "key": "mod+i", "command": "sidebar.importThread", "when": "!terminalFocus" },
  { "key": "mod+j", "command": "terminal.toggle" },
  { "key": "mod+d", "command": "terminal.split", "when": "terminalFocus" },
  { "key": "mod+shift+arrowright", "command": "terminal.splitRight", "when": "terminalFocus" },
  { "key": "mod+shift+arrowleft", "command": "terminal.splitLeft", "when": "terminalFocus" },
  { "key": "mod+shift+arrowdown", "command": "terminal.splitDown", "when": "terminalFocus" },
  { "key": "mod+shift+arrowup", "command": "terminal.splitUp", "when": "terminalFocus" },
  { "key": "mod+t", "command": "terminal.new", "when": "terminalFocus" },
  { "key": "mod+w", "command": "terminal.close", "when": "terminalFocus" },
  { "key": "mod+shift+j", "command": "terminal.workspace.newFullWidth" },
  { "key": "mod+w", "command": "terminal.workspace.closeActive", "when": "terminalWorkspaceOpen" },
  { "key": "mod+1", "command": "terminal.workspace.terminal", "when": "terminalWorkspaceOpen" },
  { "key": "mod+2", "command": "terminal.workspace.chat", "when": "terminalWorkspaceOpen" },
  { "key": "mod+shift+b", "command": "browser.toggle", "when": "!terminalFocus" },
  { "key": "mod+d", "command": "diff.toggle", "when": "!terminalFocus" },
  { "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" },
  { "key": "mod+shift+n", "command": "chat.newLatestProject", "when": "!terminalFocus" },
  { "key": "mod+alt+n", "command": "chat.newChat", "when": "!terminalFocus" },
  { "key": "mod+shift+t", "command": "chat.newTerminal", "when": "!terminalFocus" },
  { "key": "mod+alt+c", "command": "chat.newClaude", "when": "!terminalFocus" },
  { "key": "mod+alt+x", "command": "chat.newCodex", "when": "!terminalFocus" },
  { "key": "mod+alt+r", "command": "chat.newCursor", "when": "!terminalFocus" },
  { "key": "mod+alt+g", "command": "chat.newGemini", "when": "!terminalFocus" },
  { "key": "mod+\\", "command": "chat.split", "when": "!terminalFocus" },
  { "key": "mod+1", "command": "thread.jump.1", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+2", "command": "thread.jump.2", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+3", "command": "thread.jump.3", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+4", "command": "thread.jump.4", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+5", "command": "thread.jump.5", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+6", "command": "thread.jump.6", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+7", "command": "thread.jump.7", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+8", "command": "thread.jump.8", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+9", "command": "thread.jump.9", "when": "!terminalFocus && !terminalWorkspaceOpen" },
  { "key": "mod+shift+]", "command": "chat.visible.next", "when": "!terminalFocus" },
  { "key": "mod+shift+[", "command": "chat.visible.previous", "when": "!terminalFocus" },
  { "key": "mod+o", "command": "editor.openFavorite" }
]

Available commands

CommandDescription
sidebar.toggleShow or hide the sidebar
sidebar.searchFocus the sidebar search field
sidebar.addProjectOpen the add-project dialog
sidebar.importThreadImport a thread

Terminal

CommandDescription
terminal.toggleOpen or close the terminal drawer
terminal.splitSplit the focused terminal
terminal.splitRightSplit focused terminal to the right
terminal.splitLeftSplit focused terminal to the left
terminal.splitDownSplit focused terminal downward
terminal.splitUpSplit focused terminal upward
terminal.newCreate a new terminal tab
terminal.closeClose the focused terminal
terminal.workspace.newFullWidthOpen a full-width terminal workspace
terminal.workspace.closeActiveClose the active pane in the terminal workspace
terminal.workspace.terminalSwitch the terminal workspace to terminal view
terminal.workspace.chatSwitch the terminal workspace to chat view

Chat and threads

CommandDescription
chat.newNew thread preserving the active branch/worktree state
chat.newLatestProjectNew thread for the latest project
chat.newChatNew chat-only thread
chat.newLocalNew thread for the active project in a fresh local environment
chat.newTerminalNew terminal-first thread
chat.newClaudeNew thread using the Claude provider
chat.newCodexNew thread using the Codex provider
chat.newCursorNew thread using the Cursor provider
chat.newGeminiNew thread using the Gemini provider
chat.splitSplit the active chat pane
chat.visible.nextSwitch to the next visible thread
chat.visible.previousSwitch to the previous visible thread
thread.jump.1thread.jump.9Jump directly to thread 1–9 in the sidebar

Editor and other

CommandDescription
editor.openFavoriteOpen the current project in the last-used editor
browser.toggleShow or hide the embedded browser
diff.toggleShow or hide the diff panel
script.{id}.runRun a project script by ID (for example script.test.run)

Key syntax

A key string is a sequence of modifier tokens and exactly one key token joined by +. Modifiers:
TokenMeaning
modcmd on macOS, ctrl on all other platforms
cmd / metamacOS Command key
ctrl / controlControl key
shiftShift key
alt / optionAlt / Option key
Examples:
mod+j
mod+shift+d
ctrl+l
cmd+k
mod+alt+n
Use space to represent the Space bar and esc for Escape.

when conditions

The when field controls whether a rule is active in the current UI state. It supports a small expression language. Available context keys:
KeyTrue when
terminalFocusA terminal pane has keyboard focus
terminalOpenThe terminal drawer is open
terminalWorkspaceOpenThe terminal workspace overlay is open
Unknown context keys always evaluate to false. Supported operators:
OperatorDescription
!Logical NOT
&&Logical AND
||Logical OR
( )Grouping
Examples:
"when": "terminalFocus"
"when": "terminalOpen && !terminalFocus"
"when": "terminalFocus || terminalOpen"
"when": "!terminalFocus && !terminalWorkspaceOpen"

Precedence

Rules are evaluated in array order. For any key event, the last rule whose key matches and whose when evaluates to true wins — regardless of which command it targets. Place more specific rules later in the array to ensure they take priority.
When you define a rule for a command that has a default, your rule replaces the default for that command entirely. You do not need to remove the original — DP Code automatically excludes the default when your custom version is present.

Example customization

The following file remaps terminal toggle to mod+g and adds a custom script shortcut:
[
  { "key": "mod+g", "command": "terminal.toggle" },
  { "key": "mod+shift+r", "command": "script.test.run", "when": "!terminalFocus" }
]
The maximum number of rules in keybindings.json is 256. If you exceed this limit, older entries are dropped to keep the most recent 256 rules.

Build docs developers (and LLMs) love