This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-13
Channels
- # announcements (1)
- # babashka (30)
- # beginners (43)
- # biff (24)
- # calva (72)
- # cider (12)
- # clj-commons (24)
- # clj-on-windows (10)
- # cljsrn (23)
- # clojure (123)
- # clojure-bay-area (6)
- # clojure-europe (43)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-uk (9)
- # clojurescript (125)
- # core-async (9)
- # cursive (2)
- # data-science (3)
- # datomic (30)
- # devops (1)
- # emacs (13)
- # events (5)
- # fulcro (15)
- # graalvm (3)
- # gratitude (1)
- # humbleui (11)
- # lsp (5)
- # nbb (24)
- # off-topic (11)
- # pedestal (5)
- # releases (1)
- # remote-jobs (1)
- # sci (15)
- # scittle (16)
- # shadow-cljs (15)
- # sql (11)
- # tools-deps (9)
- # xtdb (5)
Does anyone use anything for code folding? To just see all the first lines, say, of each code block. I found hideshow but it doesn’t seem to work, so I thought I’d check to see if there is something more popular before troubleshooting it. UPDATE: I got hideshow working but I’ll leave this here in case anyone has an alternate approach. Using vanilla Emacs in a terminal. Fun/baffling fact: the stock binding for hiding all forms in in a buffer is C-c @ C-t
! Does anyone really type that? 😳
The approved answer in this worked well for toggling hiding on all forms in a buffer, fyi: https://emacs.stackexchange.com/questions/20922/hiding-and-showing-all-blocks-with-one-binding
(defun my-hs-toggle-all ()
"If anything isn't hidden, run `hs-hide-all', else run `hs-show-all'."
(interactive)
(let ((starting-ov-count (length (overlays-in (point-min) (point-max)))))
(hs-hide-all)
(when (equal (length (overlays-in (point-min) (point-max))) starting-ov-count)
(hs-show-all))))
I actually do use C-c @ C-t
to navigate a namespace 😅 ! Along with C-c @ C-a
for showing all hidden forms.
I use tarsius bicycle package for a toggle hide/show function https://github.com/tarsius/bicycle
@U9V9M9MFZ I’m impressed! And with the time you save not having to resolve binding collisions like me you can get a lot more done. 👍
i just tried bicycle mode and it's not working reporting "Before first heading" in the minibuffer
@U0X9N9ZK5 with all the RSI you save by setting up custom keymaps for every new mode like me, you can have plenty of time for resolving binding collisions over the next 50 years of programming
Funny. I was just rebinding these to two key strokes. Some of these are bound to like emacs news or something that I hardly ever use.
I find the first to be the most useful, so is bound to the double C-h.
(require 'bind-key)
(bind-key "C-h C-h" 'hs-toggle-hiding)
(bind-key "C-h C-k" 'hs-hide-block)
(bind-key "C-h C-n" 'hs-hide-all)
(bind-key "C-h C-y" 'hs-show-all)
(bind-key "C-h C-l" 'hs-hide-level)
I actually weirdly went the route of using chords to toggle…
(key-chord-define-global "fs" (lambda () (interactive) (hs-toggle-all)))
(key-chord-define-global "fd" (lambda () (interactive) (hs-toggle-hiding)))
It feels strange but it’s super fast to use them.