Haven't found a way to indent/autoformat HOCON config files. What is you way here?
Asked
Active
Viewed 698 times
8
-
You can try `kotlin-mode`, reindent, then `conf-mode`. β Adobe Mar 04 '21 at 20:01
2 Answers
1
I'm fairly certain there isn't an Emacs major mode for HOCON. But it looks like it's similar to JavaScript, so you can make .hocon
load as JavaScript by adding this to your .emacs
:
(add-to-list 'auto-mode-alist '("\\.hocon\\'" . javascript-mode))

Brian Malehorn
- 2,627
- 14
- 15
-
1Unfortunately it looks similar to JS, but it isn't similar enough :) β Andrew Gaydenko Jul 25 '16 at 21:20
1
I think it's quite similar to the syntax of HCL. You might be interested in using emacs-hcl-mode for editing HOCON files.

Rickyson
- 11
- 1
-
As itβs currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). β Community Sep 25 '21 at 00:05