[FEATURE] Vim mode: input method auto-switch on mode change (langmap/im-select support for CJK users)

Resolved 💬 2 comments Opened Feb 11, 2026 by elaus00 Closed Mar 11, 2026

Problem

When using vim mode with non-Latin input methods (Korean, Chinese, Japanese),
users must manually switch to English input every time they press Esc to
enter NORMAL mode. Without switching, keys like i, d, w are sent as
Korean characters (ㅑ, ㅇ, ㅈ) and vim commands don't work.

This creates constant friction:

  1. Type in Korean (INSERT mode)
  2. Press Esc → NORMAL mode
  3. Manually switch to English input
  4. Execute vim command (e.g., dd, w, yy)
  5. Press i → INSERT mode
  6. Manually switch back to Korean input
  7. Continue typing

Steps 3 and 6 break the flow entirely.

Proposed Solution

Support automatic input method switching on vim mode transitions,
similar to how popular vim plugins handle this:

Option A: Built-in im-select integration

On mode change, call im-select (if installed) to switch input method:

  • INSERT → NORMAL: save current IM, switch to English (com.apple.keylayout.ABC)
  • NORMAL → INSERT: restore saved IM

Option B: Built-in langmap support

Map non-Latin characters to Latin equivalents in NORMAL mode (like vim's langmap),
so Korean input is interpreted as English commands without switching:

ㅑ→i, ㅁ→a, ㅇ→d, ㅈ→w, ㄷ→e, ...

Option C: Expose vim mode hooks

Allow keybindings.json to define shell commands on vim mode transitions:

{
  "context": "Chat",
  "bindings": {
    "vim:normalEnter": "shell:im-select com.apple.keylayout.ABC",
    "vim:insertEnter": "shell:im-select com.apple.inputmethod.Korean.2SetKorean"
  }
}

Impact

This affects all CJK (Chinese, Japanese, Korean) users of vim mode —
a significant portion of the developer community. The same pain point
has driven 440+ stars across vim/neovim plugin ecosystem.

Environment

  • OS: macOS
  • Input method: Korean 2-Set
  • Claude Code vim mode enabled via /vim

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗