S-tab cycles between
SHOW ALL these three states. But I want it to just cycle between
SHOW ALL. How can I realize it?
I do not think this is straightforward. You definitely need a custom function. The docstring for org-cycle has the following:
When this function is called with a prefix argument, rotate the entire buffer through 3 states (global cycling)
OVERVIEW: Show only top-level headlines.
CONTENTS: Show all headlines of all levels, but no body text.
SHOW ALL: Show everything.
When called with two ‘C-u C-u’ prefixes, switch to the startup visibility, determined by the variable ‘org-startup-folded’, and by any VISIBILITY properties in the buffer. When called with three ‘C-u C-u C-u’ prefixed, show the entire buffer, including any drawers.
I suggest the following scheme:
- You need to set an initial visibility. There are two ways to go about it, either set
org-startup-foldedor put a
#+startup: contentline somewhere in the buffer.
- Next you use a function like the following to cycle the buffer. Calling the function below shows the default setting from step (1), providing a prefix argument shows everything, including drawers.
(defun my-cycle (&optional arg) "Cycle between CONTENTS and SHOW ALL" (interactive "P") (if (equal arg '(4)) (show-all) (org-set-startup-visibility)))
Note that overriding the default keybinding is very hard since Org does too many smart things under the hood. It's very hard to make sure everything will keep working as expected if you fiddle with how