Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add an Option to Disable Restoring the Previous IM when Re-entering Insert Mode #18

Open
Blacktea0 opened this issue Feb 7, 2025 · 2 comments

Comments

@Blacktea0
Copy link

I wonder if an option like :set keep-english-in-normal in ideavim_extension could be added.
Currently, I can achieve it via following script in my .vimrc. However, as you can see, it is exceedingly long while the script is shared across different OS.

" IM Select, always restore default IM
if has('win32')
    let g:im_select_command = $HOME.'\.vim\im-select.exe'
    let g:im_select_default = '1033'
    let g:im_select_get_im_cmd = [g:im_select_command]
    let g:ImSelectSetImCmd = {key -> [g:im_select_command, g:im_select_default]}
elseif has('wsl')
    let g:im_select_command = $HOME.'/.vim/im-select.exe'
    let g:im_select_default = '1033'
    let g:im_select_get_im_cmd = [g:im_select_command]
    let g:ImSelectSetImCmd = {key -> [g:im_select_command, g:im_select_default]}
else
    if executable('fcitx5-remote')
        let g:im_select_get_im_cmd = ['fcitx5-remote']
        let g:ImSelectSetImCmd = { key -> ['fcitx5-remote', '-c'] }
        if !exists('g:im_select_default')
            let g:im_select_default = '1'
        endif
    elseif executable('fcitx-remote')
        let g:im_select_get_im_cmd = ['fcitx-remote']
        let g:ImSelectSetImCmd = { key -> ['fcitx-remote', '-c'] }
        if !exists('g:im_select_default')
            let g:im_select_default = '1'
        endif
    elseif executable('ibus')
        if !exists('g:im_select_default')
            let g:im_select_default = 'xkb:us::eng'
        endif
        let g:im_select_get_im_cmd = ['ibus', 'engine']
        let g:ImSelectSetImCmd = {key -> ['ibus', 'engine', g:im_select_default]}
    endif
endif
@brglng
Copy link
Owner

brglng commented Feb 7, 2025

@Blacktea0 Do you mean you want switching to English only on InsertLeave, but not on InsertEnter?

@Blacktea0
Copy link
Author

Not exactly. I want to switch to English on InsertLeave, but not switch back to the previous IM on InsertEnter.

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

No branches or pull requests

2 participants