Fork me on GitHub
#vim
<
2022-01-28
>
Matt Butler15:01:14

Does anyone have a vim (nvim) tool for finding usages of symbols/keywords etc. I used to get along fine with grep, but as aliased namespaced keywords are becoming more common, its difficult to rely on grep alone (unless I'm missing a trick).

dave15:01:28

I have a custom mapping that runs :CtrlSF <highlighted text> in visual mode, so I can highlight a keyword and quickly search for all instances of the highlighted string across the entire project.

Matt Butler15:01:49

I see, can that account for if I have a keyword in a namespace like ::foo/bar and find all usages of that, even if its aliased as ::fish/bar in other places?

dave16:01:48

No. But I would argue that one shouldn't do that 🙂

mynomoto18:01:29

Clojure-lsp has find references that does what you want.

mynomoto18:01:32

You will need a lsp client like coc or the one built in on neovim.

Matt Butler17:01:29

Thanks for the pointers, I'll do some digging :thumbsup: