IntelliJ IDEA plugin to fold .conf files?

2020+

The best option is to install HOCON plugin separately. For now, HOCON file type is not bundled with Scala plugin anymore.


P.S. All credits to ghik's comment. Decided to put this into separate answer because I was not able to find the tip at first time.


The relevant plugin is the HOCON plugin.

To install, click the Get button from the above JetBrains Marketplace link. Or, from within IntelliJ, go to Settings/Preferences (Ctrl+Alt+S for Windows; +Comma for Mac) and select Plugins, then click Marketplace to search for the plugin and install it. Restart IntelliJ to enable it.

To confirm, go back to Settings/Preferences and select Editor > File Types. You should now see HOCON (Human-Optimized Config Object Notation) file types among those listed as "Recognized File Types". Click HOCON and you should see *.conf under "File name patterns".

All your .conf files should now appear in IntelliJ with syntax highlighting and code folding.

Edited Oct 2020 to remove Scala plugin reference, as it no longer seems to support HOCON files.


Those .conf files are of HOCON type ("Human-Optimized Config Object Notation"). To enable folding them, you have to force the editor treat them as such. In IntelliJ settings, configure it as illustrated: Preferences->Editor->File Types

Preferences->Editor->File Types, and there add filename patterns to HOCON filetype.