In visual studio, there is a very convenient line with + and - to show the code which blocks it belongs to. I was wondering if there was the same function in emacs.
This is commonly referred to as "code foldlng" or just "folding". There are several packages that implement this behavior, and each one displays folded and foldable code in their own way, which may not be graphical. Remember, Emacs has deep roots in text, and graphic bells are whistles are still "new". Your favorite search engine should help you out, but some popular packages are
- Folding Mode (EmacsWiki/GitHub)
- Hide Show (EmacsWiki), see also Hide Show Fringe
- Outline Mode (EmacsWiki), see also (OutlineMinorMode)
- Vimish Fold (GitHub)
- Origami (GitHub)
I personally use Folding Mode because I can control how it folds, and it works will with Vim.
Some some programming-language-specific major modes also include folding functionality, such as nxml-mode. Check the docs of your major mode.