This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-09
Channels
- # announcements (12)
- # babashka (22)
- # beginners (17)
- # boot (6)
- # calva (45)
- # clj-kondo (17)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (35)
- # clojure-finland (6)
- # clojure-losangeles (2)
- # clojure-nl (1)
- # clojure-uk (2)
- # clojured (26)
- # clojurescript (10)
- # conjure (1)
- # datahike (1)
- # events (1)
- # honeysql (14)
- # introduce-yourself (5)
- # jobs (5)
- # joyride (2)
- # minecraft (6)
- # off-topic (5)
- # pathom (14)
- # rewrite-clj (1)
- # shadow-cljs (13)
- # tools-build (6)
- # tools-deps (13)
- # vim (29)
- # xtdb (8)
Does anyone folow this guide principle for one space indent for function arguments? And if yes, how to achieve this in vim? https://guide.clojure.style/#one-space-indent
Seems like a tricky one to get working right while taking https://guide.clojure.style/#body-indentation into consideration.
So, my coworkers and I often end up inadvertently re-indenting each others' code whenever we touch it.
I will bring this topic to the general clojure channel, may be all the comunity should come to conclusion about this
Thank you! I was just considering what should I do, having pr with 1-space-indents in my repo
yes, Dart->Clojure translater https://github.com/Liverm0r/DartClojure/pull/9/files
That's quite the issue there in the tracker. I'm inclined to believe this nuanced rule does more harm than good. It makes it very difficult for everyone to use the same formatting and I'm not really sure what the benefit is.
My suggestion is to try not to think about it. It's a long unhappy path of people trying to suggest one thing or another. This road is littered with well intentioned formatters and guides.
lol good idea. I'm still trying to consolidate the overall ruleset with my preference to put "standard" first args like app
, node
, config
, etc.. on the same line as the function while putting the remaining args indented one level, like:
(foo app
bar
:baz 1)
so clojure-lsp does have reformatting with cljfmt if you need to match coworkers, with that you can do it within editor, or as a git hook calling cljfmt (through bb) to match coworkers. overall though, i push for formatting standards that are easiest for editors to agree on, cursive has even less control than clojure-static.
https://github.com/clojure-vim/clojure.vim#gclojure_align_subforms might work for 1-space indent style, though you probably need to control which forms then get the 2-space idennt. Cursive has an option for this also.