https://github.com/rimeinn/rime.nvim
ㄓ rime for neovim
https://github.com/rimeinn/rime.nvim
lua neovim rime vim xmake
Last synced: 5 months ago
JSON representation
ㄓ rime for neovim
- Host: GitHub
- URL: https://github.com/rimeinn/rime.nvim
- Owner: rimeinn
- License: gpl-3.0
- Created: 2024-07-09T13:41:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-12T07:10:53.000Z (6 months ago)
- Last Synced: 2025-08-12T09:11:56.449Z (6 months ago)
- Topics: lua, neovim, rime, vim, xmake
- Language: Lua
- Homepage: https://rime-nvim.readthedocs.io/
- Size: 185 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rime.nvim
[](https://rime-nvim.readthedocs.io)
[](https://results.pre-commit.ci/latest/github/rimeinn/rime.nvim/main)
[](https://github.com/rimeinn/rime.nvim/actions)
[](https://github.com/rimeinn/rime.nvim/releases)
[](https://github.com/rimeinn/rime.nvim/releases/latest)
[](https://github.com/rimeinn/rime.nvim/issues)
[](https://github.com/rimeinn/rime.nvim/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/rimeinn/rime.nvim/pulls)
[](https://github.com/rimeinn/rime.nvim/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/rimeinn/rime.nvim/discussions)
[](https://github.com/rimeinn/rime.nvim/milestones)
[](https://github.com/rimeinn/rime.nvim/network/members)
[](https://github.com/rimeinn/rime.nvim/stargazers)
[](https://github.com/rimeinn/rime.nvim/watchers)
[](https://github.com/rimeinn/rime.nvim/graphs/contributors)
[](https://github.com/rimeinn/rime.nvim/graphs/commit-activity)
[](https://github.com/rimeinn/rime.nvim/commits)
[](https://github.com/rimeinn/rime.nvim/releases/latest)
[](https://github.com/rimeinn/rime.nvim/blob/main/LICENSE)
[](https://github.com/rimeinn/rime.nvim)
[](https://github.com/rimeinn/rime.nvim)
[](https://github.com/rimeinn/rime.nvim)
[](https://github.com/rimeinn/rime.nvim)
[](https://github.com/rimeinn/rime.nvim)
[](https://github.com/rimeinn/rime.nvim)
[](https://luarocks.org/modules/rimeinn/rime.nvim)
Rime for neovim.
Like [coc-rime](https://github.com/tonyfettes/coc-rime).
However, use lua not javascript.

## Dependence
- [librime](https://github.com/rime/librime)
```sh
# 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 install librime pkg-config
# Windows msys2
pacboy -S --noconfirm pkg-config librime gcc
```
## Install
### rocks.nvim
#### Command style
```vim
:Rocks install rime.nvim
```
#### Declare style
`~/.config/nvim/rocks.toml`:
```toml
[plugins]
"rime.nvim" = "scm"
```
Then
```vim
:Rocks sync
```
or:
```sh
$ 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](https://rime-nvim.readthedocs.io/en/latest/modules/lua.rime.config.html):
```lua
require('rime.nvim').setup({
-- ...
})
```
Set keymap:
```lua
vim.keymap.set('i', '', 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:
```lua
vim.keymap.set('i', '', require('rime.nvim').callback(''))
```
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.
For cursor color,
```vim
set guicursor=n-v-c-sm:block-Cursor/lCursor,i-ci-ve:ver25-CursorIM/lCursorIM,r-cr-o:hor20-CursorIM/lCursorIM
```
```lua
require('rime.nvim').setup({
cursor = {
default = { bg = 'white' },
double_pinyin_mspy = { bg = 'red' },
japanese = { bg = 'yellow' }
}
})
```



## Integration
### [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
Like [cmp-rime](https://github.com/Ninlives/cmp-rime):
```lua
require('cmp').setup {
-- ...
sources = {
-- ...
{ name = 'rime' }
}
}
```
### [vim-airline](https://github.com/vim-airline/vim-airline/)
In insert/replace/select/... mode, it will display current input schema name.
You can customize it. Such as:
Only display input schema name in insert mode:
```lua
require('rime.nvim').setup({
get_new_symbol = function (old, name)
if old == M.airline_mode_map.i
return name
end
return old
end
})
```
See airline's `g:airline_mode_map` to know `i`, `R`, `s`, ...
Disable this feature:
```lua
require('rime.nvim').setup({
update_status_bar = function () end
})
```
## Tips
For Nix user, run
`/the/path/of/luarocks/rocks-5.1/rime.nvim/VERSION/scripts/update.sh` when
dynamic link libraries are broken after `nix-collect-garbage -d`.
## Related Projects
- [A collection](https://github.com/rimeinn/ime.nvim) of the solutions to
input CJKV characters in vim
- [A collection](https://github.com/rime/librime#frontends) of rime frontends