3

I am new to Emacs and struggling to learn it.

I have a test.org file:

* Heading

** Sub-Heading

*** Third-level

When I open the file, the buffer just displays:

* Heading...

Where did all the rest of my text go? How do I see what else is in that file?

Dan
  • 32,584
  • 6
  • 98
  • 168
tom_kp
  • 81
  • 4
  • You can use [Tab] to expand headings when your cursor is on them, and [Shift] + [Tab] to cycle the visibility of all headings in your file at the same time. These don't modify anything, they're just visual things. – Archenoth Aug 04 '17 at 16:02

1 Answers1

2

Showing just a visible summary of the buffer is one of the features of org-mode, which is, in turn, built on top of outline-mode.

The idea is to get a lot of the details out of the way so you can get an overview of the buffer contents, and then drill down into the relevant sections by unfolding/showing the contents while leaving everything else folded/hidden.

Take a look at the org-mode manual node on visibility cycling to see how to use this feature.

You can, of course, customize the level of visibility that org-mode uses at start up. For the default value, you can use the customize machinery to set the value of org-startup-folded, or you can set it by hand in your init file. Here's the docstring for that variable (which you can view by hitting C-h v org-startup-folded, which calls describe-variable on that variable):

org-startup-folded is a variable defined in ‘org.el’. Its value is t

Documentation: Non-nil means entering Org-mode will switch to OVERVIEW. This can also be configured on a per-file basis by adding one of the following lines anywhere in the buffer:

#+STARTUP: fold (or ‘overview’, this is equivalent)

#+STARTUP: nofold (or ‘showall’, this is equivalent)

#+STARTUP: content

#+STARTUP: showeverything

By default, this option is ignored when Org opens agenda files for the first time. If you want the agenda to honor the startup option, set ‘org-agenda-inhibit-startup’ to nil.

You can customize this variable.

So you could put (setq org-startup-folded t) in your init file if you wanted to fold everything up by default, or (setq org-startup-folded nil) if you want it to show everything at startup.

As the docstring implies, you can also set visibility on a file-by-file basis by putting something like

#+STARTUP: fold

or

#+STARTUP: showeverything

at the beginning or end of the file. (Note that you would need the # to line up with the leftmost column; don't indent it or org-mode may not understand what you're doing.)

Dan
  • 32,584
  • 6
  • 98
  • 168