Skip to content

[FR]: close_fold_levels_for_ft #321

@litoj

Description

@litoj

Feature description

Just like there is close_fold_kinds_for_ft, it would be nice to have the same option for levels in general.

Describe the solution you'd like

We should be able to use a close_fold_levels_for_ft config table to specify a map of filetypes to list of levels to close.

Ideally there would be also a possibility to put in a '+' at the end (to close all folds from that level onwards).

Additional context

I haven't found a way to efficiently set a file-specific foldlevel. The problem with using foldlevel at all, is that when I open a fold (zA/za) the fold closes as soon as I finish my edit and go back to normal mode.

Compared to that, closing folds using ufo.closeAllFolds() and then opening them using za keeps them opened even after escaping from insert mode, which I much prefer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions