jceb / vim-orgmode

Text outlining and task management for Vim based on Emacs' Org-Mode
http://www.vim.org/scripts/script.php?script_id=3642
Other
3.12k stars 267 forks source link

Fold plain lists sublists #385

Open Bietola opened 1 year ago

Bietola commented 1 year ago

Say I have an org document containing:

* Hello
** There
    - Hey
        + How
        + Are
        + You

It would be nice being able to fold (i.e. press z-a) with cursor at line "+ Are" and see the sublist of "- Hey" be folded instead of the "** There" heading. Is this possible with an option I am not seeing or maybe it would make a nice feature?

simoncarrignon commented 2 months ago

I comment on here as I think it's indeed a nice feature ; more over that when using headings to get the headings the update using [%] are not forward to the upper levels, whereas it work when using sublists:w

If I have something like this:

* Highes [0%]
      - [-] low one: [66%]
            - [X] a
            - [X] b
            - [ ] c
      - [-] low two: [50%]
            - [ ] d  [0%]
                  - [ ] x
                  - [ ] y
            - [X] e

If I check x and y, then d becomes 100%, thus low two becomes 100% and this highest become 50% when I do \c#

* Highes [50%]
      - [-] low one: [66%]
            - [X] a
            - [X] b
            - [ ] c
      - [X] low two: [100%]
            - [X] d  [100%]
                  - [X] x
                  - [X] y
            - [X] e

If I use subheadins, which allows me to folds low one and low two like this:

* Highes [50%]
**  low one: [66%]
            - [X] a
            - [X] b
            - [ ] c
** low two: [50%]
            - [ ] d  [0%]
                  - [ ] x
                  - [ ] y
            - [X] e

low two get updated but not highest:

* Highes [0%]
**  low one: [66%]
            - [X] a
            - [X] b
            - [ ] c
** low two: [100%]
            - [X] d  [100%]
                  - [X] x
                  - [X] y
            - [X] e

Something may already exist that I have missed, in that case very sorry about that!