Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fold #ifdef/#ifndef blocks in Emacs?

Tags:

c

emacs

I want to hide blocks of #ifdef and #ifndef blocks in C. Looks like I'd either need to use Folding mode or the Outline minor mode.

like image 657
ashawley Avatar asked Mar 13 '09 00:03

ashawley


People also ask

How do you fold like a pro?

Fold a face-down shirt in half lengthwise. Fold both sleeves over and bring the bottom hem up to the collar. Fold the stack in half once more making a small rectangle. File them vertically in a drawer so the folded "spines" of the shirts are visible.


1 Answers

hide-ifdef-mode should do something like that. I have not used it myself though, but turn it on and read it's description with the commands below. It should be included with emacs.

M-x hide-ifdef-mode
C-h m
like image 117
Zitrax Avatar answered Oct 09 '22 03:10

Zitrax