anyone has the *
search working well while editing clojure files ? when I do *
on a namespace name from the require list (aliased or not, let's pretend async
), I'm always expecting my search to find every use of the name in the file, but I always get caught by the fact that it doesn't match things like async/go
how do you guys do ?
when looking for symbols, I usually search for async\/
I end up doing that as well but... you know... 😕
like when you're cleaning up a bit your requires, you'd like to know if a namespace is used at all, a *
won't do it for me which makes me sad
yeah, it's a bit annoying
ah, I started using clj-kondo
via the ALE
plugin and that helps me clean up my unused namespaces
oh yes, that could be a good workaround for me as well, thanks I'll give it a go
still I'll be happy to find a solution for the star search one day
:clj-kondo: ✨
clojure-lsp also provides warnings about unused namespaces. both solid options
@tedefump If you'd like to see where core.async is being used in your code base, you can use analysis output: https://github.com/borkdude/clj-kondo/tree/master/analysis There are some tools based on this for visualizing namespace/var dependencies: https://github.com/SevereOverfl0w/vizns https://github.com/benedekfazekas/morpheus
Another tool is https://github.com/borkdude/carve for discovering unused vars
Additionally vim-iced, a vim plugin also can use clj-kondo for discovering dependencies: https://twitter.com/uochan/status/1304916698827382784
there's no shortage of analysis tools 😄
thanks!
my issue is more with editing/navigating, I navigate a lot by *
in vim
but all these tools are still very useful, thanks for the tips
oh sorry, I might have misunderstood your issue then 😊
it's fine, I gave the example on unsused namespace but that wasn't the best example tbh
I think I'll still install clj-kondo
@tedefump Here are some docs: https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md#vim--neovim
perfect, thanks a lot
Fyi, fireplace has fixed the error problem that's been on master for a while. Also :Stacktrace has been massively improved.
I don't know if it helps but g*
matches partial strings. This way it will match async/go
but also any string that contains async
@tedefump just brainstorming for a moment: what about a key that took the last symbol searched for via *
/ #
but then searched for only the part before the /
if any?
or expanded the search to include things that start with <sym>/
if you were originally searching for <sym>
@tedefump @noisesmith doesn’t star respect word boundaries? http://vimdoc.sourceforge.net/htmldoc/options.html#'iskeyword'
I meant to figure that out to exclude colon and slash
in a clojure mode, / should not be a word boundary
commands built on "w" etc would be annoying otherwise
but the intentional split on "/" in particular seems useful as an additional feature
I wouldn’t mind making / a word boundary. But in any case you could write a command that temporarily changes the iskeyword setting when you press star. I’ll try that tomorrow.
if I am on foo/bar
, the intuitive thing is to search for foo/bar
when using *
and that's what the default clojure language def does. but yeah a prefix or modification does sound cool.