counsel-etags
counsel-etags copied to clipboard
Custom callback if tag is not found
Is it possible to add an optional, custom callback for cases when no tag is found? For me, this typically happens when I try to look up a local variable and it that case I would find it most useful to simply use swiper or something in the current file.
You could just setup ~/.ctags
, add more regular expression to extra local variable.
I didn't think about that. But that would also give me results from different files, right?
I already have a key that does "swiper-at-point", which I use very often to track the usage of local variables in a single file. Admittedly it is a different functionality, but it in my workflow they are closely related, which is why it would feel lika a natural fallback for me personally.
(The idea actually came to me because the counsel-etags-grep fallback never seems to work, although ripgrep is working for other commands in emacs (e.g. projectile). Maybe that is an issue with rg not being in the cygwin folder...)
I would like this too, as this would make it easier to register counsel-etags with smart-jump
See counsel-etags-fallback-grep-function
whose default value is counsel-etags-grep