rime.nvim

ㄓ rime for neovim

GPL-3.0 License

Stars
2
Committers
1

rime.nvim

Rime for neovim.

Like coc-rime. However, use lua not javascript.

Dependence

# Ubuntu
sudo apt-get -y install librime-dev librime1
sudo apt-mark auto librime-dev
# ArchLinux
sudo pacman -S librime
# Android Termux
apt-get -y install librime
# Nix
# use nix-shell to create a virtual environment then build
# homebrew
brew tap tonyfettes/homebrew-rime
brew install librime pkg-config
# Windows msys2
pacboy -S --noconfirm pkg-config librime gcc

Install

rocks.nvim

Command style

:Rocks install rime.nvim

Declare style

~/.config/nvim/rocks.toml:

[plugins]
"rime.nvim" = "scm"

Then

:Rocks sync

or:

$ luarocks --lua-version 5.1 --local --tree ~/.local/share/nvim/rocks install rime.nvim
# ~/.local/share/nvim/rocks is the default rocks tree path
# you can change it according to your vim.g.rocks_nvim.rocks_path

Configure

Refer config.lua:

require('rime.nvim').setup({
    -- ...
})

Set keymap:

vim.keymap.set('i', '<C-^>', require('rime.nvim').toggle)

Once it is enabled, any printable key will be passed to rime in any case while any non-printable key will be passed to rime only if rime window is opened. If you want to pass a key to rime in any case, try:

vim.keymap.set('i', '<C-\\>', require('rime.nvim'):callback('<C-\\>'))

It is useful for some key such as the key for switching input schema.

Once you switch to ascii mode of rime, you cannot switch back unless you have defined any hotkey to pass the key for switching ascii mode of rime to rime. Because only printable key can be passed to rime when rime window is closed.

Integration

nvim-cmp

Like cmp-rime:

require('cmp').setup {
  -- ...
  sources = {
    -- ...
    { name = 'rime' }
  }
}

Similar Projects