Fork me on GitHub

is it just me or that new UI looks similar to vscode?


Yes, soon Cursive will look just like Calva!

calva 3
馃槀 3

Is there a way to tell cursive to format maps differently? What I'm looking for is instead of this:

(def my-map {
             :a 1
             :b 2
I'd like this:
(def my-map {
  :a 1
  :b 2
So, 2 spaces indent relative to the previous indent instead of 1 space indent relative to the opening curly bracket


that's a rather java/script-y formatting style


as far as I know Cursive's indenter works in relation to the containing form (which in the case of the contents of the map would be the curly brackets themselves), not in relation to the previous indentation level


I believe most Clojure formatters work in this way


Is there any specific reason you are looking to achieve such a clojure-unorthodox style?


personal preference i guess


it's really difficult to get used to this formatting style coming from other languages


(def my-map
  {:a 1
   :b 2})


but also: if you have nested maps, the indentation can easily pushed off the side of the screen


nested data structures* - not specific to maps


(def my-map
  {:a 1
   :b 2
   {:foo 1
    :bar 2
    {:qux 1
     :quux 2}}})


that's fine but not gonna lie - the 1 space relative to opening brace just kinda kills me. it makes it very hard to see where the nesting begins/ends


While I respect your preferences (I also have my own nits here and there) but I think I'd rather suggest that you familiarize yourself with the conventions that are more established in existing codebases, otherwise you might have a hard time reading others code and vice versa (and potentially collaborating with others)


I suspect I'm not the only clojure user coming from C-syntax-style-languages that feels this way


I don't know about any clojure editors that support the style you are trying to achieve so I'd imagine it could feel like pissing against the wind a bit


yeah... just feels like yet another hurdle to overcome for new Clojure users. but i do agree that if there's a standard I probably should familiarize myself with it


what you can do to help you judge where forms start and end is set up the matching brace highlighting


already have that enabled


appreciate your help though


Welcome to the community! I'm sorry I couldn't have better news. If you haven't so far, do also check out paredit/structural editing. Coming from C#, that was the feature that made me never want to go back to editing c-style code ever again


I use it in a very limited way right now. I love the power/capability, but I do need to learn all the keyboard shortcuts. Honestly Tony Kay's fulcro tutorials have been amazing for seeing what's possible in a "real world" setting using structural editing


I found Cursive's keybinds good for the operations I mostly use, which are slurp, barf, raise and splice


Is there a workaround for the build.clj is not under a source root issue w/ when build.clj is in the project root? Or is putting it in a subdir still the best one? Searched back through the channel history and cursive user guide a bit but didn't see anything.

R.A. Porter16:05:52

Have you tried doing this, checking the build tool alias?


no, where is that?

R.A. Porter16:05:29

Clojure Deps window. By default it should be in the upper right application margin.


ah, yep. I have that hidden by default. found it though. thanks I'll give that a try!

R.A. Porter16:05:31

You'll need to hit the refresh icon in that plugin's toolbar after checking the alias.

馃憤 1

hmm... that fixed the "not under source root" but it still can't resolve the library fns I'm calling from build.clj (e.g. b/uber)


oh, but a full restart of intellij fixed that. great! thanks again!

R.A. Porter16:05:28

Does your build alias in your deps file include the dep for io.github.seancorfield/build-clj?

R.A. Porter16:05:36

Ah. Cool. 馃憤

Ivar Refsdal18:05:02

Not sure what you are using build.clj for, but yesterday I tried and it worked great.


@U06FS3DLH Yes, the initial indexing can be flakey after selecting that alias, generally just opening and closing the project (without a full restart) works. I think it鈥檚 an IntelliJ thing.