Search the vault with Romaji powered by epwalsh/obsidian.nvim.
ローマ字を使って epwalsh/obsidian.nvim の文書を検索します。
This plugin adds a command :ObsidianKensaku
. This command looks like
:ObsidianSearch
but you can use Romaji to search the vault.
- epwalsh/obsidian.nvim
- nvim-telescope/telescope.nvim
- obsidian.nvim supports telescope, ibhagwan/fzf-lua and echasnovski/mini.pick, but obsidian-kensaku.nvim supports telescope.nvim only.
- Converter for Romaji. You needs one of below.
- lambdalisue/kensaku.vim
cmigemo
executable.- or another one you prefer.
- fdschmidt93/telescope-egrepify.nvim (optional)
- telescope has a bug (nvim-telescope/telescope.nvim#2272) that it cannot highlight properly with string matched by regex. I recommend you to use telescope-egrepify for this.
You can choose one.
See lambdalisue/kensaku.vim for the detail.
-- example for lazy.nvim
{
"lambdalisue/kensaku.vim",
dependencies = { "vim-denops/denops.vim" },
}
You can install by OS specific command.
# macOS
brew install cmigemo
# some Linux's
apt-get install cmigemo
For Windows or other Linux's, see C/Migemo — KaoriYa.
If you use kensaku.vim (the default way), you can set simply like this below.
-- example for lazy.nvim
{
"epwalsh/obsidian.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"delphinus/obsidian-kensaku.nvim",
},
opts = {
callbacks = {
post_setup = function(client)
require "obsidian-kensaku"(client),
end,
},
},
}
Important
Remember to call this plugin in opts.callbacks.post_setup
.
If you want to customize the way, call setup
or write them in opts
(for
lazy.nvim).
-- example for lazy.nvim
{
"epwalsh/obsidian.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"delphinus/obsidian-kensaku.nvim",
opts = {
query_filter = "cmigemo",
cmigemo_executable = "/path/to/cmigemo",
migemo_dict_path = "/path/to/migemo-dict",
},
--- for other plugin managers
-- config = function()
-- require("obsidian-kensaku").setup {
-- query_filter = "cmigemo",
-- cmigemo_executable = "/path/to/cmigemo",
-- migemo_dict_path = "/path/to/migemo-dict",
-- }
-- end,
},
},
opts = {
callbacks = {
post_setup = function(client)
require "obsidian-kensaku"(client),
end,
},
},
}
Open the picker like :ObsidianSearch
. You can search with Romaji and do the
same things as in :ObsidianSearch
.
- default:
"kensaku"
- type:
"kensaku"|"cmigemo"|fun(query: string): string
You can choose the way to convert Romaji into regex. It has pre-defined
filters for lambdalisue/kensaku.vim and cmigemo
, but you can define your
own way to do this.
{
query_filter = function(query)
return some_way_to_create_regex(query)
end,
}
- default:
"cmigemo"
- type:
string
Path for cmigemo
executable. This will be used only if query_filter
is
"cmigemo"
.
- default: Search automatically. See lua/obsidian-kensaku/config.lua.
- type:
string
Path for migemo-dict
. This will be used only if query_filter
is "cmigemo"
.
- default:
"default"
- type:
"default"|"egrepify"
Use fdschmidt93/telescope-egrepify.nvim instead of telescope's builtin.
MIT license.