claude-code - 💡(How to fix) Fix [FEATURE] jk escape sequence to exit vim insert mode [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#48538Fetched 2026-04-16 06:57:23
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Add support for jk (and optionally other user-configurable sequences) as an escape sequence to exit vim INSERT mode, similar to the common vim/neovim configuration:

inoremap jk <Esc>

This is already a repost of existing feature request. I decided to create a new issue as the original one is closed already. https://github.com/anthropics/claude-code/issues/13631

Proposed Solution

  1. Hard-coded jk sequence — simplest, covers the most common use case
  2. Configurable escape sequences in keybindings.json — a new VimInsert context with an vim:exitInsertMode action, allowing users to define their own sequences (e.g. jk, jj, kj)
  3. Read local ~/.vimrc for vim settings; and apply some of them which are relevant: e.g. inoremap jk <ESC>

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

Implementing a configurable escape sequence, such as jk, to exit vim INSERT mode can be achieved by adding a new VimInsert context with a vim:exitInsertMode action in the keybindings.json file.

Guidance

  • Review the proposed solutions, focusing on the configurable escape sequences approach, which seems to be the most flexible and user-friendly option.
  • Consider the trade-offs between hard-coding the jk sequence, allowing user configuration, and reading local ~/.vimrc files for vim settings.
  • Evaluate the feasibility of implementing a new VimInsert context with a vim:exitInsertMode action, as this would enable users to define their own custom escape sequences.
  • Investigate how to properly handle conflicts between user-defined escape sequences and existing keybindings.

Example

No specific code example is provided, as the implementation details depend on the chosen approach and the specific requirements of the project.

Notes

The solution should be designed with flexibility and customizability in mind, allowing users to define their own escape sequences while avoiding conflicts with existing keybindings.

Recommendation

Apply a workaround by implementing a configurable escape sequence using the keybindings.json file, as this approach offers the most flexibility and user control. This allows users to define their own custom escape sequences, such as jk, to exit vim INSERT mode.

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