Skip to content

teto/rikai.nvim

Repository files navigation

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
image - popup for an expression, the current word is automatically highlighted on cursor movement image

How to install ?

Right now the plugin is in development and mot fully declarative but soon we should get a nix build along with a rockspec.

Dependencies:

Popups are written in markdown, to improve the rendering I advise installing render-markdown-nvim though it remains optional.

How to use ?

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

Roadmap

  • lux packaging
  • romaji to kana and vice-versa
  • let users customize display (support https://jpdb.io/)
  • add rikai translate

See wiki for more reference.

How to get the various dictionaries used by rikai.nvim ?

Run :Rikai download.

Related software

About

rikaitan for neovim, i.e., japanese translation integrated

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages