TUI Vim mode: allow starting in Insert mode by default

Open 💬 7 comments Opened May 9, 2026 by Contextualist
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

Please add an option for Vim mode to start in Insert mode by default, while still allowing users to press Esc to enter Normal mode.

Currently, enabling Vim mode permanently starts the composer in Normal mode. I would prefer a config option such as:

[tui]
vim_mode_default = true
vim_mode_initial_state = "insert"

or similar.

Motivation

Most TUI interactions begin with writing a new prompt, and only optionally editing that prompt afterward. Starting in Insert mode matches that common flow better while preserving Vim-style editing when needed.
This would also match the behavior of “vi mode” in shells like Bash: the prompt starts ready for text input, and users can press Esc to switch into Normal mode for editing.

Related issue: #21804

Additional information

_No response_

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #21804

Powered by Codex Action

MartinLoeper · 3 months ago

actually, claude does the same and IMHO this totally makes sense. someone has to come up with a usecase to start in normal mode to convince me of the opposite. anyways, thanks for opening this issue!

galah92 · 3 months ago

While doing so, if we can avoid changing the cursor shape in Normal/Insert mode (or make it configurable) it would be great.

gerrywastaken · 3 months ago

You probably don't want to just update to initial state but the after submit state

[tui]
vim_mode_default = true
vim_mode_initial_state = "insert"
vim_mode_after_submit = "insert"
ma11hew28 · 1 month ago

Why would anyone not want to start in insert mode for new messages?

  1. Just make this the default behavior
  2. Don't add a config option for it
jzila · 14 days ago

I put together a focused, one-commit reference implementation for this and the common follow-up-prompt case discussed in #21804.

Since external PRs are invitation-only, I’m sharing the branch in a form that can be reviewed, cherry-picked, or converted into an internal PR:

The configuration is scoped under the mode:

[tui]
vim_mode_default = true

[tui.modes.vim]
insert_mode_default = true

tui.vim_mode_default continues to enable Vim operations. The new setting only controls how enabled Vim mode behaves:

  • false preserves the existing Normal-mode default.
  • true starts fresh composer messages in Insert mode.
  • After a successful or queued submission, the composer returns to that configured default.

For #21804 specifically, this makes each follow-up prompt ready for typing when the configured default is Insert. It deliberately returns to the configured default rather than preserving an arbitrary previous mode.

Coverage includes config parsing/round-tripping, generated schema, startup behavior, post-submit behavior, and the visible footer mode. The patch passed all 255 codex-config tests and all 3,521 codex-tui tests, plus scoped lint and formatting.

If the preferred product decision is to make Insert unconditional rather than configurable, or to use a string-valued mode instead of a boolean, this patch should be straightforward to adapt.

Would a maintainer like to adopt/cherry-pick this internally, or explicitly invite the focused PR?

tonykay · 1 day ago

Coming from Claude Code cli its very frustrating not being able to just start prompting, it would seem natural that you would by default (or by configuration) be able to start in insert mode