Skip to content

feat: add mode-change hook for automatic IME switching#24

Open
aizigao wants to merge 1 commit into
lajarre:mainfrom
aizigao:main
Open

feat: add mode-change hook for automatic IME switching#24
aizigao wants to merge 1 commit into
lajarre:mainfrom
aizigao:main

Conversation

@aizigao
Copy link
Copy Markdown

@aizigao aizigao commented May 21, 2026

Run an external shell command on every NORMAL <-> INSERT transition so users can switch input methods automatically (e.g. Rime <-> ABC via im-select), preventing Chinese IME from interfering with vim navigation.

  • Add piVim.modeChange config (insert/normal keys) read from ~/.pi/agent/settings.json or project .
  • Emit pi-vim:mode-change on pi.events for other extensions to subscribe
  • Update README.md with the configure section

in pi settings

"piVim": {
  "modeChange": {
    "insert": "im-select im.rime.inputmethod.Squirrel.Hans",
    "normal": "im-select com.apple.keylayout.ABC"
  }
}

Most of the code is written in Claude Opus with Pi coding agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant