Rime input method integration of coc.nvim
This extension is created by create-coc-extension
This project is consist of two parts:
- A nodejs binding of librime
- A librime frontend on coc.nvim
For build, need extra them:
# Ubuntu
sudo apt-get -y install pkg-config librime-dev librime1 xmake
sudo apt-mark auto librime-dev pkg-config xmake
# ArchLinux
sudo pacman -S pkg-config librime xmake
# Android Termux
apt-get -y install pkg-config librime xmake
# Nix
# without any extra operation
# homebrew
brew install pkg-config librime xmake
# Windows msys2
pacboy -S --noconfirm pkg-config librime gcc xmake- coc-marketplace
- npm
- vim:
" command line
CocInstall coc-rime
" or add the following code to your vimrc
let g:coc_global_extensions = ['coc-rime', 'other coc-plugins']import {
Session
} from 'coc-rime/session';
import {
UI
} from 'coc-rime/ui';
let session = new Session();
let ui = new UI();
if (not session.process_key('n'.charCodeAt(0), 0))
throw Error;
let context = session.get_context();
if (context === null)
throw Error;
let content, _ = ui.draw(context);
console.log(content.join("\n"));n|
[① 你]② 那 ③ 呢 ④ 能 ⑤ 年 ⑥ 您 ⑦ 内 ⑧ 拿 ⑨ 哪 ⓪ 弄 |>
rime.source.enable: enable this source temporarily.rime.source.disable: disable this source temporarily.rime.source.toggle: temporarily toggle the status of the source.rime.enable: enable this IME temporarily.rime.disable: disable this IME temporarily.rime.toggle: toggle this IME temporarily.
You could use CocList to switch between schema.
:CocList rime_schemarime.enabled: Whether to enable this source.rime.priority: The priority of this completion source.rime.schemaId: TheschemaIdselected whencoc-rimestart. You could get it fromrime_schemalist.rime.priority: Priority of Rime completion sourcerime.traits.shared_data_dir: Path(s) where rime data storesrime.traits.user_data_dir: Path(s) where rime configuration storesrime.traits.*: More rime traitsrime.ui.*: The symbols used for IME UI
- It will break all
imap <Buffer>created by other plugins, such as vim-peekaboo's<C-R>.
MIT
- rime.nvim: lua implementation. Active maintenance.