|
- let g:input_toggle = 0
- func! Fcitx2en()
- let s:input_status = system("fcitx-remote")
- if s:input_status == 2
- let g:input_toggle = 1
- let l:a = system("fcitx-remote -c")
- endif
- endfunc
- func! Fcitx2zh()
- let s:input_status = system("fcitx-remote")
- if s:input_status != 2 && g:input_toggle == 1
- let l:a = system("fcitx-remote -o")
- let g:input_toggle = 0
- endif
- endfunc
- set timeoutlen=150
- au! InsertLeave * call Fcitx2en()
- au! InsertEnter * call Fcitx2zh()
复制代码
这种方法使nerdcommenter的许多功能无法使用,能否避免设置timeoutlen,同时实现与上述代码等效的功能? |
|