Looks like you are looking for folding . Essentially, all you need to get started:
set foldmethod=syntax set foldcolumn=<n> " the number of columns to use for folding display at the left
and manipulate it with the mouse set mouse=a to enable mouse material. The opening / closing folds + and - displayed in the summary column on the left, next to the line numbers, and not directly by the code you drew, but it should be good enough! You will probably need a column width of at least a pair, so you can see the folds outside the first level.
It depends on the folding that was defined for the syntax of the type of file you are currently editing. Vim comes with folding rules for some common things, such as C, but not for everyone. Perhaps if it had not been sent with vim, someone created it, and you could find something suitable for you.
Cascabel
source share