Skip to content

delphinus/obsidian-kensaku.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

obsidian-kensaku.nvim

demo-egrepify

Search the vault with Romaji powered by epwalsh/obsidian.nvim.

ローマ字を使って epwalsh/obsidian.nvim の文書を検索します。

What's this?

This plugin adds a command :ObsidianKensaku. This command looks like :ObsidianSearch but you can use Romaji to search the vault.

Requirements

Install

Set up converter for Romaji

You can choose one.

kensaku.vim

See lambdalisue/kensaku.vim for the detail.

-- example for lazy.nvim
{
  "lambdalisue/kensaku.vim",
  dependencies = { "vim-denops/denops.vim" },
}

cmigemo executable

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.

Add this plugin with your favorite plugin manager

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,
    },
  },
}

Command

:ObsidianKensaku

Open the picker like :ObsidianSearch. You can search with Romaji and do the same things as in :ObsidianSearch.

Options

query_filter

  • 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,
}

cmigemo_executable

  • default: "cmigemo"
  • type: string

Path for cmigemo executable. This will be used only if query_filter is "cmigemo".

migemo_dict_path

Path for migemo-dict. This will be used only if query_filter is "cmigemo".

picker

  • default: "default"
  • type: "default"|"egrepify"

Use fdschmidt93/telescope-egrepify.nvim instead of telescope's builtin.

LICENSE

MIT license.

Releases

No releases published

Packages

No packages published

Languages