reddit / emacs

Folding

ccakes_ · 2022-06-01 21:42
**EDIT:** Solved - see comment 👇 This is definitely a rookie question - but I use `hs-minor-mode` for folding and my preference is to auto-fold by default when visiting a file so I've got this in my init.el ``` (add-hook 'prog-mode-hook (lambda () (hs-minor-mode) (hs-hide-all))) ``` Worked fine - open a file and everything folds. I'm switching from `lsp-mode` to `eglot` and when use `eglot-format` or `go-mode` to format the buffer instead of `lsp-format-buffer` it seems to re-trigger this hook and fold everything down for me. This didn't happen with `lsp-format-buffer` Is `prog-mode-hook` not the best place to do this?
ccakes_ · 2022-06-01 22:46
Ignore me - I found buried in a config file a bad global `before-save-hook` which was causing my pain.