feat(comment): Alt+Enter accepts and Alt+Esc discards the vim comment#440
Merged
Merged
Conversation
…ent box In the vim comment editor, Alt+Enter (Option+Enter) saves the comment and Alt+Esc cancels it directly, from any sub-mode — no double-press. Alt is the one modified Enter/Esc that reaches the app across terminals, including browser/web terminals like zellij web (where Shift/Cmd+Enter get stripped or grabbed by the browser). Plain Enter still inserts a newline in vim Insert mode, so Alt+Enter is free to mean "accept". The default (non-vim) box is unchanged (Alt+Enter stays a newline there). Complements the existing :w/:q, double Enter/Esc, and Ctrl-S.
thiblahute
force-pushed
the
comment-shift-accept-discard
branch
from
June 26, 2026 22:16
3083a67 to
0db978d
Compare
agavra
approved these changes
Jun 29, 2026
1 task
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.
What
In the vim comment editor (
comment_vim = true), a quick accept/discard with no double-press:Alt+Enter(Option+Enter) → accept (save the comment)Alt+Esc→ discard (cancel)This complements the existing ways to finish a comment:
:w/:q, double-Enter/Esc, andCtrl-S. The default (non-vim) comment box is unchanged —Alt+Enterstays a newline there.Implementation
handle_comment_vim_key(vim box only):Alt+Enter→save_comment,Alt+Esc→exit_comment_mode.docs/KEYBINDINGS.mdupdated.Testing
cargo build,cargo fmt --check,cargo clippy --all-targets(0 warnings),cargo test(0 failures). Manually confirmedAlt+Entersaves in zellij web.