claude-code - 💡(How to fix) Fix [Feature Request] Allow remapping vim-mode insert-exit key (e.g. jk/jj → Esc) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53039Fetched 2026-04-25 06:14:01
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Claude Code's built-in vim editor mode hardcodes Esc as the only way to exit INSERT mode. There's no way to remap this to a common alternative like jk or jj, which many vim users configure via inoremap jk <Esc> in their .vimrc.

Root Cause

Claude Code's built-in vim editor mode hardcodes Esc as the only way to exit INSERT mode. There's no way to remap this to a common alternative like jk or jj, which many vim users configure via inoremap jk <Esc> in their .vimrc.

Code Example

{
     "editorMode": "vim",
     "vim": {
       "insertExitSequence": "jk"
     }
   }
RAW_BUFFERClick to expand / collapse

Summary

Claude Code's built-in vim editor mode hardcodes Esc as the only way to exit INSERT mode. There's no way to remap this to a common alternative like jk or jj, which many vim users configure via inoremap jk <Esc> in their .vimrc.

Current behavior

  • Enable vim mode: /config → Editor mode → vim (persists as "editorMode": "vim" in ~/.claude/settings.json).
  • The only way to exit INSERT → NORMAL is pressing Esc.
  • ~/.claude/keybindings.json does not expose any vim-mode actions, so it can't be used to rebind this.
  • Claude Code does not read the user's system .vimrc.

Desired behavior

A way to configure a custom insert-mode exit sequence. Two reasonable shapes:

  1. A dedicated setting in settings.json, e.g.:
    {
      "editorMode": "vim",
      "vim": {
        "insertExitSequence": "jk"
      }
    }
  2. Expose vim actions in keybindings.json (e.g. vim:exitInsert) so users can bind arbitrary keys/chords the same way other actions work.

Option 1 is simpler and covers the overwhelmingly common case (single two-key sequence). Option 2 is more flexible but a bigger surface.

Why it matters

For users with years of muscle memory mapping jk/jj to escape, reaching for the physical Esc key in Claude Code's prompt is a constant friction point — it's the one vim surface on their machine that doesn't honor the mapping. Since Claude Code already ships a vim mode, supporting the most common .vimrc escape remap would close a visible gap without needing full .vimrc parsing.

Related issues

  • #16778 — Ctrl+[ as escape in NORMAL (regression)
  • #10621 — double-Esc requirement in Plan Mode Q&A
  • #2588 — Enter behavior in INSERT
  • #42533 — configurable editor keybindings (covers external Ctrl+G editor, not the in-TUI vim mode)

None of these cover remapping the insert-exit key itself.

extent analysis

TL;DR

To address the issue, consider adding a dedicated setting in settings.json to allow customizing the insert-mode exit sequence in Claude Code's vim mode.

Guidance

  • Review the proposed solutions in the issue, specifically the dedicated setting in settings.json or exposing vim actions in keybindings.json, to determine the best approach for implementing a custom insert-mode exit sequence.
  • Evaluate the trade-offs between simplicity (dedicated setting) and flexibility (exposing vim actions) when deciding on an implementation path.
  • Consider the muscle memory and workflow implications for users accustomed to specific vim mappings, such as jk or jj, to exit insert mode.
  • Investigate whether any existing issues or pull requests address similar concerns or provide insights into potential solutions.

Example

{
  "editorMode": "vim",
  "vim": {
    "insertExitSequence": "jk"
  }
}

This example illustrates how a dedicated setting in settings.json could be structured to support custom insert-mode exit sequences.

Notes

The solution should ideally balance user customization needs with the complexity of implementing and maintaining such a feature, considering the existing vim mode and potential future enhancements.

Recommendation

Apply a workaround by awaiting or contributing to the implementation of a dedicated setting in settings.json, as it seems to be the most straightforward solution to address the common use case of customizing the insert-mode exit sequence.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Allow remapping vim-mode insert-exit key (e.g. jk/jj → Esc) [1 comments, 2 participants]