This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-14
Channels
- # asami (1)
- # babashka (50)
- # beginners (70)
- # bristol-clojurians (6)
- # calva (36)
- # chlorine-clover (1)
- # cider (4)
- # clj-kondo (3)
- # cljdoc (49)
- # cljsrn (5)
- # clojure (96)
- # clojure-australia (3)
- # clojure-dev (1)
- # clojure-europe (84)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (65)
- # clojurescript (31)
- # community-development (6)
- # conjure (17)
- # cursive (8)
- # datascript (5)
- # datomic (12)
- # duct (3)
- # emacs (18)
- # figwheel-main (2)
- # fulcro (7)
- # helix (1)
- # jobs (3)
- # luminus (7)
- # off-topic (77)
- # pathom (3)
- # portal (1)
- # rdf (4)
- # re-frame (1)
- # reitit (4)
- # remote-jobs (4)
- # reveal (15)
- # rum (1)
- # sci (38)
- # shadow-cljs (22)
- # spacemacs (1)
- # specter (6)
- # sql (1)
- # test-check (1)
- # tools-deps (60)
- # vim (12)
if i'm in a clojure buffer, is there a shortcut to tell the cider repl to switch to this files namespace?
@ozzloy_clojurians_net cider-repl-set-ns
(in my settings C-c M-n n
)
I think there's but I don't use deps that much (using leiningen). A long time before it used to work with clj-refactor but that has been broken afaik. Check https://insideclojure.org/2018/05/04/add-lib/
What's the best way un-align forms that were previously aligned vertically with M-x clojure-align
?
clj-fmt
is painfully slow to execute as an external tool. jet --pretty
is much faster, but it does manipulate the order of keys (not ideal). I'd like to find emacs-lisp way.
Yes but you'd do it once and then keep the codebase "clean" since by default no alignment happens.
> Yes but you'd do it once and then keep the codebase "clean"
I need this not for the large codebase chunks. Mostly for selected regions or current clojure-form.
Reasons: I like to vertically align things (forms read better that way), in some teams that is not an established convention, people sometimes don't like it. That is why I'm looking for the exact opposite of M-x clojure-align
(defun clojure-unalign (beg end)
(interactive (if (use-region-p)
(list (region-beginning) (region-end))
(save-excursion
(let ((end (progn (end-of-defun)
(point))))
(clojure-backward-logical-sexp)
(list (point) end)))))
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
(while (re-search-forward "\\s-+" nil t)
(replace-match " "))
(indent-region beg end))))
(defun clojure-unalign (beg end)
(interactive (if (use-region-p)
(list (region-beginning) (region-end))
(save-excursion
(let ((end (progn (end-of-defun)
(point))))
(clojure-backward-logical-sexp)
(list (point) end)))))
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
(while (re-search-forward "\\s-+" nil t)
(replace-match " "))
(indent-region beg end))))