You might have noticed that the structure of the header is determined by:
| ### * My header of level 1
...
### ** My header of level 2
### *** Level 3
...
|
The number of stars determines the depth of the header. You can use it
conveniently in the Emacs text editor to fold code using orgstruct
. You can
add the following line to your .emacs
:
| (add-hook 'ess-mode-hook
'(lambda ()
(orgstruct-mode)
(setq outline-regexp "[ ]*### ")
(setq orgstruct-heading-prefix-regexp "[ ]*### ")))
|
Now you can use TAB
and SHIFT+TAB
when the cursor is on one of the headers
to cycle through the different visibility levels.