Fork me on GitHub
#emacs
<
2022-02-12
>
zhuxun201:02:51

I just began using clojure-lsp with emacs. However, cljfmt does not seem to be working at all. Do I have to include cljfmt in my deps.edn for it to work? I couldn't find this in the installation tutorial...

ericdallo02:02:14

No, it's built in on clojure-lsp

ericdallo02:02:41

Are you calling lsp-format-buffer manually?

ericdallo02:02:54

What kind of code are you trying to indent?

zhuxun208:02:20

Here is a test I made.

zhuxun208:02:32

After executing lsp-format-buffer, I got:

vemv17:02:54

cljfmt generally fixes indentation only, it's not a canonical formatter. The idea is to be a little more lenient, allowing style differences where it's hard to establish a single truth zprint is better oriented towards canonicalization. Whether it can have 100% technical coverage or social acceptance, is another story. Super interesting and flexible project anyway.

ericdallo17:02:17

yes, with clojure-lsp, formatting that code I get this:

(defn
  f
  []
  42)

ericdallo17:02:13

@U6SEJ4ZUH try formatting:

(defn
  something
     to
       format)
it should format to:
(defn
  something
  to
  format)

zhuxun201:02:26

It always says "no format changes" despite there's obvious lines need to be formatted...

Drew Verlee03:02:17

anyone using emacs 28? i'm updating today from 27 and i'm curious what, if any, issue people have encountered.

pavlosmelissinos11:02:48

IIRC I just got some warnings when I upgraded and had to update some packages and setqs in my init.el

👍 1
Drew Verlee20:02:59

Has anyone tried this for clojure development? https://github.com/dandavison/delta I think it's saying it will show specific diffs in my working file. Which i think i would really enjoy.

Drew Verlee20:02:35

nope, never mind it still just has diffs in the git buffer

practicalli-johnny22:02:52

Magit seems that do the most popular important aspect for me, like word level diff highlights. If I am diff'ing outside of Emacs (very rarely) then I use meld (application on Linux)

practicalli-johnny22:02:56

Spacemacs can highlight changed lines in the fringe, or as highlighted lines in the source code buffer using Smeargle https://practical.li/spacemacs/source-control/magit/version-highlighting.html

hkjels11:02:09

it yields better diffs, but there are performance-issues. At least last time I tried with magit-delta, there were some issues that I didn’t bother to investigate

Drew Verlee16:02:10

@U0B1SDL67 is there a difference from the diff you get from setting magit-diff-refine-hunt to 'all ? in the context of a init.el file under spacemacs layers:

(git :variables magit-diff-refine-hunk 'all)
That seems to get me the same level of diffing only it doesn't try to color the code (only the diff) which i prefer as it lets me focus on the changes more.