Skip to content

feat(tui): make vim mode Enter key behavior configurable#381

Merged
theahura merged 3 commits intomainfrom
auto/vim-mode-enter-key-behavior-20260309-211316
Mar 9, 2026
Merged

feat(tui): make vim mode Enter key behavior configurable#381
theahura merged 3 commits intomainfrom
auto/vim-mode-enter-key-behavior-20260309-211316

Conversation

@theahura
Copy link
Copy Markdown
Contributor

@theahura theahura commented Mar 9, 2026

Summary

  • Replaces boolean vim_mode config with a three-way VimEnterBehavior enum: Enter is Newline, Enter is Submit, and Off
  • When the user selects vim mode in /config, a sub-picker (like Auto Worktree) lets them choose how Enter behaves in INSERT vs NORMAL mode
  • Old vim_mode = true in config.toml automatically maps to Submit for backwards compatibility

Details

Enter is Newline: Enter inserts a newline in INSERT mode; Esc then Enter submits. Best for users who want vim-like editing where Enter is just a newline.

Enter is Submit: Enter submits in INSERT mode (traditional CLI behavior); Enter in NORMAL mode inserts a newline. Best for users who want vim navigation but standard submit behavior.

Test plan

  • 5 new unit tests covering all vim enter behavior combinations (part5.rs)
  • Existing vim mode tests updated to use new API
  • All 992 nori-tui tests pass
  • All 430 codex-acp tests pass
  • Backwards compatibility: vim_mode = true deserializes as Submit, vim_mode = false as Off
  • Config persistence writes correct toml values ("newline", "submit", "off")

theahura and others added 3 commits March 9, 2026 18:13
Replace boolean vim_mode config with VimEnterBehavior enum (Newline,
Submit, Off). When vim mode is enabled, the user picks how Enter
behaves:

- "Enter is Newline": Enter inserts newline in INSERT mode, submits
  in NORMAL mode (Esc then Enter to submit)
- "Enter is Submit": Enter submits in INSERT mode, inserts newline
  in NORMAL mode (traditional behavior)

The config picker shows a sub-picker (like Auto Worktree) with three
options. Old `vim_mode = true` in config.toml maps to Submit for
backwards compatibility via custom serde deserializer.
🤖 Generated with [Nori](https://usenori.ai)

Co-Authored-By: Nori <contact@tilework.tech>
🤖 Generated with [Nori](https://usenori.ai)

Co-Authored-By: Nori <contact@tilework.tech>
@theahura theahura merged commit 2618387 into main Mar 9, 2026
3 checks passed
@theahura theahura deleted the auto/vim-mode-enter-key-behavior-20260309-211316 branch March 9, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant