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

Support f F t T r commands #12

Open
yaohappiness opened this issue Jun 4, 2023 · 1 comment
Open

Support f F t T r commands #12

yaohappiness opened this issue Jun 4, 2023 · 1 comment

Comments

@yaohappiness
Copy link

gVim 对 f F t T r 等命令的支持非常得人性化,中文输入非常友好。按下 f 等命令后,输入法状态和插入模式的相同。结束命令回到普通模式,自动切换到英文输入法。

我尝试了一下,好像只有改写这些命令才能实现类似 gVim 的行为。vim-im-select 能不能支持这些命令?下面是我做的尝试:

nnoremap <silent> f <Cmd>call FindChar('f')<Cr>

function! FindChar(motion) abort
    " 切换到和插入模式相同的输入法状态

    " 调用原本的 f 命令
    let l:c = getcharstr()
    execute('normal! ' . a:motion . l:c)

    " 保存输入法状态,并切换回默认输入法
endfunction
@brg1ng
Copy link
Collaborator

brg1ng commented Aug 23, 2023

这个我需要研究一下,这个跟一些插件会有潜在冲突

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