obsidian.nvim
obsidian.nvim copied to clipboard
Function to return Telescope picker
🚀 The feature, motivation and pitch
Hey. I like creating my mappings in a separate file. I find lazy's approach of opts and keys a nice organizational system. I would like to attack the mappings to the Telescope picker when I do this:
{ "<c-s-n>", function() vim.cmd("ObsidianSearch") end, mode = "n" }.
Is it possible to return the Telescope picker so that I can dynamically attach mappings?
Alternatives
No response
Additional context
No response
Yea @DRKolev-code, there's not a good way to do this at the moment but I'm open to proposals.
The only thing I can think of is a function that would return the picker. I am new to (n)vim as a whole and the only suggestion I can provide is what oil.nvim does. Inside oil.util there is this function:
M.get_preview_win = function()
for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
if vim.api.nvim_win_is_valid(winid) and vim.wo[winid].previewwindow then
return winid
end
end
end
Maybe there could be a util function that returns the picker? I do not know how to dynamically add keymaps to an open telescope window but I guess even vim.api.nvim_buf_set_keymap would work.