Hide certain lines/libraries/variables
Answered
Hi,
is there possibility to hide certain lines of code? For example I am logging with winston, but for some critical and/or complex components, there is a lot of code for logging errors, which makes that components less readable.
For me, the best-practice would be to define variable name (i.e. winston), which I will not see in IDE, or it would be collapsed by default or something like that and with some shortcut, I woud like to turn this feature on/off.
Can I do this? Or at least something similar to this?
Please sign in to leave a comment.
You can fold certain regions, see http://blog.jetbrains.com/idea/2012/03/custom-code-folding-regions-in-intellij-idea-111/.
Very nice, thank you! Now, is there possibility to only collapse/expand the editor-fold parts and/or define editor-fold names to automatically collapse/expand?
You can set custom folding regions to be collapsed by default:
Very nice, thank you!
If anyone else reading this, I would also like to add, that with this option on, if you do CTRL+SHIFT+MINUS and then CTRL+SHIFT+PLUS all the custom foldings will be collapsed, while everything else will be expanded (next CTRL+SHIFT+PLUS will expand them too), which is really something I like.