Requirement
April 25, 2026 ยท View on GitHub
db source for ZSaberLv0/ZFVimIM, using thirdparty's openapi
Requirement
ZSaberLv0/ZFVimIM, of courseZSaberLv0/ZFVimJob, andZFJobAvailable()must return 1- a builtin fallback is also implemented, enable it by
let g:ZFVimIM_openapi_jobFallback = 1, but it may cause lag if noZFJobAvailable()support
- a builtin fallback is also implemented, enable it by
wgetorcurlorpythondepends on impl
How to use
Plug 'ZSaberLv0/ZFVimIM'
Plug 'ZSaberLv0/ZFVimJob' " ZFVimJob is required for this db repo
Plug 'ZSaberLv0/ZFVimIM_openapi'
" choose impl you like
" let g:ZFVimIM_openapi_baidu = 1
" let g:ZFVimIM_openapi_baidu_xiaohe = 1
" let g:ZFVimIM_openapi_sougou = 1
once installed, input freely and see the changes
Configs
let g:ZFVimIM_openapi_enable = 1: once installed,wgetorcurlwould be invoked each time you input something, if you want to disable it temporarily, you may change this optionlet g:ZFVimIM_openapi_limit_req = 150: limit request by a certain delaylet g:ZFVimIM_openapi_word_type = 'sentence': within the IME popup, where to place the result, see alsoZFVimIM_complete()sentence: (default) placed at first ofsentencetype, which result to top of everythingpredict: placed at first ofpredicttypematch: placed accorrding tog:ZFVimIM_crossDbPos
How it works
if you are interested on how to implement async mode of ZFVimIM's db, here's a workflow of it
user input
=> ZFVimIM_complete()
=> start curl job
=> directly return empty result
...
=> curl job returned
=> save as cache
=> ZFVimIME_keymap_update_i() to re-trigger IME popup
=> ZFVimIM_complete()
=> matched from cache, return result