Vasily802
Vasily802

Reputation: 1848

IntelliJ IDEA plugin to fold .conf files?

I have a Scala app built with Lift framework. It has a few .conf files. When I open those .conf files in my IntelliJ IDEA Ultimate Fancy Pants Edition, I do not see any buttons to fold those curly braces in those files. Hotkeys do not do it either. Browsed for plugins, none applicable found. Is there any solution to enable code folding in .conf files?

Update:
Here is an illustration of what would be lovely. Those "-" and "+" icons do not appear in .conf files: enter image description here

Upvotes: 18

Views: 17709

Answers (3)

Woodchuck
Woodchuck

Reputation: 4414

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.

Upvotes: 28

Andrii Abramov
Andrii Abramov

Reputation: 10751

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.

Upvotes: 6

Vasily802
Vasily802

Reputation: 1848

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.

Upvotes: 17

Related Questions