{"id":13571793,"url":"https://github.com/ZSaberLv0/ZFVimIM","last_synced_at":"2025-04-04T08:32:28.419Z","repository":{"id":41974374,"uuid":"197002765","full_name":"ZSaberLv0/ZFVimIM","owner":"ZSaberLv0","description":"vim输入法 / Vim Input Method by pure vim script, support: user word, dynamic word priority, cloud db files","archived":false,"fork":false,"pushed_at":"2024-11-01T14:19:24.000Z","size":442,"stargazers_count":203,"open_issues_count":0,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-01T15:23:58.456Z","etag":null,"topics":["input-method","vim-script","vimim","zfvimim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZSaberLv0.png","metadata":{"files":{"readme":"README.CN.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"ZSaberLv0","issuehunt":"ZSaberLv0","custom":["https://github.com/ZSaberLv0/ZSaberLv0"]}},"created_at":"2019-07-15T13:20:06.000Z","updated_at":"2024-11-01T14:19:28.000Z","dependencies_parsed_at":"2024-01-05T10:36:18.442Z","dependency_job_id":"59150590-da83-46d9-97e0-9bda5a8ebaf8","html_url":"https://github.com/ZSaberLv0/ZFVimIM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimIM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimIM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimIM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimIM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZSaberLv0","download_url":"https://codeload.github.com/ZSaberLv0/ZFVimIM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223118367,"owners_count":17090259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["input-method","vim-script","vimim","zfvimim"],"created_at":"2024-08-01T14:01:06.431Z","updated_at":"2025-04-04T08:32:28.402Z","avatar_url":"https://github.com/ZSaberLv0.png","language":"Vim Script","funding_links":["https://patreon.com/ZSaberLv0","https://issuehunt.io/r/ZSaberLv0","https://github.com/ZSaberLv0/ZSaberLv0"],"categories":["Vim Script"],"sub_categories":[],"readme":"\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [简介](#简介)\n* [推荐配置](#推荐配置)\n    * [纯本地词库](#纯本地词库)\n    * [云词库](#云词库)\n* [使用](#使用)\n* [一些使用技巧](#一些使用技巧)\n* [疑难杂症](#疑难杂症)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n# 简介\n\nvim 上的输入法, 特色:\n\n* 支持自动 pull/push 词库到 gayhub 哦不 github\n* 支持异步调用外部云输入法 (目前支持百度输入法)\n* 动态组词, 动态词频, 长句输入\n* 支持挂各种大词库, 支持多词库混输, 中英日甚至颜文字都行, 只要能按格式提供词库\n* 辣鸡环境可以回退到纯 vim script 版本, 最低支持 vim 7.3,\n    当然也支持无网络纯本地使用\n\n\n(防杠补丁) Why not 系统输入法:\n\n* vim 的一大优势就是 ssh 到处都能用, 至少大多数 ssh 环境用系统输入法都很蛋疼\n* `inoremap jk \u003cesc\u003e` 流派的福音\n\n\n词库同步及长句输入:\n\n![](https://raw.githubusercontent.com/ZSaberLv0/ZFVimIM/master/preview.gif)\n\n\n多词库混输: (不卡, gif 图的问题, 懒得重新搞了 `(- -b)`)\n\n![](https://raw.githubusercontent.com/ZSaberLv0/ZFVimIM/master/preview_crossdb.gif)\n\n\n如果你喜欢本插件, 给开发者[买个煎饼补补脑](https://github.com/ZSaberLv0/ZSaberLv0),\n或者看看其它[好玩的插件](https://github.com/ZSaberLv0?utf8=%E2%9C%93\u0026tab=repositories\u0026q=ZFVim)\n\n\n# 推荐配置\n\n* 中文帮助只列举推荐配置和基本操作 (足够日常使用),\n    详细配置等请移步 [README](https://github.com/ZSaberLv0/ZFVimIM/blob/master/README.md)\n    (别问为啥, 问就是懒)\n* 如果你也是个懒人, 只想先快速体验一下,\n    可以先试试[纯本地词库](https://github.com/ZSaberLv0/ZFVimIM/blob/master/README.CN.md#%E7%BA%AF%E6%9C%AC%E5%9C%B0%E8%AF%8D%E5%BA%93),\n    当然个人建议还是: 轻量词库 + 自造词 + 百度云输入,\n    按照下文推荐配置花点时间即可实现\n\n\n## 纯本地词库\n\n虽然重点功能之一是自动同步词库, 但纯本地跑也是可以的\n\n1. 推荐环境:\n\n    * (可选) vim8 或 neovim, 用于提升词库加载性能\n    * (可选) `executable('python')` 或者 `executable('python3')`, 用于提升词库加载性能\n\n1. 推荐安装\n\n    ```\n    Plugin 'ZSaberLv0/ZFVimIM'\n    Plugin 'ZSaberLv0/ZFVimJob' \" 可选, 用于提升词库加载性能\n    ```\n\n1. 准备你的词库文件,\n    也可以从 [db samples](https://github.com/ZSaberLv0/ZFVimIM#db-samples)\n    中把 txt 词库文件复制到任意目录\n1. 配置\n\n    ```\n    function! s:myLocalDb()\n        let db = ZFVimIM_dbInit({\n                    \\   'name' : 'YourDb',\n                    \\ })\n        call ZFVimIM_cloudRegister({\n                    \\   'mode' : 'local',\n                    \\   'dbId' : db['dbId'],\n                    \\   'repoPath' : '/path/to/repo', \" 词库路径\n                    \\   'dbFile' : '/YourDbFile', \" 词库文件, 相对 repoPath 的路径\n                    \\   'dbCountFile' : '/YourDbCountFile', \" 非必须, 词频文件, 相对 repoPath 的路径\n                    \\ })\n    endfunction\n    if exists('*ZFVimIME_initFlag') \u0026\u0026 ZFVimIME_initFlag()\n        call s:myLocalDb()\n    else\n        autocmd User ZFVimIM_event_OnDbInit call s:myLocalDb()\n    endif\n    ```\n\n\n## 云词库\n\n1. 推荐环境:\n\n    * (可选) vim8 或 neovim, 用于提升词库加载性能\n    * (可选) `executable('python')` 或者 `executable('python3')`, 用于提升词库加载性能\n\n1. 参照 [db samples](https://github.com/ZSaberLv0/ZFVimIM#db-samples) 创建自己的词库,\n    或 fork 以下词库:\n\n    * 拼音 (单字词库): [ZSaberLv0/ZFVimIM_pinyin_base](https://github.com/ZSaberLv0/ZFVimIM_pinyin_base)\n        : 仅包含单字, 无词组, 由于词库和个人使用有关, 本插件的自动组词算法毕竟比不上专业的输入法,\n        用大词库容易一堆废词, 因此比较建议从单字词库慢慢组词使用\n    * 拼音 (大词库): [ZSaberLv0/ZFVimIM_pinyin_huge](https://github.com/ZSaberLv0/ZFVimIM_pinyin_huge)\n        : 大词库, 可能包含一堆废词, 主要丢这边给各位测测使用体验和性能\n    * 拼音: [ZSaberLv0/ZFVimIM_pinyin](https://github.com/ZSaberLv0/ZFVimIM_pinyin)\n        : 个人在用词库, 时不时 `git push --force`\n    * 五笔: [ZSaberLv0/ZFVimIM_wubi_base](https://github.com/ZSaberLv0/ZFVimIM_wubi_base)\n        : [ywvim](https://github.com/vim-scripts/ywvim) 转换来的词库, 我对五笔不熟, 各位自行尝试\n    * 英语: [ZSaberLv0/ZFVimIM_english_base](https://github.com/ZSaberLv0/ZFVimIM_english_base)\n        : 一些基本的英语单词\n    * 日语: [ZSaberLv0/ZFVimIM_japanese_base](https://github.com/ZSaberLv0/ZFVimIM_japanese_base)\n        : 一些基本的日语单词\n\n1. 到 [access tokens](https://github.com/settings/tokens) 配置一个合适的 token,\n    并确保对词库 repo 有 push 权限 (`Select scopes` 中勾选 `repo`)\n1. 根据你的词库, 配置相应的 access token, 例如上述词库可以用:\n\n    ```\n    let g:zf_git_user_email='YourEmail'\n    let g:zf_git_user_name='YourUserName'\n    let g:zf_git_user_token='YourGithubAccessToken'\n    ```\n\n    具体请查看词库的说明或源码\n\n1. 安装:\n\n    ```\n    Plugin 'ZSaberLv0/ZFVimIM'\n    Plugin 'ZSaberLv0/ZFVimJob' \" 可选, 用于提升词库加载性能\n    Plugin 'ZSaberLv0/ZFVimGitUtil' \" 可选, 如果你希望定期自动清理词库 push 历史\n    Plugin 'YourUserName/ZFVimIM_pinyin_base' \" 你的词库\n    Plugin 'ZSaberLv0/ZFVimIM_openapi' \" 可选, 百度云输入法\n\n    \" 国内辣鸡网络, 可以尝试用这个镜像, 与 github 直接互通\n    \" 或者干脆用 gitee 等国内站点\n    Plugin 'https://githubfast.com/YourUserName/ZFVimIM_pinyin_base' \" 你的词库\n    ```\n\n\n# 使用\n\n* `;;` 开启或关闭输入法, `;:` 切换词库\n* `-` 和 `=` 翻页\n* `空格` 和 `0~9` 选词或组词\n* `[` 和 `]` 快速从词组选字\n* 输入过程中会自动组自造词, 也可以用 `;,` 或 `:IMAdd` 手动添加自造词,\n    `;.` 或 `:IMRemove` 删除自造词\n* 觉得好用, 记得给开发者[买个煎饼](https://github.com/ZSaberLv0/ZSaberLv0),\n    贫穷码农在线乞讨 `_(:з」∠)_`\n\n\n# 一些使用技巧\n\n* 可以在 `:h 'statusline'` 展示当前 IME 状态\n\n    ```\n    let \u0026statusline='%{ZFVimIME_IMEStatusline()}'.\u0026statusline\n    ```\n\n* 命令行和搜索中没法直接使用, 可以利用 `:h command-line-window`\n\n    ```\n    function! ZF_Setting_cmdEdit()\n        let cmdtype = getcmdtype()\n        if cmdtype != ':' \u0026\u0026 cmdtype != '/'\n            return ''\n        endif\n        call feedkeys(\"\\\u003cc-c\u003eq\" . cmdtype . 'k0' . (getcmdpos() - 1) . 'li', 'nt')\n        return ''\n    endfunction\n    cnoremap \u003csilent\u003e\u003cexpr\u003e ;; ZF_Setting_cmdEdit()\n    ```\n\n    用法: 在命令行输入过程中, 按 `;;` 进入 `command-line-window`, 在这里面可以用本插件进行输入\n\n* `:terminal` 中没法使用, 也可以利用 `:h command-line-window`\n\n    ```\n    if has('terminal') || has('nvim')\n        function! PassToTerm(text)\n            let @t = a:text\n            if has('nvim')\n                call feedkeys('\"tpa', 'nt')\n            else\n                call feedkeys(\"a\\\u003cc-w\u003e\\\"t\", 'nt')\n            endif\n            redraw!\n        endfunction\n        command! -nargs=* PassToTerm :call PassToTerm(\u003cq-args\u003e)\n        tnoremap ;; \u003cc-\\\u003e\u003cc-n\u003eq:a:PassToTerm\u003cspace\u003e\n    endif\n    ```\n\n    用法: 在 `:terminal` window 的 `Insert-mode` 下, 按 `;;` 进入 `command-line-window` 用本插件进行输入\n\n\n# 疑难杂症\n\n* 卡顿/加载慢? 请先检查 `call ZFVimIM_DEBUG_checkHealth()`,\n    需要 `ZFJobAvailable: 1` 以及 `python: 1`\n\n    * 1M 左右的词库正常配置的话应该几秒内能加载完成\n    * 10M 左右的大词库大约需要 5~30秒\n    * Windows 或 Cygwin 上相比于 Linux/Mac 可能会尤其慢, 建议排查:\n        * 看看是否有 360 等杀毒软件, 词库加载涉及很多 job 多线程操作,\n            杀毒软件可能每次都会扫描引起严重拖慢, 亲测加信任也无效\n        * 检查 `PATH` 是否有过多内容\n\n* 发现各种诡异现象, 请先按如下步骤排查:\n\n    1. 本插件依赖于 `lmap` 和 `omnifunc`,\n        `verbose set omnifunc?` 查看是否被其它插件修改了\n    1. 本插件没法和大多数补全插件共存,\n        默认会 [自动禁用和恢复](https://github.com/ZSaberLv0/ZFVimIM/blob/master/plugin/ZFVimIM_autoDisable.vim)\n        一些常见的补全插件,\n        如果你用的补全插件不在此列,\n        请先参照进行自动禁用和恢复, 看看是否有效果\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimIM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZSaberLv0%2FZFVimIM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimIM/lists"}