A custom source for snacks.picker that enables Japanese live searching using Romaji via C-Migemo.
Note
This plugin is a custom extension built by modifying the original grep source code from snacks.picker.
- Neovim >= 0.13.0
- C-Migemo (compiled library and dictionary files)
- ripgrep (must be installed and available in your
PATH)
You need to initialize the plugin by passing the paths to your migemo library and dictionary, then assign it to the snacks.picker sources configuration.
local sources = require('snacks.picker.config.sources')
-- Initialize snacks-source-migemo
-- Provide the absolute paths to your C-Migemo library and dictionary.
sources.migemo = require('snacks-source-migemo').setup('/path/to/libmigemo', '/path/to/migemo-dict')
if not sources.migemo then
error('Failed to initialize migemo.')
endAdd the migemo source configurations inside your snacks.nvim setup call.
require('snacks').setup({
picker = {
sources = {
migemo = {
format = 'file',
regex = true,
show_empty = false,
live = true,
support_live = true,
exclude = { 'node_modules', '.git' },
},
}
}
})You can run the custom Migemo live grep picker using the standard snacks.picker API:
:lua Snacks.picker.migemo({cwd = 'path/to/search/directory'})