Fork me on GitHub
#spacemacs
<
2019-01-21
>
plexus03:01:34

what do people do to copy multiple consecutive s-expressions? I've mostly been using ya( or yi( but if you give those a prefix they will match ever greater surrounding forms, rather than consecutive forms...

kommen09:01:24

@plexus I use y3L which copies 3 sexps, where L maps to evil-cp-forward-sp in my spacemacs config

romain11:01:02

I just discovered lsp-mode and it seems attractive, do you use it with spacemacs or emacs in general for clojure developpment?

n2o16:01:38

Small question about formatting: Is it possible to change the way code is being formatted? I am not quite sure which plugin is responsible for it, so I don't know where to look it up. For example:

(defui Actual
  static om/IQuery
  (query [this]
         []))  ;; <-- too many spaces

(defui Expected
  static om/IQuery
  (query [this]
    []))  ;; should treat it the same as a function definition
I want the second version. In Cursive it is possible to tell the IDE how the macro, which is not known to the IDE, should be interpreted in terms of indentation.

ag07:01:30

Indentation in clojure-mode is controlled by changing clojure-indent-style - read description of that function and CIDER documentation for more. But I would recommend keeping default value which I think is 'always-align'. And then when you press , fl - it would nicely realign things that are misaligned. You can also specifically make different forms to align differently but that will probably make lein cljfmt and similar tools to yell at you.

(dolist (form '(re-frame.core/reg-sub
                re-frame.core/reg-fx
                re-frame.core/reg-sub
                re-frame.core/reg-event-fx
                re-frame.core/reg-event-db))
  (put-clojure-indent form 1))

ag07:01:09

I’d say just don’t worry about it and simply use the defaults. Conventions exists for reasons. In your example it could be something like:

(query 
  [this]
   ,,,)

n2o11:01:27

I totally agree that one should stick to the conventions, but I think this formatting is not really correct. Cursive handles it the way I described it and this is what I like. Also it would be great to change it just to follow the same style guide. In our team we have users using Emacs and others use IntelliJ. When use auto-formattinc, lines are touched which just have not been changed -- just the configured indentation was different between these IDEs...