keaising / im-select.nvim

Switch Input Method automatically depends on Neovim's edit mode
MIT License
186 stars 27 forks source link

Switch to default not work right for MS Pinyin #32

Open rickywu opened 3 months ago

rickywu commented 3 months ago

here is my config

return function()
    require('im_select').setup({
        -- IM will be set to `default_im_select` in `normal` mode
        -- For Windows/WSL, default: "1033", aka: English US Keyboard
        -- For macOS, default: "com.apple.keylayout.ABC", aka: US
        -- For Linux, default:
        --               "keyboard-us" for Fcitx5
        --               "1" for Fcitx
        --               "xkb:us::eng" for ibus
        -- You can use `im-select` or `fcitx5-remote -n` to get the IM's name
        default_im_select  = "2052",

        -- Can be binary's name, binary's full path, or a table, e.g. 'im-select',
        -- '/usr/local/bin/im-select' for binary without extra arguments,
        -- or { "AIMSwitcher.exe", "--imm" } for binary need extra arguments to work.
        -- For Windows/WSL, default: "im-select.exe"
        -- For macOS, default: "im-select"
        -- For Linux, default: "fcitx5-remote" or "fcitx-remote" or "ibus"
        default_command = { "AIMSwitcher.exe", "--imm" },

        -- Restore the default input method state when the following events are triggered
        set_default_events = { "VimEnter", "FocusGained", "InsertLeave", "CmdlineLeave" },

        -- Restore the previous used input method state when the following events
        -- are triggered, if you don't want to restore previous used im in Insert mode,
        -- e.g. deprecated `disable_auto_restore = 1`, just let it empty
        -- as `set_previous_events = {}`
        set_previous_events = { "InsertEnter" },

        -- Show notification about how to install executable binary when binary missed
        keep_quiet_on_no_binary = false,

        -- Async run `default_command` to switch IM or not
        async_switch_im = true
    })
end

AIMSwitcher.exe --imm 2052 change to english mode for MS Pinyin, 1025 is Chinese mode. But after leave insert mode, it change to Chinese mode I have to change MS Yinpin default method to Englith in Windows settings, then it works well, is this right?

keaising commented 1 month ago

Try swapping the 1025 with the 2052? I have a feeling you may have got it backwards?