In Vim, the default behavior of [I
shows a list of lines matching the word under the cursor. I noticed we are missing this binding in Doom.
Fortunately, we can do better than Vim’s behavior by leveraging occur
capabilities (and embark
if you happen to use it). This is what I came up:
(require 'embark)
(defun bk/occur-at-point ()
(interactive)
(embark--act #'occur (car (embark--targets))))
(map! :n "[I" #'bk/occur-at-point)
3 Likes
Esagoh
April 24, 2022, 2:31pm
#2
The :completion vertico
module has +vertico/search-symbol-at-point
that does the same thing. SPC s S
.
5 Likes
liam
April 24, 2022, 4:34pm
#3
If you need to broaden your search, there’s also +default/search-project-for-symbol-at-point
(SPC *
) and +default/search-notes-for-symbol-at-point
(SPC n *
).
2 Likes
Great! Now I can bind this function to [I
. Thanks
1 Like
system
closed
July 24, 2022, 10:48am
#5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.