Is it possible to use imenu (or another package) to copy the target (specified by a regex) rather than jumping to it?
This is an effort for tackling the question: How to list or autocomplete pandoc-crossref citations in an org-mode buffer?
I'd like to find all labels in the buffer that match a certain regex pattern. Then, instead of jump to that label, I'd like to copy it to the current point. Is this possible with imenu or similar packages?
-- UPDATE --
To clarify what I was looking for with a minimal example:
I have the following packages installed for the auto-completion:
ivy ivy-hydra imenu imenu-anywhere counsel swiper
(require 'imenu) (as suggested).
Now in a buffer with two lines:
and the cursor at the third line, I'd like to use the regex
aaa to insert the text
aaa at the point. E.g. by :
I am using a trivial regex, but for a real one, I'd like to use imenu and the minibuffer to select from the list of all labels in the current buffer (before and after the point) that matches the regex.