Repository navigation
Conversation
Implement 'w', 'b', and 'e' word motions in Vim mode and add is_vim_normal_mode() helper. Add unit tests covering visual-mode word motions and normal-mode detection. Rationale: improve Vim editing experience in the composer.
Add composer_in_vim_normal_mode() that delegates to the composer. Enables higher-level UI to gate behavior based on Vim normal mode.
Delegate composer_in_vim_normal_mode() through ChatWidget so top-level UI can check composer Vim state.
Wire the 't' key to open the transcript overlay when the composer is in Vim normal mode. Improves discoverability of transcript while using Vim bindings.
… other handlers) Unify page semantics so Ctrl-D/Ctrl-U perform full-page scrolling. Remove Ctrl-F/Ctrl-B and Ctrl-E/Ctrl-Y handlers and hints. Update pager key hints accordingly. Rationale: simplify and align pager behaviour for Vim mode; note this may affect users relying on previous handlers.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
It be amazing to have VIM mode in Codex 🙏 |
|
Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them. We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
|
@etraut-openai This was a clean PR addressing a very common feature for TUI coding agents. This is not a way to treat customers. This convinces me of cancelling my ChatGPT subscription. Migrating to Claude. |
|
I'd love to see this in codex as well - this is my biggest missing feature / gripe with codex. |
Fixes #104, #3115, and #155
Currently throughout the Codex CLI, keymaps are kinda inclined towards emac users with the usage of
Ctrlfor most of the actions. This PRs introduces a focused, minimal Vim keybinding mode for the Codex CLI composer, with the core motions and operators needed for prompt editing. The implementation is deliberately small in scope and localized, so it’s easy to review, reason about, and maintain. This ships a single configuration flag, keeps state inside the composer, and exposes a tiny API to let the rest of the TUI react to “Vim Normal” when needed.Motivation
I assumed, there are many vim users like me who want's codex to have vim motion and i'm to used to vim motions in my workflow.
What’s included (foundational scope)
Modes
v,V) conceptually, enabling apply-an-operator-to-the-selection workflows.Core motions & edits
w,b,ein Normal/Visual contexts. These follow Vim semantics (next word start, previous word start, end of word) so operators compose naturally.0and$to jump to start/end of line; used with operators.dwith motions such asdw,d0,d$. The implementation models “operator-pending” state and resolves once a motion arrives.Minimal app integration for a better UX
topens the transcript overlay only when the composer is in Vim Normal mode—making discovery easy for keyboard-centric users without changing default behavior for others.Ctrl-D/Ctrl-Uto feel consistent with Vim-style paging (removes legacy handlers that conflicted with this mental model).Configuration (tiny surface area)
A single enum controls keybinding style across the TUI:
KeybindingModeis added toconfig_typesand threaded throughTui→ composer/overlay; default remains Emacs, so behavior is unchanged unless explicitly enabled.Design notes (maintainability first)
VimState { mode, pending, clipboard }sits inside the composer. Only a small helper (composer_in_vim_normal_mode()) is exposed for higher-level UI decisions (e.g., to gate transcript open ont)./vim), cheatsheet views, toasts, or broader config refactors. It stays focused on the editing model; those can follow as separate, opt-in enhancements if maintainers want them. (For contrast, the other open PR introduces/vim, footer labels, a cheatsheet, and doc churn.)UX overview
Escto enter Normal, use motions to move/select, then apply operators (d+ motion for now). Enter Insert with standard keys (e.g.,i,a, etc. where applicable in this scope) and type as usual. Visual/Visual-Line allow selecting before acting.vim-motion.mp4
tbrings up the transcript quickly for keyboard-first navigation. Pager scrolling mirrors Vim expectations forCtrl-D/Ctrl-U.transcript.mp4
keybinding_mode = "vim".Tests & how to try it
keybinding_mode = "vim", launch the TUI, and validatew/b/e,0/$,dw/d0/d$, Visual/Visual-Line selections,Esc↔Insert/Normal,tfor transcript, and pagerCtrl-D/Ctrl-U.Backwards compatibility & risk
Follow-ups (separate PRs can be feasable, but I don't think needed)
3w,2dd), additional operators (y,c,p), and Visual-Block mode./vim) or mode indicator in the footer—kept out of this foundational PR to minimize surface area. (See the other PR for a reference approach if we decide to go there later.)