feat(tui): make vim mode Enter key behavior configurable#381
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vim_modeconfig with a three-wayVimEnterBehaviorenum: Enter is Newline, Enter is Submit, and Off/config, a sub-picker (like Auto Worktree) lets them choose how Enter behaves in INSERT vs NORMAL modevim_mode = truein config.toml automatically maps to Submit for backwards compatibilityDetails
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
vim_mode = truedeserializes as Submit,vim_mode = falseas Off