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.
This commit is contained in:
@@ -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",)),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user