Search code examples
emacsorg-mode

Set initial visiblity to a certain level in org-mode


Similar to this question except I want this as ideally a per-document setting or mode line. The ideal would be something like:

#+STARTUP: showlevels 3

Or if needed as a mode line:

# -*- org-showlevels: 3 -*-

And be equivalent to running C-3 S-tab when loading the file.

This does not appear to be directly supported in the initial visibility settings in the org-mode manual: https://orgmode.org/manual/Initial-visibility.html


Solution

  • New startup options for this are available in Emacs Org mode master since today.

    The implementation is slightly different than your suggestion Elliott, since startup keywords cannot have argument (to the best of my knowledge). But the following will now work if you are using Org mode master:

    #+STARTUP: show3levels

    (3 can be changed to any of 2,3,4,5)