IntelliJ IDEA plugin to fold .conf files?

情到浓时终转凉″ 提交于 2019-12-10 13:50:00

问题


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:


回答1:


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, and there add filename patterns to HOCON filetype.




回答2:


One relevant plugin is the Scala plugin. Another is the HOCON plugin.

To install either, go to your IntelliJ Settings/Preferences dialog (Ctrl+Alt+S for Windows; +Comma for Mac) and select Plugins, then click Marketplace and search for, then install, one or both of these. Restart IntelliJ to enable it/them.

To confirm, go back to your IntelliJ Settings/Preferences dialog and you should now see Human-Optimized Config Object Notation (HOCON) file types among those listed. Click HOCON and you should see *.conf under "Registered Patterns".

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



来源:https://stackoverflow.com/questions/44642314/intellij-idea-plugin-to-fold-conf-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!