Skip to content

Add option to enhance recursive zC to all nested folds #5

@kiryph

Description

@kiryph

Vim's default behaviour for zC and zA when closing is that it only closes folds under the cursorline which is always only one line. This is identical to zc and za. Only when using visual selection the recursive nature of zC can be used.

IMHO I would expect a different behavior more similar to your plugin except that zC means always closing of the fold of the current cursor and all folds contained in this fold. zA should follow this pattern when closing except it inverts the current fold and all nested folds.

I suspect this should be quite close what your plugin does and could easily be added.

A similar discussion about my intention can be found here:
http://vim.1045645.n5.nabble.com/Folding-recursively-levels-td4848210.html

Update
For consistency one could also change zO and as a second option also change visual mode behaviour

Vim help would look like without visual mode description:

...
							*zO*
zO		Open all folds under the cursor recursively.  Folds that are
                contained in the fold of the cursor line are also changed.
...
							*zC*
zC		Close all folds under the cursor recursively.  Folds that are
                contained in the fold of the cursor line are also changed.
...
							*zA*
zA		Toggle the fold status of the fold under the cursor and
                all folds contained in this fold.
...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions