diff options
| author | adamdottv <[email protected]> | 2025-07-02 16:08:06 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-07-02 16:08:11 -0500 |
| commit | c82a060eca41b990b4dd89cecffb874b2133af6f (patch) | |
| tree | c3bb84aee2e621da9feb18f866c88fc51da0e7c1 /packages/tui/internal/commands/command.go | |
| parent | 63e783ef795d91c745733b945247e917f1683d31 (diff) | |
| download | opencode-c82a060eca41b990b4dd89cecffb874b2133af6f.tar.gz opencode-c82a060eca41b990b4dd89cecffb874b2133af6f.zip | |
feat(tui): file viewer, select messages
Diffstat (limited to 'packages/tui/internal/commands/command.go')
| -rw-r--r-- | packages/tui/internal/commands/command.go | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go index 4ef458832..f9b447b55 100644 --- a/packages/tui/internal/commands/command.go +++ b/packages/tui/internal/commands/command.go @@ -80,13 +80,15 @@ const ( ToolDetailsCommand CommandName = "tool_details" ModelListCommand CommandName = "model_list" ThemeListCommand CommandName = "theme_list" + FileListCommand CommandName = "file_list" + FileCloseCommand CommandName = "file_close" + FileSearchCommand CommandName = "file_search" + FileDiffToggleCommand CommandName = "file_diff_toggle" ProjectInitCommand CommandName = "project_init" InputClearCommand CommandName = "input_clear" InputPasteCommand CommandName = "input_paste" InputSubmitCommand CommandName = "input_submit" InputNewlineCommand CommandName = "input_newline" - HistoryPreviousCommand CommandName = "history_previous" - HistoryNextCommand CommandName = "history_next" MessagesPageUpCommand CommandName = "messages_page_up" MessagesPageDownCommand CommandName = "messages_page_down" MessagesHalfPageUpCommand CommandName = "messages_half_page_up" @@ -95,6 +97,9 @@ const ( MessagesNextCommand CommandName = "messages_next" MessagesFirstCommand CommandName = "messages_first" MessagesLastCommand CommandName = "messages_last" + MessagesLayoutToggleCommand CommandName = "messages_layout_toggle" + MessagesCopyCommand CommandName = "messages_copy" + MessagesRevertCommand CommandName = "messages_revert" AppExitCommand CommandName = "app_exit" ) @@ -185,6 +190,27 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Trigger: "themes", }, { + Name: FileListCommand, + Description: "list files", + Keybindings: parseBindings("<leader>f"), + Trigger: "files", + }, + { + Name: FileCloseCommand, + Description: "close file", + Keybindings: parseBindings("esc"), + }, + { + Name: FileSearchCommand, + Description: "search file", + Keybindings: parseBindings("<leader>/"), + }, + { + Name: FileDiffToggleCommand, + Description: "split/unified diff", + Keybindings: parseBindings("<leader>v"), + }, + { Name: ProjectInitCommand, Description: "create/update AGENTS.md", Keybindings: parseBindings("<leader>i"), @@ -210,16 +236,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Description: "insert newline", Keybindings: parseBindings("shift+enter", "ctrl+j"), }, - // { - // Name: HistoryPreviousCommand, - // Description: "previous prompt", - // Keybindings: parseBindings("up"), - // }, - // { - // Name: HistoryNextCommand, - // Description: "next prompt", - // Keybindings: parseBindings("down"), - // }, { Name: MessagesPageUpCommand, Description: "page up", @@ -243,12 +259,12 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { { Name: MessagesPreviousCommand, Description: "previous message", - Keybindings: parseBindings("ctrl+alt+k"), + Keybindings: parseBindings("ctrl+up"), }, { Name: MessagesNextCommand, Description: "next message", - Keybindings: parseBindings("ctrl+alt+j"), + Keybindings: parseBindings("ctrl+down"), }, { Name: MessagesFirstCommand, @@ -261,6 +277,21 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { Keybindings: parseBindings("ctrl+alt+g"), }, { + Name: MessagesLayoutToggleCommand, + Description: "toggle layout", + Keybindings: parseBindings("<leader>m"), + }, + { + Name: MessagesCopyCommand, + Description: "copy message", + Keybindings: parseBindings("<leader>y"), + }, + { + Name: MessagesRevertCommand, + Description: "revert message", + Keybindings: parseBindings("<leader>u"), + }, + { Name: AppExitCommand, Description: "exit the app", Keybindings: parseBindings("ctrl+c", "<leader>q"), |
