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.

enter image description here,

  • The VS marks also allow you to collapse and/or unhide the blocks. – mmmmmm Aug 29 '19 at 17:11

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.