[FEATURE] Vim mode: input method auto-switch on mode change (langmap/im-select support for CJK users)
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:
- Type in Korean (INSERT mode)
- Press Esc → NORMAL mode
- Manually switch to English input
- Execute vim command (e.g.,
dd,w,yy) - Press
i→ INSERT mode - Manually switch back to Korean input
- 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:
- keaising/im-select.nvim (324+ stars)
- brglng/vim-im-select (118+ stars)
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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗