Giter VIP home page Giter VIP logo

obsidian-kensaku.nvim's Introduction

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.

obsidian-kensaku.nvim's People

Contributors

delphinus avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.