This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-02
Channels
- # announcements (1)
- # asami (89)
- # aws (10)
- # babashka (41)
- # beginners (71)
- # calva (25)
- # cider (3)
- # clj-kondo (65)
- # cljdoc (15)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (56)
- # clojure-europe (44)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-uk (48)
- # clojured (7)
- # clojurescript (17)
- # conjure (6)
- # cursive (3)
- # datomic (9)
- # emacs (11)
- # events (3)
- # fulcro (3)
- # helix (3)
- # honeysql (7)
- # hugsql (6)
- # introduce-yourself (2)
- # jobs (2)
- # kaocha (4)
- # luminus (1)
- # nrepl (2)
- # off-topic (10)
- # pathom (7)
- # philosophy (3)
- # polylith (27)
- # reagent (18)
- # reitit (3)
- # remote-jobs (7)
- # reveal (3)
- # shadow-cljs (9)
- # slack-help (5)
- # tools-deps (9)
- # vim (48)
@caumond Using LSP the variable lsp-enable-on-type-formatting t
will format while typing as ag mentioned, use a clojure-mode hook to add aggressive-indent-mode (add-hook 'clojure-mode-hook #'aggressive-indent-mode)
Do not use both of these together unless you want to see Emacs will go crazy :)
Hi @jr0cket
Is it possible to make aggressive-indent
play well with cljfmt
with specific rules in the profiles?
It seems aggressive-ident ignore these rules used by cljfmt
(e.g. in project.clj
for example.
Is there ways to make this work together?
e.g I have the following rules in project.clj
and I want aggressive-indent
to use it I format the code via indent-region
:cljfmt
{:remove-surrounding-whitespace? true
:remove-trailing-whitespace? true
:remove-consecutive-blank-lines? true
:insert-missing-whitespace? true
:align-associative? false
:split-keypairs-over-multiple-lines? true
:remove-multiple-non-indenting-spaces? true
:indents {async [[:inner 0]]}}
I haven't found a way to make aggressive-indent work with LSP format as you type. It seems to be one or the other. When cljfmt supports aligning of argument forms, then aggressive-indent shouldn't be needed.
There is an issue around this on cljfmt and @UE21H2HHD is kindly looking at ways to add this feature
@U39K1NXHP the here’s https://github.com/weavejester/cljfmt/issues/36 and there has been some discussion in #cljfmt too. Input and ideas are welcome.
If aggressive-indent-mode
could be configurable to the degree that it would match cljfmt or the nrepl-middleware that cider et al use to format code, it would help allow people (me) to continue using it in the context of a larger project with other people who aren't using aggressive-indent-mode
I personally love aggressive-indent-mode
but if not everybody on the team is using it, and the various formatting tools disagree about how to format the code, the result is so expensive that I feel like I have to accept that I cannot have my preference
I want the same thing and I really like aggressive-indent-mode
and wish I can customize it to make it produce the same output as cljfmt
so the same rules can be used with other team member.