This plugin aims at providing offline translations either on-demand and/or automatically when hovering asian (japanese for now) characters.
The name is inspired by the great browser rikaitan plugin. 理解 ("rikai") translates to "understanding", "comprehension".
Here are some possibly outdated screenshots:
- Popup for a kanji
- popup for an expression, the current word is automatically highlighted on cursor movement
Right now the plugin is in development and mot fully declarative but soon we should get a nix build along with a rockspec.
Dependencies:
- sudachi_rs as a tokenizer (ie., split words), use the full version
- edict_database as sqlite databases
- alogger for logging
- official sqlite bindings for lua 'sqlite'
- utf8 to get utf8
Popups are written in markdown, to improve the rendering I advise installing render-markdown-nvim though it remains optional.
Run :Rikai download to fetch the dictionaries (needed just once).
There are no default keymaps so you need to set one
vim.keymap.set({'n', 'v'}, '<D-j>', function() vim.cmd([[ Rikai lookup ]]) end, { buffer = false, desc = 'Japanese lookup' })
You can also call :Rikai lookup 見 to see the translation.
To enable a more rikaichamp/yomitan-like experience, run :Rikai live_hl enable
to enable automatic translation and hilighting of current token. It's quite
experimental and not as polished as its inspiration though.
Highlights used are visible in plugin/rikai.lua:
- RikaiHighlightWordGroup
- RikaiProperNoun
- RikaiCurrentToken
- lux packaging
- romaji to kana and vice-versa
- let users customize display (support https://jpdb.io/)
- add rikai translate
See wiki for more reference.
Run :Rikai download.
- rikaitan
- tagainjisho
- On android, I love Kanji study
- ichiran