From 2a5373da2cdcb2a4dce3fdcbf2936102ec00f95e Mon Sep 17 00:00:00 2001 From: Sam Foreman Date: Fri, 28 Aug 2026 14:12:33 -0500 Subject: [PATCH] feat(cli): add display.vim_mode config and register /vim command Introduces the opt-in surface for vi editing in the input composer: - display.vim_mode config default (False, so existing users are unaffected and prompt_toolkit keeps its standard emacs bindings) - /vim command registered with on|off|status subcommands, matching the established /battery and /timestamps pattern Part of #4254. --- hermes_cli/commands.py | 3 +++ hermes_cli/config_defaults.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index 5bc9eabeb4..853ee6c48c 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -163,6 +163,9 @@ COMMAND_REGISTRY: list[CommandDef] = [ CommandDef("battery", "Toggle a color-coded battery indicator in the status bar", "Configuration", cli_only=True, args_hint="[on|off|status]", subcommands=("on", "off", "status")), + CommandDef("vim", "Toggle vim keybindings in the input composer", + "Configuration", cli_only=True, args_hint="[on|off|status]", + subcommands=("on", "off", "status")), CommandDef("timestamps", "Toggle [HH:MM] timestamps on messages and /history", "Configuration", cli_only=True, args_hint="[on|off|status]", subcommands=("on", "off", "status"), aliases=("ts",)), diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.py index 270ca09f67..3a5be26359 100644 --- a/hermes_cli/config_defaults.py +++ b/hermes_cli/config_defaults.py @@ -837,6 +837,9 @@ DEFAULT_CONFIG = { # fights terminal auto-scroll in non-fullscreen mode. # See #45592. "cli_refresh_interval": 1.0, + # Vi/vim keybindings in the CLI input composer (toggled by /vim). + # Off by default, preserving prompt_toolkit's standard emacs bindings. + "vim_mode": False, "user_message_preview": { # CLI: submitted user-message lines echoed to scrollback "first_lines": 2, "last_lines": 2,