I have a C codebase with source files using #ifdef blocks all over. There are multiple identifiers and corresponding ifdefs (with the ifdefs nested to multiple levels). While viewing the code in vim, is there a way for me to define multiple identifiers and view/highlight my code such that I see only those ifdef blocks which are applicable when an identifier is defined.
#if defined(ID1) && (ID1 == 1)
// code 1
#elif defined(ID1) && (ID1 == 2)
// code 2
When set ID=1, my view should only display/highlight code 1, when ID=2 my view should only display/highlight code 2, otherwise if ID is not defined, both code 1 and code 2 should not be highlighted or displayed.

That said, if you want to hide code when reading, there are a couple ways you can achieve that
:help foldfor more details