Open mini.pick with default text? #2198
-
Contributing guidelines
Module(s)mini.pick QuestionI've read through the documentation, unsure if I have missed something. When I was using telescope, I had something like this in my config: Is something similar possible with mini.pick? (I probably should be using some LSP to find all references, but sometimes it's still useful..) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I think what you are looking for is the MiniPick.builtin.grep: MiniPick.builtin.grep({ pattern = vim.fn.expand("<cword") }) |
Beta Was this translation helpful? Give feedback.
-
|
Yes, this is possible with 'mini.pick' by manually setting query on picker start. Something like this: MiniPick.registry.grep_live_cword = function()
-- Pre-compute the word when 'mini.pick' buffer is not yet current
local cword = vim.fn.expand('<cword>')
-- Create autocommand that will populate query after picker is opened
local set_cword_query = function() MiniPick.set_picker_query({ cword }) end
vim.api.nvim_create_autocmd('User', { once = true, pattern = 'MiniPickStart', callback = set_cword_query })
-- Use regular `grep_live`
MiniPick.builtin.grep_live()
endOther approaches are more aligned with how 'mini.pick' works:
|
Beta Was this translation helpful? Give feedback.
Yes, this is possible with 'mini.pick' by manually setting query on picker start. Something like this:
Other approaches are more aligned with how 'mini.pick' works:
grep_liveand manually enter word un…