Smart per-buffer IME switching for Neovim.
-
Per-buffer IME state
Remembers input method state separately for each buffer. -
Automatic IME switching
- Switches to English when leaving Insert mode
- Restores previous IME when re-entering Insert mode
-
Focus-aware normalization
Ensures IME state is consistent when Neovim regains focus. -
Async & non-blocking
Usesvim.system()for asynchronous IME querying and switching. -
Optional logging
Integrates withlogger.nvimwhen available. -
Minimal & predictable behavior
Reacts only to editor events, no background polling.
- On
InsertLeave, the current IME state is queried and saved per buffer. - IME is switched to English to ensure normal-mode safety.
- On
InsertEnter, the previously saved IME state is restored. - On focus gain (
FocusGained), IME state is normalized based on current mode.
Using nvim-plug:
return {
'wsdjeg/smart-ime.nvim',
opts = {
imselect = '~/bin/im-select-mspy.exe',
},
}