vim

For discussion on all things (neo)vim.
2020-09-14T16:14:51.002500Z

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

2020-09-14T16:14:56.002700Z

how do you guys do ?

nate 2020-09-14T16:18:48.003100Z

when looking for symbols, I usually search for async\/

2020-09-14T16:19:14.003500Z

I end up doing that as well but... you know... 😕

2020-09-14T16:19:57.004400Z

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

nate 2020-09-14T16:20:04.004500Z

yeah, it's a bit annoying

nate 2020-09-14T16:20:25.005Z

ah, I started using clj-kondo via the ALE plugin and that helps me clean up my unused namespaces

2020-09-14T16:20:49.005400Z

oh yes, that could be a good workaround for me as well, thanks I'll give it a go

2020-09-14T16:21:21.005800Z

still I'll be happy to find a solution for the star search one day

borkdude 2020-09-14T16:24:26.006300Z

:clj-kondo: ✨

dave 2020-09-14T16:25:49.006800Z

clojure-lsp also provides warnings about unused namespaces. both solid options

borkdude 2020-09-14T16:28:36.008200Z

@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

borkdude 2020-09-14T16:29:20.008700Z

Another tool is https://github.com/borkdude/carve for discovering unused vars

borkdude 2020-09-14T16:30:16.009700Z

Additionally vim-iced, a vim plugin also can use clj-kondo for discovering dependencies: https://twitter.com/uochan/status/1304916698827382784

2020-09-14T16:30:29.010200Z

there's no shortage of analysis tools 😄

2020-09-14T16:30:33.010400Z

thanks!

2020-09-14T16:30:56.011100Z

my issue is more with editing/navigating, I navigate a lot by * in vim

2020-09-14T16:31:08.011500Z

but all these tools are still very useful, thanks for the tips

borkdude 2020-09-14T16:31:26.012Z

oh sorry, I might have misunderstood your issue then 😊

2020-09-14T16:31:59.012600Z

it's fine, I gave the example on unsused namespace but that wasn't the best example tbh

2020-09-14T16:32:28.012900Z

I think I'll still install clj-kondo

2020-09-14T16:33:37.013600Z

perfect, thanks a lot

dominicm 2020-09-14T16:36:59.014700Z

Fyi, fireplace has fixed the error problem that's been on master for a while. Also :Stacktrace has been massively improved.

💪 1
nbardiuk 2020-09-14T16:47:10.014800Z

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

2020-09-14T17:08:52.016100Z

@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?

2020-09-14T17:09:39.016800Z

or expanded the search to include things that start with <sym>/if you were originally searching for <sym>

orestis 2020-09-14T17:21:22.018Z

@tedefump @noisesmith doesn’t star respect word boundaries? http://vimdoc.sourceforge.net/htmldoc/options.html#'iskeyword'

orestis 2020-09-14T17:21:54.019Z

I meant to figure that out to exclude colon and slash

2020-09-14T17:22:03.019300Z

in a clojure mode, / should not be a word boundary

2020-09-14T17:22:41.020Z

commands built on "w" etc would be annoying otherwise

2020-09-14T17:24:06.021900Z

but the intentional split on "/" in particular seems useful as an additional feature

orestis 2020-09-14T17:31:39.023300Z

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.

2020-09-14T22:06:00.024400Z

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.