diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index e7349dbb..4ed65a4f 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -199,12 +199,6 @@ export namespace Config { .object({ leader: z.string().optional().default("ctrl+x").describe("Leader key for keybind combinations"), app_help: z.string().optional().default("h").describe("Show help dialog"), - switch_mode: z.string().optional().default("none").describe("@deprecated use switch_agent. Next mode"), - switch_mode_reverse: z - .string() - .optional() - .default("none") - .describe("@deprecated use switch_agent_reverse. Previous mode"), switch_agent: z.string().optional().default("tab").describe("Next agent"), switch_agent_reverse: z.string().optional().default("shift+tab").describe("Previous agent"), editor_open: z.string().optional().default("e").describe("Open external editor"), @@ -222,10 +216,6 @@ export namespace Config { model_cycle_recent: z.string().optional().default("f2").describe("Next recent model"), model_cycle_recent_reverse: z.string().optional().default("shift+f2").describe("Previous recent model"), theme_list: z.string().optional().default("t").describe("List available themes"), - file_list: z.string().optional().default("none").describe("@deprecated Currently not available. List files"), - file_close: z.string().optional().default("none").describe("@deprecated Close file"), - file_search: z.string().optional().default("none").describe("@deprecated Search file"), - file_diff_toggle: z.string().optional().default("none").describe("@deprecated Split/unified diff"), project_init: z.string().optional().default("i").describe("Create/update AGENTS.md"), input_clear: z.string().optional().default("ctrl+c").describe("Clear input field"), input_paste: z.string().optional().default("ctrl+v").describe("Paste from clipboard"), @@ -239,16 +229,27 @@ export namespace Config { .optional() .default("ctrl+alt+d") .describe("Scroll messages down by half page"), - messages_previous: z.string().optional().default("ctrl+up").describe("Navigate to previous message"), - messages_next: z.string().optional().default("ctrl+down").describe("Navigate to next message"), messages_first: z.string().optional().default("ctrl+g").describe("Navigate to first message"), messages_last: z.string().optional().default("ctrl+alt+g").describe("Navigate to last message"), - messages_layout_toggle: z.string().optional().default("p").describe("Toggle layout"), messages_copy: z.string().optional().default("y").describe("Copy message"), - messages_revert: z.string().optional().default("none").describe("@deprecated use messages_undo. Revert message"), messages_undo: z.string().optional().default("u").describe("Undo message"), messages_redo: z.string().optional().default("r").describe("Redo message"), app_exit: z.string().optional().default("ctrl+c,q").describe("Exit the application"), + // Deprecated commands + switch_mode: z.string().optional().default("none").describe("@deprecated use switch_agent. Next mode"), + switch_mode_reverse: z + .string() + .optional() + .default("none") + .describe("@deprecated use switch_agent_reverse. Previous mode"), + file_list: z.string().optional().default("none").describe("@deprecated Currently not available. List files"), + file_close: z.string().optional().default("none").describe("@deprecated Close file"), + file_search: z.string().optional().default("none").describe("@deprecated Search file"), + file_diff_toggle: z.string().optional().default("none").describe("@deprecated Split/unified diff"), + messages_previous: z.string().optional().default("none").describe("@deprecated Navigate to previous message"), + messages_next: z.string().optional().default("none").describe("@deprecated Navigate to next message"), + messages_layout_toggle: z.string().optional().default("none").describe("@deprecated Toggle layout"), + messages_revert: z.string().optional().default("none").describe("@deprecated use messages_undo. Revert message"), }) .strict() .openapi({ diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go index ebb468d2..19f8586d 100644 --- a/packages/tui/internal/commands/command.go +++ b/packages/tui/internal/commands/command.go @@ -138,15 +138,14 @@ const ( MessagesPageDownCommand CommandName = "messages_page_down" MessagesHalfPageUpCommand CommandName = "messages_half_page_up" MessagesHalfPageDownCommand CommandName = "messages_half_page_down" - MessagesPreviousCommand CommandName = "messages_previous" - MessagesNextCommand CommandName = "messages_next" - MessagesFirstCommand CommandName = "messages_first" - MessagesLastCommand CommandName = "messages_last" - MessagesLayoutToggleCommand CommandName = "messages_layout_toggle" - MessagesCopyCommand CommandName = "messages_copy" - MessagesUndoCommand CommandName = "messages_undo" - MessagesRedoCommand CommandName = "messages_redo" - AppExitCommand CommandName = "app_exit" + + MessagesFirstCommand CommandName = "messages_first" + MessagesLastCommand CommandName = "messages_last" + + MessagesCopyCommand CommandName = "messages_copy" + MessagesUndoCommand CommandName = "messages_undo" + MessagesRedoCommand CommandName = "messages_redo" + AppExitCommand CommandName = "app_exit" ) func (k Command) Matches(msg tea.KeyPressMsg, leader bool) bool { @@ -348,16 +347,7 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Description: "half page down", Keybindings: parseBindings("ctrl+alt+d"), }, - { - Name: MessagesPreviousCommand, - Description: "previous message", - Keybindings: parseBindings("ctrl+up"), - }, - { - Name: MessagesNextCommand, - Description: "next message", - Keybindings: parseBindings("ctrl+down"), - }, + { Name: MessagesFirstCommand, Description: "first message", @@ -368,11 +358,7 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Description: "last message", Keybindings: parseBindings("ctrl+alt+g"), }, - { - Name: MessagesLayoutToggleCommand, - Description: "toggle layout", - Keybindings: parseBindings("p"), - }, + { Name: MessagesCopyCommand, Description: "copy message", diff --git a/packages/tui/internal/components/fileviewer/fileviewer.go b/packages/tui/internal/components/fileviewer/fileviewer.go index 3fa333f4..3df369ab 100644 --- a/packages/tui/internal/components/fileviewer/fileviewer.go +++ b/packages/tui/internal/components/fileviewer/fileviewer.go @@ -99,7 +99,6 @@ func (m Model) View() string { if m.isDiff == nil || *m.isDiff == false { diffToggle = "" } - layoutToggle := m.app.Key(commands.MessagesLayoutToggleCommand) background := t.Background() footer := layout.Render( @@ -114,9 +113,7 @@ func (m Model) View() string { layout.FlexItem{ View: close, }, - layout.FlexItem{ - View: layoutToggle, - }, + layout.FlexItem{ View: diffToggle, }, diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.go index dcbdd2b5..63243dc3 100644 --- a/packages/tui/internal/tui/tui.go +++ b/packages/tui/internal/tui/tui.go @@ -1277,10 +1277,7 @@ func (a Model) executeCommand(command commands.Command) (tea.Model, tea.Cmd) { a.messages = updated.(chat.MessagesComponent) cmds = append(cmds, cmd) } - case commands.MessagesLayoutToggleCommand: - a.messagesRight = !a.messagesRight - a.app.State.MessagesRight = a.messagesRight - cmds = append(cmds, a.app.SaveState()) + case commands.MessagesCopyCommand: updated, cmd := a.messages.CopyLastMessage() a.messages = updated.(chat.MessagesComponent) diff --git a/packages/web/src/content/docs/docs/keybinds.mdx b/packages/web/src/content/docs/docs/keybinds.mdx index 6bb573bc..e311936f 100644 --- a/packages/web/src/content/docs/docs/keybinds.mdx +++ b/packages/web/src/content/docs/docs/keybinds.mdx @@ -12,18 +12,24 @@ opencode has a list of keybinds that you can customize through the opencode conf "leader": "ctrl+x", "app_help": "h", "switch_agent": "tab", + "switch_agent_reverse": "shift+tab", "editor_open": "e", "session_new": "n", "session_list": "l", "session_share": "s", - "session_unshare": "u", + "session_unshare": "none", + "session_export": "x", "session_interrupt": "esc", "session_compact": "c", "tool_details": "d", + "thinking_blocks": "b", "model_list": "m", + "agent_list": "a", + "model_cycle_recent": "f2", + "model_cycle_recent_reverse": "shift+f2", "theme_list": "t", "project_init": "i", @@ -39,6 +45,8 @@ opencode has a list of keybinds that you can customize through the opencode conf "messages_first": "ctrl+g", "messages_last": "ctrl+alt+g", "messages_copy": "y", + "messages_undo": "u", + "messages_redo": "r", "app_exit": "ctrl+c,q" } @@ -65,7 +73,7 @@ You can disable a keybind by adding the key to your config with a value of "none { "$schema": "https://opencode.ai/config.json", "keybinds": { - "session_compact": "none", + "session_compact": "none" } } ```