A blazing fast, zero-dependency Japanese dictionary plugin for Neovim, powered by Jisho.org.
Good for Japanese learners, anime enthusiasts, or anyone reading Japanese documentation and source code.
[!WARNING] This plugin requires latest 0.13 nightly
vim.async, native vim.system(), and vim.net.request() with automatic retries. Never blocks your UI.~/.cache/nvim/jisho_cache.json survives Neovim restarts with 5-minute TTL.:JishoHistory command with timestamps, Enter to re-search (snacks.picker + native fallback).j/k jump between senses/entries, w/b Budoux-aware Japanese word jumps.vim.iter, vim.uv, vim.bo/vim.wo, vim.net.request with retries.vim.pack (No plugin manager needed)You can install this plugin using Neovim's built-in package manager, or just clone it into your packpath:
vim.pack.add('https://github.com/Imngzx/jisho.nvim')
Then, add the setup and keymaps to your init.lua:
require('jisho').setup()
-- Setup keymaps
vim.keymap.set('n', '<leader>tj', function() require('jisho').search() end, { desc = 'Jisho (Word under cursor)' })
vim.keymap.set('v', '<leader>tj', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'n', true)
vim.schedule(function()
local s = vim.api.nvim_buf_get_mark(0, '<')
local e = vim.api.nvim_buf_get_mark(0, '>')
local lines = vim.fn.getregion({ 0, s[1], s[2] + 1, 0 }, { 0, e[1], e[2] + 1, 0 })
require('jisho').search(table.concat(lines, ' '))
end, { desc = 'Jisho (Selection)' })
{
"Imngzx/jisho.nvim",
cmd = { "Jisho", "JishoHistory", "JishoDedupe", "JishoRefresh" },
keys = {
{
'<leader>tj',
function() require('jisho').search() end,
mode = 'n',
desc = 'Jisho (Word under cursor)',
},
{
'<leader>tj',
function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'n', true)
vim.schedule(function()
local s = vim.api.nvim_buf_get_mark(0, '<')
local e = vim.api.nvim_buf_get_mark(0, '>')
local lines = vim.fn.getregion({ 0, s[1], s[2] + 1, 0 }, { 0, e[1], e[2] + 1, 0 })
require('jisho').search(table.concat(lines, ' '))
end)
end,
mode = 'v',
desc = 'Jisho (Selection)',
},
},
opts = {},
}
require('resonance').load({
'https://github.com/Imngzx/jisho.nvim',
-- optional
dependencies = { 'https://github.com/atusy/budoux.lua', },
cmd = { 'Jisho' },
keys = {
{ 'n', '<leader>tj', function() require('jisho').search() end, { desc = 'Jisho (Word under cursor)' } },
{ 'v', '<leader>tj', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'n', true)
vim.schedule(function()
local s = vim.api.nvim_buf_get_mark(0, '<')
local e = vim.api.nvim_buf_get_mark(0, '>')
local lines = vim.fn.getregion({ 0, s[1], s[2] + 1, 0 }, { 0, e[1], e[2] + 1, 0 })
require('jisho').search(table.concat(lines, ' '))
end)
end, { desc = 'Jisho (Selection)' } },
},
config = function()
require('jisho').setup({
use_budoux = true,
layout = 'spacious',
})
end,
})
jisho.nvim works perfectly without any configuration, but you can customize the UI behavior.
require('jisho').setup({
-- Auto-detect snacks.nvim by default.
-- Set to false to force use native Neovim floating window.
-- Set to true to force use snacks.nvim.
use_snacks = pcall(require, 'snacks'),
-- Auto-detect budoux.lua by default.
-- can set to true or false
use_budoux = pcall(require, 'budoux'),
-- Settings for the native floating window (used when snacks is not available)
window = {
width = 0.6, -- 60% of screen width
height = 0.7, -- 70% of screen height
border = "rounded", -- "single", "double", "rounded", "solid", "shadow"
},
-- compact | spacious | super_spacious
layout = "spacious"
})
[!TIP] You can add it into which-key
Here's my jisho + my budoux and which-key configuration file for Neovim
You can search any word anywhere via the command line:
:Jisho ้ฃในใ
:Jisho hello
If you configured the keymaps as shown above:
<leader>tj to translate the word directly under your cursor.<leader>tj to translate the selection.| Command | Description |
|---|---|
:Jisho [word] |
Search for a word (uses word under cursor if omitted) |
:JishoHistory |
Open search history picker (snacks.picker or native) |
:JishoDedupe inflight |
Inspect in-flight requests |
:JishoDedupe clear-inflight |
Clear all in-flight requests |
:JishoDedupe clear-cache |
Clear search cache |
:JishoDedupe refresh [word] |
Force refresh (bypasses cache) |
:JishoRefresh [word] |
Shortcut for force refresh |
| Key | Action |
|---|---|
j / k |
Jump between senses/entries |
w / b |
Budoux-aware Japanese word jumps |
q / <Esc> |
Close window |
<CR> (in history) |
Re-search selected entry |
vim.async, vim.system, and vim.net.request)curl available in your system's PATH (fallback HTTP transport)This project is licensed under the MIT License.