This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-02
Channels
- # announcements (34)
- # babashka (19)
- # beginners (106)
- # calva (50)
- # cider (25)
- # clj-commons (39)
- # clj-kondo (16)
- # clojure (59)
- # clojure-czech (3)
- # clojure-europe (33)
- # clojure-norway (9)
- # clojure-seattle (1)
- # clojure-sweden (1)
- # clojure-uk (2)
- # clojured (28)
- # clojuredesign-podcast (1)
- # clojurescript (7)
- # code-reviews (19)
- # conjure (15)
- # cursive (3)
- # datomic (3)
- # emacs (21)
- # etaoin (28)
- # graphql (4)
- # introduce-yourself (1)
- # joyride (2)
- # kaocha (2)
- # london-clojurians (8)
- # lsp (24)
- # music (4)
- # nbb (4)
- # nextjournal (1)
- # off-topic (13)
- # other-languages (16)
- # remote-jobs (1)
- # rewrite-clj (6)
- # sci (1)
- # shadow-cljs (40)
- # tools-deps (15)
If i wanted to be able to visually hide some clojure data what would be the best way to do that? E. G kind of like folding but only a specified set of clojure data.
i do move data to their own name spaces for this reason when they are more than a few lines. I also think it makes far more sense in the long run. I can very easily see the data by evaluating the name of the def
binding around that data in the namespace with the functions that work on the data.
There is an example in the Practicalli lannding page https://github.com/practicalli/practicalli.github.io/blob/live/src/practicalli/data.cljs
Spacemacs has very simple to use folding tools and a few different folding options.
;; Code folding method. Possible values are `evil', `origami' and `vimish'.
;; (default 'evil)
dotspacemacs-folding-method 'vimish
The vimish
method allows folding of visual selectionsThanks I'll take a look
I appreciate this isn't probably isn't the approach asked for, but hopefully it's of some use
I'm thinking i could use clojure metadata to just mark them and then have something look for it. Maybe cider has something like clojure postwalk?
Are you asking where i want to hide it?
Editor buffer. In cases where you're editing clojure files.
what does the data look like? are you editing big maps? Those are relatively uncommon in .clj files
Yep. Big distracting (at times) maps.
have you tried out https://docs.cider.mx/cider/debugging/inspector.html ?
I'm not having trouble inspecting them, i just don't always need them around for what I'm currently doing in the surrounding code changes. So it would be nice to toggle them in and out as they were useful.
There are other solutions to this, references for one, but i would rather not move them out of context just because they're visually noisy.
aha
so as you say you could add metadata, e.g. (def ^:fold chunky-data {,,,})
And then you'd make (def ^:fold
part of a Hideshow mode
regex
My personal example https://github.com/zenmacs/.emacs.d/blob/cbe6088f8e8cd892b81c10cf9e2400f02b1942f7/lib/non-submodules/vemv.clojure-interaction.el#L60-L66
Ty. Ill take a deeper look when I'm back at my computer
@U0DJ4T5U1 sorry to necrobump this.
What I do is to have the built-in hs-minor-mode
on and bind hs-toggle-hiding
to an easy keybinding (I use C-c h
). This way I can not only hide pesky huge maps but also branches in if
statements that I have already dealt with. Just move right before it and toggle it. Pretty useful.
@U6MEUHZBK got around to looking at this again. Yeah hiding via hs-toggle-hiding is useful. i have been using "evil-toggle-hide" which seems to be the same thing. My idea was to add a more permanent kind of hiding, one that lasted between sessions. Not sure what form it would take it exactly.