1

Currently, when I run helm-org-in-buffer-headings in see something like this:

* main topic 1
** Subtopic 1.1
** Subtopic 1.2
*** Sub-subtopic 1.2.1
* main topic 2

I would like to hide the leading stars and remove the indentation, so that instead, what you see is this:

main topic 1
Subtopic 1.1
Subtopic 1.2
Sub-subtopic 1.2.1
main topic 2

Any ideas?

1

You can hide the first N-1 stars by setting org-hide-leading-stars to a non-nil value, although it will still keep the headlines indented.

You can also tweak helm-org-startup-visibility to remove all stars and headline indentation:

(with-eval-after-load "helm-org"
  (defun helm-org-startup-visibility (candidates _source)
    (setq-local indent-tabs-mode t)
    (cl-loop for i in candidates
         collect
             (cons
              (with-helm-buffer
        (org-indent-remove-properties-from-string
         (replace-regexp-in-string "^\\(\\**\\)\\(\\* \\)" "" (car i))))
              (cdr i)))))
  • Thanks. I use org-indent-mode currently. I am really looking to remove the leadin stars and the indentation. – Adam Feb 21 at 16:59
  • I updated the answer. See if that works for you. – jagrg Feb 21 at 21:53
  • I updated the answer again to make it work with org-indent-mode. – jagrg Feb 22 at 9:54

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.