So, you’ve opened the CPP file you are working on. For the moment, you just want to see all the functions that have been defined, to get an idea of the functionality provided. But your file is 102KB. If only there were some way you could collapse all the code!
*blaring trumpet sounds* EMACS to the rescue!
Simply fire up a mode called outline-minor-mode. M-x outline-minor-mode
Now, to collapse the code, hit M-x hide-other. Voila!
When you find the function you were looking for, you might want to read the code for it. Hit M-x show-subtree.
Finally, to expand all of the code back again, hit M-x show-all
That is all folks!
This blog is increasingly getting to be an Emacs blog! This is what happens when a geek is separated from his beloved Unix environment and has only Emacs as consolation. Since I code in C/C++ at the workplace, I’m now planning to write a bit about Object Oriented Programming. Or some such things 🙂