Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: add support for mini.pick in obsidiansearch command #256

Closed
bassamsdata opened this issue Dec 3, 2023 · 3 comments
Closed

Comments

@bassamsdata
Copy link

🚀 The feature, motivation and pitch

the ObsidianSearch command currently relies on either telescope, fzf-lua, or fzf.vim for fuzzy searching. i'd like to propose adding support for an alternative fuzzy search tool, mini.pick, which is part of the mini.nvim module ecosystem and is currently my preferred choice for fuzzy searching.

Alternatives

No response

Additional context

i attempted to implement this enhancement through a pull request, and while i successfully implemented it, the search functionality is limited to the current working directory where neovim was started. i've provided my initial implementation below, and also linked a repository where i explored multiple approaches without success.

i invite you to review my implementation and explore the provided fork for further details.

it would be greatly appreciated if you could consider incorporating support for mini.pick into the obsidiansearch command.

My fork commits

Click to expand code in `command.lua` file
["mini.pick"] = function()
    -- Check if mini.pick is available
    local has_mini_pick, mini_pick = pcall(require, "mini.pick")
    if not has_mini_pick then
      return false
    end

    -- Set up the arguments for mini.pick
    local grep_arguments = vim.tbl_flatten {
      base_cmd,
      {
        "--color=always",
        "--",
        util.quote(data.args),
        tostring(client.dir),
      },
    }

    -- Use mini.pick's grep_live or grep picker depending on whether there are arguments
    if data.args:len() > 0 then
      mini_pick.builtin.grep({ tool = 'rg', args = table.concat(grep_arguments, " ") })
    else
      mini_pick.builtin.grep_live({ tool = 'rg', args = table.concat(grep_arguments, " ") })
    end

    return true
end
</details>

Thank you so much

@epwalsh
Copy link
Owner

epwalsh commented Dec 4, 2023

Hey @bassamsdata I'd be happy to add this. It looks like you got a good start. Can you open a PR with your changes and I'll give it a try. Maybe I can figure out how to fix the working directory issue.

@bassamsdata
Copy link
Author

PR's been created. your help is really appreciated!
thank you.

@epwalsh
Copy link
Owner

epwalsh commented Dec 19, 2023

Closed via #270

@epwalsh epwalsh closed this as completed Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants