1

I am looking to activate vim style marker folding using origami without losing the default functionality. I know I can activate the marker options like so:

(add-hook 'prog-mode-hook
          (lambda () (setq-local origami-fold-style 'triple-braces)))

but then the default behavior is overwritten.

In case it matters: I am using Spacemacs.

7
  • What default behaviour? Are you saying you don't want to lose emacs' default folding behaviour? Are there particular aspects of that that you want to preserve? I'm not personally a huge user of folding, except for org, but I suspect that what appears to you to just be "emacs default folding" may be the result of a lot of configuration in spacemacs, so it may pay to be more specific. – Croad Langshan Feb 17 '19 at 18:35
  • 2
    I just want to retain the default origami auto folding methods. For example, when coding in Common Lisp or Emacs Lisp it will fold defun etc. Quite standard stuff really. I don't think it is specific to Spacemacs. – Dionysis Feb 17 '19 at 18:49
  • Use file-local variables for files you want to use with marker based folding. – nega Feb 17 '19 at 22:34
  • @nega I would like all files to be marker based while also retaining their usual folding behaviour. Is that possible with file-local variables? – Dionysis Feb 17 '19 at 22:39
  • 1
    I'm fairly certain you can't do what you want out of the box with folding.el origami-mode or hide-show. With origami-mode you get 1 parser per buffer, so you'd have to write you're own parser that understood the "default" folding and combined it with markers. – nega Feb 17 '19 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.