Vim: Fold top level folds only

前端 未结 3 1018
花落未央
花落未央 2021-01-31 03:14

I have a long code file with syntax folding in Vim.

I know how to open all folds (zR) or close all folds (zM), and I know how to increase or decrease the foldlevel (zm,

3条回答
  •  暖寄归人
    2021-01-31 03:55

    As Karl says, the foldnestmax setting is probably what you want.

    zO (i.e., capital-letter-o) opens all nested folds.

    I also find zx and zv very helpful.

    When I use foldmethod=expr with a custom fold expression, I'll often modify the expression so that it only folds what I want it to fold.

提交回复
热议问题