This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-21
Channels
- # announcements (1)
- # architecture (1)
- # beginners (125)
- # boot (6)
- # boot-dev (2)
- # calva (69)
- # cider (38)
- # cljs-dev (3)
- # clojure (212)
- # clojure-austin (7)
- # clojure-australia (1)
- # clojure-denver (2)
- # clojure-europe (3)
- # clojure-gamedev (1)
- # clojure-hamburg (8)
- # clojure-italy (10)
- # clojure-nl (31)
- # clojure-russia (3)
- # clojure-uk (57)
- # clojurescript (56)
- # core-async (3)
- # cursive (15)
- # datascript (1)
- # duct (28)
- # emacs (6)
- # events (1)
- # figwheel-main (11)
- # fulcro (22)
- # luminus (59)
- # lumo (2)
- # onyx (4)
- # overtone (1)
- # re-frame (1)
- # reagent (4)
- # remote-jobs (3)
- # rum (2)
- # shadow-cljs (84)
- # spacemacs (7)
- # speculative (5)
- # vim (1)
- # yada (127)
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...
@plexus I use y3L
which copies 3 sexps, where L
maps to evil-cp-forward-sp in my spacemacs config
I just discovered lsp-mode
and it seems attractive, do you use it with spacemacs or emacs in general for clojure developpment?
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.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))
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]
,,,)
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...